HTML Entity Encoder and Decoder
Escape text so it shows correctly inside HTML, or turn HTML entities back into readable characters.
or drop a file here · .txt, .html · up to 20 MB
About the HTML Entity Encoder and Decoder
Some characters have a special meaning in HTML. The ampersand starts an entity and the less-than sign starts a tag, so text containing them must be escaped before it is placed in a page, or the browser will misread it. The reverse problem is just as common: text copied out of a CMS, an RSS feed or a database arrives full of codes such as &, and ₹ that should be ordinary characters.
When to use it
- You want to show a code sample or a raw tag on a web page as text.
- A product title from an export reads “Tom
&Jerry” instead of “Tom & Jerry”.
Worked example
Press Try an example to load a short paragraph tag containing a rupee price, curly quotes, an ampersand and the word café. Keep the default option and press Encode. The angle brackets, the ampersand and the straight double quotes around the class name are replaced with their entities, while ₹, the curly quotes and é are left as they are, since a UTF-8 page can show them directly.
Choose Also all non-English characters and encode again. Now é becomes é, the rupee sign becomes a hexadecimal reference, and the dash and curly quotes become named entities. Paste the result back in and press Decode to get the original text.
Which option to choose
- Only & < > “ ’ is right for almost every modern page. It makes text safe both between tags and inside attribute values.
- Also all non-English characters is for files that must be pure ASCII.
About decoding
All 2,231 named character references in the HTML standard are recognised, together with decimal and hexadecimal numeric ones. Some old names without a closing semicolon, such as ©, are decoded the way browsers do. A name that does not exist is left untouched rather than guessed.
For other kinds of escaping, use the URL encoder or the Base64 tool.
How to use HTML Entity Encoder and Decoder
- Paste text or HTML.
- To encode, choose whether to also encode non-English characters.
- Select Encode or Decode, then copy or download the result.
Privacy: how it works
Everything happens in your browser. Your text is not sent to any server.
Frequently asked questions
Which characters must be encoded?
In HTML text, & and < must be escaped; inside attribute values, quotes must be too. The default option encodes & < > " and ', which is enough for both.
When should I encode non-English characters?
Only when a file must be plain ASCII, for example for an old system. Modern pages saved as UTF-8 can contain ₹, é or Hindi text directly.
Which entities can it decode?
All 2,231 named references in the HTML standard, such as © and , plus numeric ones such as ₹ and ₹. Unknown names are left as they are.