[ TIDY / [&;] ]
HTML entity encoder & decoder
Escape HTML-sensitive characters or decode supported entities as text.
02 / Your result
Your result will appear here.
Start with your own input or try an example.
What it does
Prepare a text snippet for an HTML example or inspect escaped text from a data export. Encode markup-sensitive characters and common symbols, or decode supported named and numeric references into plain text. Results are displayed as text and never inserted as live HTML, so a decoded snippet cannot run in this preview.
Useful when
- Escape a short HTML example for inclusion in documentation.
- Read numeric Unicode references in an exported text field.
- Compare a string before and after one layer of entity encoding.
How to use it
- Choose encoding or decoding and paste up to 50,000 characters.
- Convert the text and inspect its escaped or readable form.
- Copy the result or download a plain text file.
A few useful details
Which entities does this converter support?
Named references are amp, lt, gt, quot, apos, nbsp, copy, and reg, with case-sensitive names and required semicolons. Decoding also accepts decimal and hexadecimal numeric Unicode references. Unknown named entities and incomplete references stay unchanged.
Does decoding follow every HTML parser rule?
No. Decoding runs once and does not parse HTML. For example, &lt; becomes < rather than a less-than sign. Numeric references to null, surrogate values, out-of-range code points, and controls are rejected, except tab and newlines; legacy HTML control-code remapping is not applied.
Is encoding the same as sanitizing HTML?
No. Encoding escapes supported text characters and will encode existing ampersands again. It does not validate URLs, CSS, JavaScript, or markup. Use context-appropriate escaping and sanitization when inserting content into a real application.