HTML Entity Encoder & Decoder
Make text safe to show inside HTML, or turn &-style codes back into normal characters.
🔒 Your files and text never leave your device. Everything is processed in your browser.
How to use
- Choose Encode or Decode.
- Paste your text or HTML.
- Copy the result.
When characters must be escaped
In HTML, < and > start tags and & starts an entity, so showing them as text requires <, > and &. Inside attribute values, quotes need " too. Escaping user input before inserting it into a page is a basic protection against cross-site scripting.
Decoding entities
Text copied from page sources, feeds or emails often contains codes like &nbsp; or &#39;. Decoding turns them back into the readable characters.
Frequently asked questions
Why encode HTML?
So that characters like < and & display as text instead of being read as code.
Are named entities decoded?
Yes. Named, decimal and hex entities are all decoded.