HTML entity encoder and decoder
Escape < > & " ' and other characters as HTML character references (named, decimal or hex) and decode references back to text. All 2,231 HTML5 named references are supported.
Characters without a name (emoji and others) become decimal references.
The result is shown as plain text, never rendered as HTML.
Common character references
| Character | Named | Decimal | Hex |
|---|---|---|---|
| HTML special characters | |||
| & | & | & | & |
| < | < | < | < |
| > | > | > | > |
| " | " | " | " |
| ' | ' | ' | ' |
| Spaces | |||
| No-break space | |   |   |
| En space |   |   |   |
| Em space |   |   |   |
| Thin space |   |   |   |
| Zero-width space | ​ | ​ | ​ |
| Punctuation and quotes | |||
| – | – | – | – |
| — | — | — | — |
| ‘ | ‘ | ‘ | ‘ |
| ’ | ’ | ’ | ’ |
| “ | “ | “ | “ |
| ” | ” | ” | ” |
| … | … | … | … |
| « | « | « | « |
| » | » | » | » |
| · | · | · | · |
| • | • | • | • |
| Symbols | |||
| © | © | © | © |
| ® | ® | ® | ® |
| ™ | ™ | ™ | ™ |
| § | § | § | § |
| ¶ | ¶ | ¶ | ¶ |
| ° | ° | ° | ° |
| † | † | † | † |
| ✓ | ✓ | ✓ | ✓ |
| Currency | |||
| € | € | € | € |
| £ | £ | £ | £ |
| ¥ | ¥ | ¥ | ¥ |
| ¢ | ¢ | ¢ | ¢ |
| ¤ | ¤ | ¤ | ¤ |
| Arrows | |||
| ← | ← | ← | ← |
| ↑ | ↑ | ↑ | ↑ |
| → | → | → | → |
| ↓ | ↓ | ↓ | ↓ |
| ↔ | ↔ | ↔ | ↔ |
| ⇒ | ⇒ | ⇒ | ⇒ |
| Math | |||
| × | × | × | × |
| ÷ | ÷ | ÷ | ÷ |
| ± | ± | ± | ± |
| ≠ | ≠ | ≠ | ≠ |
| ≤ | ≤ | ≤ | ≤ |
| ≥ | ≥ | ≥ | ≥ |
| ∞ | ∞ | ∞ | ∞ |
| ≈ | ≈ | ≈ | ≈ |
How to use
- Choose "Encode" or "Decode".
- For encoding, pick the format (named, decimal or hex) and which characters to encode: only the HTML special characters, or those plus every non-ASCII character.
- Enter your text and press "Encode" or "Decode". Decoding reads named, decimal and hex references even when they are mixed.
- Copy the result. "Use result as input" lets you convert the other way. The table at the bottom lists common references.
Notes and limits
- Input up to 2 MB.
- In named format, characters that have no name (emoji and others) are written as decimal references.
- Unknown names (such as &foo;) and numeric references to 0, surrogates or values above U+10FFFF are left unchanged, and the tool tells you how many there were.
- Decoding follows how browsers read references in page text. Inside attribute values, browsers treat some references without a semicolon differently.
- The result is always shown as plain text, never rendered as HTML. This tool does not strip tags or sanitize HTML.
How it works
The list of named references is generated from entities.json published with the WHATWG HTML Living Standard (2,231 entries).
Decoding never hands your input to the browser's HTML parser; a small parser reads each reference. A few legacy names such as & and © are recognized without the semicolon, and numeric references like A may omit it too.
Numeric references 128 to 159 are read as Windows-1252 characters, as browsers do (for example – becomes an en dash).
Characters above U+FFFF, such as emoji, are encoded as one code point (😀), never as two surrogate halves.
FAQ
Which characters do I need to escape?
For text inside HTML content or attribute values, the five characters & < > " ' are enough. Choose "every non-ASCII character" when the target system only handles ASCII.
Named, decimal or hex: which should I use?
Browsers show the same character for all three. Named references (©) are easier to read, numeric ones (© or ©) work for every character.
What does decode to?
A no-break space (U+00A0). It looks like a normal space but is a different character.
Is my input sent anywhere?
No. Everything runs in your browser, and nothing you enter is stored or sent.
Related tools
Last updated: