Switch between encoding and decoding HTML entities. Encoding makes text safe to drop into HTML by escaping the characters that would otherwise be read as markup; decoding turns entities like &, é or A back into real characters. It all happens in your browser.
How it works
Encoding always escapes the five characters that break markup or enable injection: & becomes &, < becomes <, > becomes >, the double quote becomes ", and the apostrophe becomes '. Everything else is left as readable text, so accented letters stay legible — unless you tick the non-ASCII option, which converts every character above code point 127 into a numeric reference like é.
Decoding recognises three forms: named references from a common set (&, ©, — and dozens more), decimal references such as é, and hex references such as A. Anything it doesn’t recognise — a misspelled name, or an ampersand with no semicolon — is left exactly as-is, so it never mangles text that only looks like an entity.
Practical examples
Showing code in a page
To display <a href="x"> as text rather than a link, encode it to <a href="x"> and paste that into your HTML — the browser now prints the tag instead of rendering it.
Cleaning up a scraped string
A copied snippet reads Tom & Jerry — best friends. Decode it and you get Tom & Jerry — best friends, ready for a plain-text field.
Forcing ASCII-safe output
With the non-ASCII option on, “Beograd — čaj” becomes Beograd — čaj, which survives systems that only accept 7-bit ASCII.
Frequently asked questions
Which characters get escaped when encoding?
The five that matter for safe HTML: &, <, >, the double quote and the apostrophe. These are the ones that can prematurely close a tag or attribute, so escaping them is what prevents broken markup and injection.
Why is the apostrophe encoded as ' and not '?
' isn’t defined in older HTML4 and can fail in some contexts, whereas the numeric ' works everywhere. Decoding still understands ' if you paste it in.
What does the non-ASCII option do?
It converts every character above code point 127 — accented letters, symbols, emoji — into a numeric entity like é. Use it when a target system only accepts plain ASCII. Leave it off to keep text readable.
Which named entities can it decode?
A practical set of the common ones: the markup basics plus things like ©, ®, ™, —, €, £, arrows and fractions. Any character can also be decoded via its decimal or hex reference, which covers everything else.
What happens to entities it doesn’t know?
They’re left untouched. A made-up name like ¬real; or a bare & with no semicolon stays exactly as typed, so decoding never corrupts text that merely resembles an entity.
Does it handle emoji and other astral characters?
Yes. Encoding iterates by code point, so an emoji becomes a single reference like 😀, and decoding that reference restores the emoji correctly rather than producing broken halves.
Is encoding the same as URL encoding?
No. HTML entity encoding makes text safe inside HTML documents; URL encoding (percent-encoding) makes text safe inside URLs. For links, use our URL encoder instead.
Is my text uploaded?
No. Encoding and decoding run entirely in your browser, so nothing you paste is sent anywhere.
Related tools
URL Encoder and Decoder
Percent-encode text for URLs or decode it back, with component and full-URL modes. Runs in your browser.
Developer tools
Base64 Encoder and Decoder
Encode text to Base64 or decode it back, UTF-8 safe and URL-safe tolerant. Runs entirely in your browser.
Developer tools
JSON Formatter
Beautify, validate or minify JSON in your browser — with clear error messages. Nothing is uploaded.
Developer tools
JWT Decoder
Decode a JWT to read its header and payload, with expiry and issued-at shown as dates. Local only — no signature verification.
Developer tools
JSON to CSV Converter
Convert a JSON array of objects into CSV, right in your browser. Choose the delimiter; nested values are kept as JSON.
Developer tools
CSV to JSON Converter
Convert CSV to JSON in your browser. Header-to-keys, custom delimiter and optional number/boolean parsing.
Developer tools