HTML Entity Encoder and Decoder
Escape text into HTML entities, or turn entities back into plain text. Named, decimal or hexadecimal, all in your browser and nothing sent anywhere.
What this tool does
Paste text and get it escaped into HTML character references, or paste references and get your text back. Encoding can stay minimal, touching only the five characters that actually break markup, or cover every character above plain ASCII for the older pipelines that still cannot be trusted with a charset. You choose how each reference is written too: a readable name like —, a decimal number, or hexadecimal. Emoji and other characters outside the basic range are handled by code point, so they come out as one clean reference instead of two broken halves. Decoding is deliberately careful: anything it does not recognise is handed back to you exactly as it arrived, never quietly replaced. Everything runs in your browser, with no library to download and nothing leaving your device.
What you can use it for
- Escape a block of copy before dropping it into an HTML template or an email.
- Read a page source or an API response that came back full of & and ’.
- Make text safe for an HTML attribute so a stray quote cannot break the tag.
- Prepare content for a legacy system that only accepts plain ASCII.
- Check what a character actually is by seeing its numeric code point.
How to use it
- Pick Encode to escape text, or Decode to turn references back into text.
- Paste or type into the box and watch the result update as you go.
- When encoding, choose whether to escape only the markup characters or everything above ASCII.
- Choose named, decimal or hexadecimal for how each reference is written.
- Copy the result with the copy button.
Everything runs inside your browser. No file is uploaded to any server. See more tools in this field.
Related tools
DeveloperURL Encoder / Decoder and Query String Editor
Encode or decode URLs the right way, with an explicit choice between component and full-URI escaping, and edit any query string as a table of key/value pairs. Everything runs in your browser, nothing is uploaded.
Base64 Encoder and Decoder
Encode and decode Base64 text online, with an optional URL-safe alphabet. Runs in your browser, nothing is uploaded to a server.
JSON Formatter and Validator
Format, validate and minify JSON online. Beautify messy JSON or compact it in one click, free and entirely in your browser, no upload.
Regex Tester and Debugger
Test and debug regular expressions online in real time, with capture groups and live match highlighting. Free and in your browser, no upload.
Frequently asked questions
What is the difference between this and a URL encoder?
They solve different problems. HTML entities protect text that lives inside a page, so an ampersand or an angle bracket is read as content and not as markup. Percent-encoding protects text that lives inside a URL, so a slash or a question mark is read as data and not as part of the address. Using one where the other belongs is a common source of bugs, which is why they are separate tools here.
Which characters does the minimal option escape?
Five of them: the ampersand, the less-than and greater-than signs, the double quote and the single quote. Those are the characters that can end an attribute or open a tag, so escaping them is what actually prevents broken markup. Everything else, accents and emoji included, is left readable because UTF-8 handles it perfectly well.
Does it handle emoji and other characters outside the basic range?
Yes. Text is walked by code point rather than by the underlying 16-bit units, so a character like an emoji becomes a single reference such as 😀 instead of two meaningless halves. That is the classic bug in hand-rolled encoders, and round-tripping it here gives you your emoji back unchanged.
What happens to an entity name it does not know?
It is left exactly as it appeared. The named table here covers the markup characters, the whole Latin-1 block, common punctuation and symbols, arrows, maths operators and the Greek alphabet, which is what real content uses. Anything outside that is returned untouched rather than being turned into a replacement character, so decoding never damages your text. Numeric references work for every character in Unicode regardless.
Is my text uploaded anywhere?
No. The whole conversion is plain string handling that runs inside your browser tab. Nothing is sent to a server, so you can safely paste content you would not want to hand to a website.

