How to Encode and Decode HTML Entities (& < > and More)
Turn special characters into HTML entities so text shows correctly in a web page, or decode entities back to normal text.

HTML treats <, > and & as part of its own syntax. If you want to show them as text, you must write them as entities: <, > and &. Forgetting this breaks pages and can even create security problems.
Quick answer
Choose Encode to convert special characters to entities, or Decode to turn entities back into characters. Tick the extra option to encode every non-ASCII character too.
The characters that matter
| Character | Entity | Why |
|---|---|---|
& | & | starts an entity |
< | < | starts a tag |
> | > | ends a tag |
" | " | inside attributes |
' | ' | inside attributes |
| non-breaking space | | prevents wrapping |
Steps
- Paste your text.
- Pick Encode or Decode.
- Copy the result.
Example
<p>Tom & "Jerry"</p> encodes to <p>Tom & "Jerry"</p>, which shows as the original text in a page.
Why it matters
- Showing code in a tutorial.
- Preventing broken pages when user text contains
<. - Security: failing to encode user input can enable cross-site scripting (XSS). Always encode output in your application, not only in a tool.
- Email templates and CMS fields that expect HTML.
Tips
- Encode only once; double-encoding shows
&lt;on the page. - If you use a template engine, it may encode for you automatically.
- For URLs, use URL encoding, which is a different thing.



