HTML Entity Encoder / Decoder
Encode HTML special characters (& < > " ') or decode entities back to their original characters.
<div class="hello">Tom & Jerry — "café" © 2026</div>
How to use
- Pick Encode or Decode.
- For encoding, choose minimal vs all non-ASCII, and named / decimal / hex.
- Paste your text — the result updates as you type.
- Swap reuses the output as the next input.
About this tool
ShowHide
Convert text to HTML entities and back, choosing named forms, decimal numeric references or hexadecimal ones. The scope matters as much as the format. Minimal escapes only the characters that can actually change how markup is parsed — the ampersand, the angle brackets and the quotes — which is what you want when putting user text into a page, and it keeps the file small and readable. Escaping everything non-ASCII is for legacy pipelines and email templates that cannot be trusted with UTF-8. One rule for picking the format: XML defines only five named entities, so anything else named will break in XML, SVG or an RSS feed — use numeric references there and stay safe everywhere. Decoding accepts all three forms at once.
Frequently asked questions
When should I use 'minimal' vs 'all non-ASCII'?
Minimal is right for almost every HTML context — UTF-8 pages render é, 한, 中 etc. directly, so only the five characters that confuse the HTML parser need to be escaped. Use 'all non-ASCII' when the destination must stay in pure ASCII (e.g., legacy email templates).
Named vs numeric entities — which is best?
Named entities (©) are easier to read, decimal (©) and hex (©) work for any code point even if no name exists. All three decode the same.
Does decoding handle &#xNN; and &#NN;?
Yes. The decoder accepts named, decimal, and hex forms in a single pass.
Are emoji and supplementary characters supported?
Yes — encoding uses code points, so characters outside the BMP (😀, 𝕏, etc.) encode and decode correctly.
Is it safe to run text through the encoder twice?
No — encoding is not idempotent, because the ampersand it produces is itself in scope. 'a & b' becomes 'a & b' on the first pass and 'a &amp; b' on the second, which renders as the literal text & on the page. Decoding is the opposite: it is stable, so running it again on already-plain text changes nothing. If you are unsure whether a string was already encoded, decode it first and then encode once.
Which named entities does the decoder know?
All of them. Decoding goes through the browser's own HTML parser, which knows every named reference HTML5 defines (over two thousand), so ≂̸ decodes just like …. The encoder is narrower: it writes names for about thirty common characters — the five markup characters plus currency, punctuation and typographic marks like …, — and ’ — and a numeric reference for anything else. Numeric forms always decode too: ≠ and ≠ both work. For encoding, prefer ' over ' for an apostrophe — ' is valid in XML and HTML5 but was never part of HTML 4, so the numeric form is the one that works everywhere.
Guides on this topic
Related tools
String Escape Converter
Escape a string for 10 contexts at once — JavaScript, JSON, HTML entities, URL, SQL, regex, Bash (single/double quote), C string, Unicode \u escapes.
Developer
URL Encoder / Decoder
Percent-encode text for URLs, or decode encoded URLs back to text.
Developer
CSS Named Colors
All 147 CSS / X11 named colors with HEX, RGB, and a live swatch — searchable and grouped by hue.
Color & CSS
Java .properties Parser
Parse a .properties file exactly as java.util.Properties.load does — separators, escapes, continuations — and see every line that will surprise you.
Developer
Unicode Escape Converter
Encode text to \uXXXX, U+XXXX or HTML entities — and decode any of those back to text. Handles emoji and astral characters.
Developer
ASCII Code Table
Browse and search the 256-row ASCII / extended-ASCII table — decimal, hex, octal, binary, and the named control characters.
Developer