HTML Entity Encoder & Decoder
Turn HTML-reserved characters into safe references, and decode named or numeric references back to text. You choose exactly what gets encoded.
Use this tool in your browser without installing software.
About this tool
Inside an HTML page, three characters have a special meaning: &, < and >. Quotes can also change the structure of an attribute. HTML encoding replaces them with safe references: &, <, > and ". The non-ASCII mode also encodes Persian letters, emoji, and symbols such as ©, so the text survives any file or editor. The every-character mode encodes Latin letters and spaces too; it is meant for testing and samples, not everyday text. The reverse direction works as well: named references such as © and numeric references in decimal or hexadecimal, such as © and ©, turn back into the characters they stand for. Unknown or incomplete references stay untouched, and the tool tells you how many it found so a typo is easy to spot. Everything runs in your browser; the text is never sent anywhere.
How to use it
- 1
Paste the text or HTML references into the box.
- 2
Pick encode or decode; when encoding, choose the scope and whether to use named references.
- 3
Review the result and copy it.
If the file will not open
- After encoding, my tags show up as text.
That is the point of encoding: the text is displayed instead of being run as markup. If you want the tag to work, do not encode it.
- The output does not contain .
A named reference is produced only when that exact character is in the text. An ordinary space is not a non-breaking space; type the non-breaking space itself if that is what you need.
- My Persian text turned into numbers.
The non-ASCII or every-character mode is selected. Choose only HTML-reserved characters to keep the Persian text readable.
- One reference was left untouched.
Check the spelling and the closing semicolon. If the name is not in the standard list, use the numeric reference for that character instead; numeric references always decode.
Frequently asked questions
How is HTML encoding different from URL encoding?
HTML encoding is for text placed inside a page or an HTML attribute; it makes characters such as < and & harmless. URL encoding is for addresses and replaces spaces and reserved characters with percent escapes. Do not use one in place of the other.
Which characters should I encode?
At the very least &, <, > and the quotes. If your text contains Persian, emoji, or symbols such as © and —, choose the non-ASCII mode so it survives in any file or editor.
Are named references better than numeric ones?
Both are valid. A named reference such as © is easier to read, but not every character has a standard name. A numeric reference such as © works for every character and leaves less room for doubt. Turn off the named option to make everything numeric.
Why do some references stay encoded?
A reference is left untouched when it has no closing semicolon, when the name is not in the standard list, or when the number is not a valid character. It is counted as unknown on purpose, so you can compare the input with the output and find the typo.
Is my text stored or sent anywhere?
No. The conversion happens in your browser and no request carries the text. Closing the page clears it.