HTML entity encoder and decoder
Turn special characters into HTML entities (&, <, >, ") and back, instantly. Encode just HTML's reserved characters, or every non-ASCII character too (accents and emoji) as numeric entities. Decoding accepts both named and numeric entities, decimal (©) and hexadecimal (©). Everything happens in your browser: your text is never uploaded to any server.
How to encode and decode HTML entities
- Paste your text or your HTML entities into the box on the left.
- Choose “Encode” to escape characters or “Decode” to recover them.
- If encoding, tick the box to convert non-ASCII characters too.
- The result appears instantly on the right.
- Copy it with the “Copy” button.
Frequently asked questions
What is an HTML entity?
It is a way to write a reserved or special character using a safe sequence that starts with & and ends with a semicolon. For example, the less-than sign is written < and the ampersand is written &, so the browser does not confuse them with HTML tags.
Which characters are encoded by default?
The five that matter for HTML: & as &, the less-than sign as <, the greater-than sign as >, the double quote as " and the single quote as '. With the box ticked, every non-ASCII character is also converted to its decimal numeric entity.
What is the difference between named and numeric entities?
Named ones are readable, like & or ©. Numeric ones use the code point: decimal (©) or hexadecimal (©). This tool decodes all three forms and, when encoding non-ASCII, generates decimal numeric entities for maximum compatibility.
Does it help prevent XSS attacks?
Escaping HTML entities is a key part of displaying text safely, but XSS prevention depends on the context (HTML, attributes, JavaScript or URL). Do not treat it as a complete solution on its own.
Does it keep accents and emoji?
Yes. It works with UTF-8 and handles emoji correctly (surrogate pairs), both when decoding and when encoding non-ASCII to numeric entities.
Is my text uploaded to any server?
No. The whole process happens in your browser with JavaScript; your text never leaves your device and it works offline.