HTML Entity Encoder and Decoder
Escape special characters such as < > & and quotes so text displays safely in HTML, or decode entities like © and © back to characters.
Result
Enter text or HTML to encode or decode.
How to use this tool
- Choose Encode to escape text for HTML, or Decode to convert entities back to characters.
- Tick Also encode non-ASCII characters to write accented letters and symbols as numeric entities.
How it works
Encoding replaces the five characters with special meaning in HTML: & → &, < → <, > → >, " → " and ' → '. Optionally, every non-ASCII character becomes a hexadecimal numeric entity such as é. Decoding converts all numeric entities and the commonly used named entities back to characters.
Example
Escaping markup
<a href="x">Tom & Jerry</a> → <a href="x">Tom & Jerry</a>
Privacy and limitations
- Everything runs in your browser.
- Decoding supports all numeric entities and about 60 common named entities; rare named entities are left unchanged and counted in a note.
- Escaping text is one part of preventing cross-site scripting; frameworks should escape output automatically.
Frequently asked questions
When do I need HTML entities?
When showing characters that would otherwise be read as HTML — for example displaying code samples or user-entered text.
Are © and © the same?
Yes. Both produce ©. Numeric entities work for every character; named entities exist only for some.