HTML Entity Encoder & Decoder
Encode and decode HTML entities — named like & and ©, numeric like €, hex like €. Live preview. All in your browser.
Escapes only the five characters that break HTML: & < > " '. Use this for content going into HTML markup.
Use this free HTML entity encoder and decoder to convert characters to and from entity references — named like ©, decimal like €, or hex like €. Three encode modes give you control over how much to escape, and decoding handles every entity your browser understands.
How to use it
No account, no upload — it all happens on your device.
The five characters you must always escape
Forgetting any one of these is how XSS happens.
| Character | Entity | Why |
|---|---|---|
| & | & | Starts every other entity. Always escape first. |
| < | < | Opens a tag. Unescaped means injected markup. |
| > | > | Closes a tag. Pairs with < for safe HTML. |
| " | " | Closes attribute values. |
| ' | ' (or ') | Closes single-quoted attributes. |
When you'd reach for each encode mode
The three modes solve three different problems.
- Basic. The minimum for safe HTML. Use this when you control the encoding and rendering, and your storage is already UTF-8 end-to-end. Cleanest, smallest output.
- Basic + non-ASCII (numeric). Same as Basic but every non-ASCII character becomes
&#nnn;. Use this when the file has to be 7-bit clean — old SMTP relays, ASCII-only databases, certain legacy CMSes. - Named entities + numeric. Replaces characters with their named entity where one exists (
©,—,€), numeric for everything else. More readable in source, but slightly larger and only useful when humans are reading the HTML.
Common named entities
The shortcuts you'll see most often in real HTML.
| Character | Named entity | Numeric |
|---|---|---|
| © | © | © |
| ® | ® | ® |
| ™ | ™ | ™ |
| € | € | € |
| £ | £ | £ |
| ¥ | ¥ | ¥ |
| — | — | — |
| – | – | – |
| “ ” | “ ” | “ ” |
| ‘ ’ | ‘ ’ | ‘ ’ |
| … | … | … |
| • | • | • |
| → | → | → |
| nbsp | |   |
Privacy
Encoding and decoding both run in your browser. Encoding uses plain string replacement; decoding uses the browser's built-in HTML parser, which understands every entity it would in a real page. Nothing is uploaded, nothing is logged.