HTML Entity Encode / Decode
Convert characters like < > & " to their HTML entities so they display literally instead of being parsed as markup — or decode entities (named, decimal, and hex) back to characters.
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
Options
Your result will appear here
Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.
How it works
What encoding is for
In HTML, characters like < > & and " are markup, not text. Escape mode rewrites them as entities — & < > " and ' — so a string is displayed exactly as written instead of being parsed as a tag or an attribute break. This is the same work as htmlspecialchars or an HTML-escape helper, and it is the plain, correct way to render user-provided text inside a page.
Two encoding levels
Minimal touches only the five characters that matter for markup safety: & < > " and the apostrophe. Minimal plus all non-ASCII additionally converts every character above code point 127 to a numeric reference such as —, which keeps the result pure ASCII for systems that mangle UTF-8 — handy for email templates and legacy pipelines, at the cost of larger, less readable output.
Decoding back to text
Decode mode walks the string and resolves named references from a set of about 250 common names (amp, copy, mdash, alpha, rarr and so on) plus any decimal &#NN; or hexadecimal &#xNN; reference. A reference outside the valid Unicode range, or an unknown name, is left exactly as it was rather than replaced with a question mark, so nothing is silently corrupted.
Caveats and privacy
Decoding covers the common named set, not every entity in the full HTML table, so rare names pass through unchanged; encoding is the direction you should rely on for safety. Escaping is a display concern, not a substitute for proper input handling elsewhere. Both directions run in the page with no request, so text pasted from a private page is never uploaded.
Questions
Does decoding cover every named entity?
It covers the common set (about 250 names) plus all decimal (&#NN;) and hex (&#xNN;) references. Rare names fall through unchanged.
Which characters does minimal encode?
Only the five that matter inside HTML: ampersand, less-than, greater-than, double quote and the apostrophe (as '). Everything else is left alone so the output stays readable.
When would I use "Minimal + all non-ASCII"?
When the result must survive a channel that mangles UTF-8 — an email template or an older pipeline. Every character above code point 127 becomes a numeric reference, so the whole string is plain ASCII.
Is my text sent anywhere?
No. Encoding and decoding both run in your browser with no request and no upload, so the page works offline.
Related tools
See categoryURL Encode / Decode
Percent-encode or decode text for use in URLs — component or whole-URL mode.
Unicode Code Point Explorer
Inspect every character code point, plane, and UTF-8/UTF-16 encodings in a table.
String Escaper
Escape or unescape text for JS, JSON, C, Java, Python, shell, SQL, CSV, HTML, XML, URL, backslash or Unicode.
HTML to Plain Text
Strip HTML tags to clean, readable plain text — entities decoded, block layout preserved.