HTML Encoder/Decoder
Encode and decode HTML entities online for free. Convert special characters to HTML codes and vice versa. Safe for web use.
An HTML encoder replaces the characters that carry meaning in markup with their entity equivalents, so a browser prints them instead of running them. On the Encode tab with Named Entities selected, five characters change: & < > " and '. Encoding <p>Hello & World "quotes" 'apostrophe'</p> turns 42 characters into 76, and the stat strip reports 9 entities found and a size change of +81%.
HTML entity workspace
Encode HTML as literal text, decode entity references, inspect a restricted preview or search the symbol reference.
Method and limits
Named mode escapes &, <, >, double quotes and apostrophes. Decimal and hexadecimal modes also encode non-ASCII characters by Unicode code point. All-character mode encodes every code point. Decoding supports HTML named and numeric references while preserving literal tags.
Encoding HTML is not universal XSS protection: JavaScript, CSS and URL contexts need their own rules. Preview removes active content and resources. Malformed Unicode and NUL text are refused. There is no fixed text cap; browser memory still limits large drafts.
Processing happens in this browser; these converters do not upload your draft. Other site features can make requests.
Preview keeps basic text formatting only. Attributes, scripts, forms, embedded documents and external resources are removed. Images contribute their alternative text; links are not active. This is not a full web page preview.
| Character | Named entity | Numeric entity | Hex entity | Description | |
|---|---|---|---|---|---|
Copied
Copy failed. Select the result and copy it manually.
About HTML Encoder/Decoder
Encode HTML as literal text, decode entity references, inspect a restricted preview or search the symbol reference. Named mode escapes &, <, >, double quotes and apostrophes. Decimal and hexadecimal modes also encode non-ASCII characters by Unicode code point. All-character mode encodes every code point. Decoding supports HTML named and numeric references while preserving literal tags.
<b>A&B</b> becomes <b>A&B</b>. Decimal encoding of 😀 is 😀, which decodes back to 😀.
Encoding HTML is not universal XSS protection: JavaScript, CSS and URL contexts need their own rules. Preview removes active content and resources. Malformed Unicode and NUL text are refused. There is no fixed text cap; browser memory still limits large drafts.
Use Cases
How to use
Choose encode or decode and the entity style. Enter text, compare input and output, then swap or copy. Preview and reference are separate modes.
<b>A&B</b> becomes <b>A&B</b>. Decimal encoding of 😀 is 😀, which decodes back to 😀.
Pro Tips
- Encoding HTML is not universal XSS protection: JavaScript, CSS and URL contexts need their own rules. Preview removes active content and resources. Malformed Unicode and NUL text are refused. There is no fixed text cap; browser memory still limits large drafts.
Troubleshooting
The output is identical to the input and Entities Found stays at 0.
With Named Entities selected, only & < > " and ' are converted, so text without any of those five characters comes back unchanged. That is correct behaviour. If you need accented or non-Latin characters converted too, switch to Numeric Entities or Hex Entities.
Decoding gives back text that still contains & and <.
The source was double-encoded: the ampersand of each entity had itself been encoded before you received it. Press Decode a second time on the output, or use Swap and run the decode again, until the entities stop shrinking.
Encoded output shows ' where I expected '.
That is deliberate. ' was introduced for XML and HTML5 and was never part of HTML 4, so this tool writes the numeric ' instead, which every browser and mail client renders correctly.
The Size change counter jumps to several hundred per cent.
The encoding type is set to All characters, which converts every character in the text to a numeric entity rather than only the five that matter in markup. Switch back to Named Entities unless you specifically want that obfuscation.
Frequently Asked Questions
Named mode escapes &, <, >, double quotes and apostrophes. Decimal and hexadecimal modes also encode non-ASCII characters by Unicode code point. All-character mode encodes every code point. Decoding supports HTML named and numeric references while preserving literal tags.
Encoding HTML is not universal XSS protection: JavaScript, CSS and URL contexts need their own rules. Preview removes active content and resources. Malformed Unicode and NUL text are refused. There is no fixed text cap; browser memory still limits large drafts.
Processing happens in this browser; these converters do not upload your draft. Other site features can make requests.