HTML Entity Encoder
Escape &, <, >, quotes, and non-ASCII characters as HTML entities, or decode named and numeric entities back to text.
Processed locally in your browser — nothing is uploaded.
HTML Entity Encoder
0 characters
Encoded HTML
Output appears here…About HTML Entity Encoder
Encoding turns the five characters that break markup — & < > " ' — into safe entities, so user-supplied text can sit inside a page or an attribute without changing its structure. Turning on non-ASCII encoding also converts accents, emoji, and symbols to numeric references for environments stuck on ASCII.
Decoding goes the other way and understands named entities (&, , —, € and many more) alongside decimal (é) and hexadecimal (🎉) references. Anything it does not recognise is left exactly as it was, so nothing is silently mangled.
Common uses
- Escape a code snippet so it displays as text instead of rendering
- Read a scraped page or email where entities were double-encoded
- Convert accented characters to numeric entities for a legacy template
Example
Input
Fish & Chips © 2024 — café
Output
Fish & Chips © 2024 — café
Limitations
- Decoding covers a broad table of common entities, not every one of the ~2,200 names in the HTML spec
Frequently asked questions
Which characters do I actually need to escape in HTML?
Five: & < > " and '. They become &, <, >, ", and ' — the apostrophe uses a numeric reference because the named ' entity is not valid in HTML 4. Everything else is safe to leave as-is in a UTF-8 page.
Is the text I encode or decode uploaded anywhere?
No. Conversion runs as you type, entirely in your browser — nothing is transmitted or logged, so snippets from private emails, internal pages, or user data never leave your machine.
What's the difference between named and numeric HTML entities?
A named entity uses a mnemonic like © or —, while a numeric reference gives the character's Unicode code point in decimal (é) or hexadecimal (é). Browsers treat them identically; numeric references work for any character, names exist only for a fixed list.
Why does my text show &amp; instead of an ampersand?
It was encoded twice: & became &, then that ampersand was escaped again into &amp;. Run it through decode, and if entities still remain, decode the output once more — the swap button makes the second pass easy.
Can I convert emoji and accented characters to HTML entities?
Yes. Turn on the non-ASCII option in encode mode and every character above U+007F — accents, emoji, currency symbols — becomes a decimal numeric reference like é, which is useful for templates or systems that only handle ASCII reliably.