To encode or decode HTML entities, paste your text into the Input editor and select Convert. With Action on Auto detect, text that already contains entities is decoded and plain text is escaped. Choose Escape or Unescape to force a direction, then copy the result or download it as a .txt file.
How to use the HTML entity converter
- Paste your text. Put raw HTML or entity-encoded text in the Input editor. You can also drag text into the editor or select Mixed sample.
- Choose a direction. Leave Action on Auto detect, or pick Escape or Unescape. For escaping, set Escape Style and Quotes; for decoding, set Decode Depth.
- Convert. Select Convert or press Ctrl+Enter. The output appears on the right, and the Entity Analysis panel counts what the input contains.
- Use the result. Select Copy output or Download. Use output as input moves the result back so you can run it again.
What are HTML entities?
An HTML entity, or character reference, is a code that stands for a character. It starts with & and ends with ;, and comes in three forms. The copyright sign © can be written as the named entity ©, the decimal entity © or the hex entity ©. All three display the same symbol.
You need entities when a character would otherwise be read as markup. A < in text can start a tag and an & can start an entity, so writing 5 < 7 && 7 > 5 safely in HTML means escaping it to 5 < 7 && 7 > 5. On a page saved as UTF-8, other characters such as é, € or emoji can be typed directly and don't need entities.
HTML character entities list
The HTML standard defines more than two thousand named entities. These are the ones you'll meet most often. The decoder here understands all of them, because it uses the browser's own HTML parser.
| Character | Named | Decimal | Hex |
|---|---|---|---|
| & (ampersand) | & | & | & |
| < (less than) | < | < | < |
| > (greater than) | > | > | > |
| " (double quote) | " | " | " |
| ' (apostrophe) | ' | ' | ' |
| Non-breaking space | |   |   |
| © (copyright) | © | © | © |
| ® (registered) | ® | ® | ® |
| € (euro) | € | € | € |
| × (multiply) | × | × | × |
When escaping, the tool encodes the characters that matter for markup: &, <, > and, depending on the Quotes setting, " and '. It leaves letters like é and symbols like © as they are. Apostrophes are written as ' in every style.
How to escape HTML: named vs numeric entities
The Escape Style menu decides how the HTML entity encoder writes those characters:
- Named entities and Minimal safe HTML give
&,<,>and". These are the easiest to read. - Numeric decimal gives
&,<and so on. - Numeric hex gives
&,<and so on.
Numeric entities work in both HTML and XML. XML predefines only five named entities (amp, lt, gt, quot and apos), so a feed or SVG file containing fails to parse while   works.
Escape quotes when the text goes inside an attribute value. The default, Escape " only, covers attributes wrapped in double quotes. Choose Escape " and ' if your templates use single quotes. Escaping for HTML text and attributes doesn't make a value safe inside a <script> block, a URL or CSS, which each need their own encoding, as the OWASP Cross Site Scripting Prevention Cheat Sheet explains. For URLs, use the URL encoder and decoder.
How to decode HTML entities, including double-encoded text
Set Action to Unescape (or leave it on Auto detect) and select Convert. <p>Tom & Jerry</p> becomes <p>Tom & Jerry</p>.
Text that was escaped twice, often by a CMS or an API that encodes data that was already encoded, shows up as &lt;. Decode once turns that into <. Repeat until stable keeps decoding until the text stops changing, so you get < in one step.
Auto detect decodes whenever it finds a single entity, so for text that mixes real tags with a few entities, pick Escape or Unescape yourself. Select Analyze text first if you're unsure: it lists named, decimal and hex entity counts, angle brackets, ampersands and quotes, and suggests an action. To tidy the decoded markup, paste it into the HTML formatter.
Frequently asked questions
What is HTML escape?
HTML escaping replaces characters that have a meaning in markup, mainly &, <, > and quotes, with entities like & and <. The browser then shows them as text instead of treating them as code.
How do I unescape HTML?
Paste the encoded text, set Action to Unescape and select Convert. Choose Repeat until stable under Decode depth if the text was encoded more than once, for example &lt;.
Does the encoder convert accented letters and symbols to entities?
No. It encodes &, <, > and quotes only, and leaves characters like é, ñ or © unchanged. On a UTF-8 page these display correctly without entities.
What's the difference between &nbsp; and a normal space?
A non-breaking space doesn't let a line wrap at that point and isn't collapsed with neighbouring spaces. Use Space Handling to turn double spaces or all spaces into when you need to keep spacing.
Is &#39; the same as &apos;?
Yes, both are an apostrophe. ' is defined in HTML5 and XML but wasn't part of HTML 4, so ' is the more widely supported choice and is what this tool writes.
Is my text sent to a server?
No. Escaping and decoding run in your browser, and nothing you paste leaves your device.