HTML Entity Encoder & Decoder — Escape, Unescape & Local
Encode or decode HTML character references in your browser. Steps: pick Encode or Decode, paste text, choose scope (minimal, non-ASCII, or all) and output form (named, decimal, hex), then copy. Example: Tom & Jerry → Tom & Jerry. Handles ©, ©, and emoji like 😀 — paste stays local.
How it works
Choose Encode to turn characters into HTML character references, or Decode to reverse them. Encoding runs character-by-character in this tab — pick a scope (which characters to escape) and an output form (named like ©, decimal ©, or hex ©). Decoding uses a safe textarea parse; the preview shows plain text only, never rendered HTML.
Rules you should expect
What to expect when you encode or decode: which characters change, how named and numeric references relate, and common pitfalls.
- Minimal scope escapes only & < > " ' — enough for typical HTML text nodes. Non-ASCII scope leaves ASCII as-is and turns symbols and emoji into entities. All combines both.
- Named (©), decimal (©), and hex (©) forms decode to the same character. When encoding with “Named when available”, common symbols use names; others fall back to numeric entities.
- Double encoding happens if you encode already-escaped text — & becomes &amp;. Use Decode → “Until stable” once if you suspect double escaping. Attribute values in real HTML may also need quotes escaped even when text nodes do not.
- Privacy: your paste is not uploaded. This tool uses zero external libraries — conversion stays entirely in the browser.
Example
Encode (minimal + named): Tom & Jerry <3 → Tom & Jerry <3. Encode (non-ASCII + hex): © 😀 → © 😀. Decode: <p>Tom & Jerry © 😀</p> → plain text `<p>Tom & Jerry © 😀</p>` in the preview.
Good fits
- Developers: decode `<div>…` strings from an API or log before diffing or editing.
- CMS / content: encode titles or snippets that contain & or < before inserting into an HTML template.
- Email / i18n: turn emoji or special symbols into numeric entities for older HTML clients.
Frequently asked questions
What is the difference between encoding scopes?
Minimal escapes only the five HTML-critical characters (& < > " '). Non-ASCII leaves plain ASCII alone and encodes everything above U+007F. All applies minimal rules plus non-ASCII — use it when you want both safety and Unicode coverage.
Are ©, ©, and © the same?
Yes when decoding — all three become ©. When encoding, pick Named for readable names where available, or Decimal/Hex if you need a specific numeric form for templates or email.
What if my text was encoded twice?
You may see &amp; instead of &. Decode once normally, or choose Decode → Until stable to repeat until the string stops changing (up to eight passes). Avoid encoding output that is already escaped.
Does this sanitize HTML or prevent XSS?
No. Encoding helps represent characters safely in HTML source, but it is not a sanitizer. The decode preview shows plain text only — we never render your input as live HTML in the page.
Does my text leave the browser?
No. Conversion runs locally with built-in browser APIs only — no CDN library fetch and no upload of your paste.
Questions or feedback
Something unclear, broken, or missing? Draft a message below — we read every note about these tools.