HTML Entity Encoder / Decoder
Encode text to HTML entities or decode entities back to plain text, with named, decimal or hex output.
How it works
Type or paste on the left and the conversion happens as you type โ there is no button to
press. In Encode mode every character that a browser would otherwise treat
as markup is replaced by its HTML entity: & becomes
&, < becomes <,
> becomes >, and quotes become
" and ' so the text is safe inside both an
element and an attribute. By default accented letters, dashes, currency symbols and other
non-ASCII characters are encoded too, so the output survives any file encoding; switch to
"Only HTML-unsafe" if your page is already UTF-8 and you want to keep รฉ and
โ readable. The entity style selector chooses between named entities
(é), decimal (é) and hexadecimal
(é) references โ all three are equivalent to a browser.
In Decode mode the tool reverses the process: named entities are looked up
in a built-in table of the standard HTML names, and numeric references in both decimal
(—) and hex (😀) form are converted back to
characters, including emoji and other astral code points. Anything that only looks like an
entity โ a stray &foo;, or a numeric reference outside the valid Unicode
range โ is left exactly as it was and reported below the boxes, so nothing is silently
mangled. Everything runs in JavaScript on your own device: no request is made, so it is safe
to paste templates, e-mail HTML or anything else confidential.
Frequently asked questions
How do I encode special characters in HTML?
Paste your text on the left with Encode selected. Every character a browser could mistake for markup is replaced by its entity: & becomes &, < becomes <, > becomes >, and quotes become " and ' so the text is safe inside elements and attributes alike. By default accented letters, dashes and other non-ASCII characters are encoded too; choose "Only HTML-unsafe" if your page is already UTF-8 and you want to keep them readable.
What does mean in HTML?
is the entity for a non-breaking space (code point 160). It looks like a normal space but browsers never wrap a line at it and never collapse several of them into one, which is why it turns up in content pasted from word processors. Switch this tool to Decode and it turns back into a real character, so you can see exactly which spaces in your markup are non-breaking.
Should I use named or numeric HTML entities?
Browsers treat é, é and é as identical, so it is a readability choice. Named entities are the easiest for humans to read but exist only for a fixed list of characters; decimal and hexadecimal references work for any Unicode code point, including emoji, and are the safer pick for XML or for characters with no name. This tool switches style with one dropdown and always falls back to a numeric reference when no name exists.