HTML Encoder / Decoder
Encode special characters to HTML entities and back. Live output. Client-side.
How to use
Pick a direction with the tabs — Encode or Decode. Paste your input into the left pane. The output appears on the right as you type.
Encode mode always converts the five special characters (&, <, >, ", '). Turn on Encode non-ASCII to also convert characters above 127 — accented letters, symbols, currency signs — using your chosen style (named, decimal, or hex).
Decode mode handles every entity the browser knows: named (©), decimal (©), and hex (©).
Keyboard shortcuts
Three shortcuts:
| Cmd / Ctrl + K | Focus the input pane |
| Cmd / Ctrl + Enter | Copy output to clipboard |
| Cmd / Ctrl + / | Toggle between Encode and Decode |
When to use it
Encoding matters whenever text goes into an HTML page and the text contains characters HTML treats specially.
- Displaying code snippets inside HTML without them being interpreted as markup.
- Preventing XSS by escaping user input before rendering it.
- Ensuring special characters like
&in URLs or query strings render correctly. - Making non-ASCII content robust across systems with limited encoding support.
Decoding matters when you receive HTML-encoded content and need the original text back — from an API, a legacy database column, or a scraped page.
Options
Encode non-ASCII (Encode mode) — when off, only the five special characters get encoded. When on, everything above ASCII 127 also gets converted to an entity.
Style (Encode mode, only when non-ASCII is on):
- Named — uses readable names like
©,€,—for common characters. Falls back to decimal for anything without a named entity. - Decimal — numeric like
©. Universal, always works. - Hex — numeric hex like
©. Common in generated markup.
Decode has no options — the browser's HTML parser handles every entity type.
Format-specific gotchas
Only five chars are dangerous. For preventing HTML injection, encoding just &, <, >, ", and ' is enough. Encoding non-ASCII is a display/portability choice, not a security one.
Order of the basic 5 matters. Ampersand must be encoded first, otherwise you double-encode. This tool handles that.
Decoding uses the browser DOM. That means it accepts loose HTML too — an unterminated entity like © without the semicolon still decodes in many browsers. Result may vary by browser.
Emoji are supra-BMP. Modern browsers handle them fine as decimal or hex entities (😀), but named entities don't exist for them.
Privacy
Everything runs in your browser. Your text never leaves the page — no server, no logging, no analytics on the content.