Some characters have special meaning in HTML — the less-than sign starts a tag, the ampersand starts an entity — so to display them literally you must encode them. The HTML Entity Encoder converts those reserved characters into their safe entity equivalents and decodes entities back into plain characters, a must-have when you are writing code examples or escaping user content.
How to use the HTML Entity Encoder
- Paste your text or HTML.
- Click Encode to make it safe, or Decode to reverse it.
- Copy the result.
Why entities prevent broken pages
If you put a raw < or & directly into a web page, the browser may try to interpret it as code rather than text, breaking your layout or, worse, opening a security hole. Encoding turns those characters into harmless entities like < and & that display correctly without being executed. This is essential for showing code snippets on a page, and for safely displaying anything a user typed without letting it inject markup.
Tips for safe HTML
- Always encode user-supplied text before placing it in a page.
- Encode code examples so tags appear as text rather than rendering.
- The big four are < > & and the quote characters.
- Decode when you need to recover the original characters from encoded HTML.
Everything is processed in your browser, so your content stays private.
Quick reference
| Character | Entity |
|---|---|
| < | < |
| > | > |
| & | & |
| Quote (") | " |
| Processing | Local |