Code badge · turn the dial · read the message
HTML Entity Encoder/Decoder
Type a message and every special character is written in code: &, <, © and the rest. The dial turns to the last character you typed and shows its entity. Paste code to read it back.
Message
In code
The code book
Every named entity this page knows. Click one to turn the dial to it; the buttons under the badge copy it.
What an HTML entity is
Some characters mean something to a browser. An ampersand starts an entity, an angle bracket starts a tag, quotes end an attribute. To show them as plain text you write them in code: & for &, < for <, > for >, " for a double quote and ' for a single one. Those five are the ones that matter for safety; encoding them is what stops pasted text from being read as markup or script.
Every other character has a code too. Named entities like © and € are easy to read; numeric ones, © or ©, work for any character at all, including ones without a name. Modern pages are UTF-8 and can hold the characters directly, so beyond the unsafe five, entities are mostly for older systems, email templates and places where the encoding is out of your hands.
Why a decoder ring
Radio shows of the 1940s sent listeners badges with a rotating dial: turn the ring, match a letter to a number, read the secret message. That is exactly what an entity is, a character written as a different sequence of characters, and turning it back is decoding. The dial above carries the two dozen characters people look up most.
Should I encode everything or only the unsafe five?
Only the five (&, <, >, " and ') when you are escaping text for HTML. Everything, when you need a file that is pure ASCII or you are not sure the page declares UTF-8.
What is the difference between © and ©?
Nothing in effect. The first is the character's number in decimal, the second in hexadecimal. Both are numeric character references and every browser reads both.
Does decoding handle every named entity?
Yes. Reading the message uses the browser's own HTML parser, which knows all 2,000-odd names, so ♥, → and the rarely seen ones all come back as characters. Tags in the text are kept as text.
Is anything uploaded?
No. Everything runs in your browser; nothing you type leaves the page.