How to use the numeric HTML entities tool
- Set Direction to Encode or Decode.
- Paste your text into Input.
- When encoding, choose the Format: Decimal
éor Hexé. - Choose the Characters to convert: Every character, or Non-ASCII and
& < > " 'to leave plain letters, digits and spaces readable. - Copy the Encoded or Decoded result.
What it does and when to use it
A numeric character reference writes one character as &# plus its code point and a semicolon. Browsers and XML parsers turn it back into the character. This is useful when:
- A CMS, email template or legacy system breaks accented letters or emoji, but passes plain ASCII safely.
- You need a symbol in HTML that has no named entity, such as ✓ or a rare script character.
- You are writing test cases for an HTML or XML parser.
- You want to see which code points a piece of text really contains.
Decoding helps you read text from feeds, exports or databases that were saved with references. For named entities like é and —, use the HTML encoder and HTML decoder. For XML-only escaping, see the XML encoder, and for a reference list of entities, the HTML entities reference.
How it works
Encoding goes through the text one code point at a time, so an emoji counts as one character. Each selected character is written as &# + decimal code + ; or &#x + upper-case hex code + ;. With the special-characters option, ASCII letters, digits, spaces and punctuation stay as they are, except &, <, >, " and ', which are always converted.
Decoding finds every &#NNN; and &#xHHH; reference and replaces it with its character. References above U+10FFFF or in the surrogate range U+D800–U+DFFF are invalid, so they are left as written. It all runs in your browser.
Worked examples
é😀 (special only) → é😀
Hi (hex, every) → Hi
Café ✓ 😀 <tag> (special only) → Café ✓ 😀 <tag>
Café 😀 (Decode) → Café 😀
The third line shows the usual setting for web pages: the markup characters < and > and the non-ASCII characters are converted, the rest stays readable. With Every character, the same input becomes 15 references, even for the spaces.
Limits and tips
- Numeric references are not a security filter. To show user text safely in HTML, escaping
&,<,>and quotes is what matters. - References must end with a semicolon to be decoded here.
éwithout the semicolon is left as written. - Line breaks are converted too when you choose Every character, which can make the output one long line.
Frequently asked questions
What is the difference between a numeric and a named entity?
Decimal or hex, which should I use?
Why would I encode every character?
Why does & stay as it is when I decode?
Does an emoji need two references?
Sources
- HTML Standard — 13.1 Writing HTML documents (character references) — WHATWG, accessed 2026-10-08
How do we know nothing is uploaded? Test it yourself on the privacy proof page.