HTML Encoder Decoder
Encode and decode HTML entities.
Your text is processed in your browser.
The result is shown as text, not rendered as HTML. Decoding does not sanitize HTML.
The result is shown as text, not rendered as HTML. Decoding does not sanitize HTML.
Encode and decode HTML entities instantly. This developer tool handles text conversion entirely client-side in your browser.
How to use it
- Choose Encode or Decode.
- Paste text or HTML entities. Use automatic conversion or turn it off and press the conversion button.
- Copy the valid result as text. Decoding does not sanitize HTML.
How HTML entity encoding and decoding work
This encoder escapes five characters: &, <, >, double quotes and apostrophes. By default, accents, emoji and other Unicode characters remain unchanged. For example, <b> becomes <b>.
Enable “Encode Unicode” to convert accents, emoji and other non-ASCII characters to decimal references. For example, è 😀 becomes è 😀.
| Character | Tool output | Decimal equivalent |
|---|---|---|
| & | & | & |
| < | < | < |
| > | > | > |
| " | " | " |
| ' | ' | ' |
Named and numeric references
Decoding uses the browser’s HTML rules for names such as ©, decimal references such as ©, and hexadecimal references such as 😀. Some legacy names also work without a semicolon. Invalid numeric code points may become the replacement character �.
One layer at a time
Encoding also escapes existing ampersands, so < becomes &lt;. Decoding makes one pass: &lt; becomes <, not <. Run it again only if you intentionally want to remove another layer.
&lt; → < → <This is not an HTML sanitizer or an XSS guarantee. Decoded text may contain tags and scripts: this tool displays them as text only. Do not insert the result as HTML or JavaScript without protection appropriate to that context.
WHATWG — HTML character referencesFrequently asked questions
Why do I need HTML entities?
Because a raw < or & is read as markup. Escaping it makes the browser display the character instead of trying to interpret it as a tag.
Does escaping prevent XSS?
This is not an HTML sanitizer or an XSS guarantee. Decoded text may contain tags and scripts: this tool displays them as text only. Do not insert the result as HTML or JavaScript without protection appropriate to that context.
Which characters must be escaped?
This encoder escapes five characters: &, <, >, double quotes and apostrophes. By default, accents, emoji and other Unicode characters remain unchanged. For example, <b> becomes <b>. Enable “Encode Unicode” to convert accents, emoji and other non-ASCII characters to decimal references. For example, è 😀 becomes è 😀.
Why does &lt; decode to < instead of <?
Encoding also escapes existing ampersands, so < becomes &lt;. Decoding makes one pass: &lt; becomes <, not <. Run it again only if you intentionally want to remove another layer.