Numeric HTML entities — text to é or é and back

Turn text into numeric character references such as é or é, one per character, or decode a string full of them. Works for every Unicode character, including emoji.

Live demo · real result from this tool
Direction
Format
Characters

Encoded

Café ✓ 😀 <tag>

Processed on your device — nothing is uploaded.

How to use the numeric HTML entities tool

  1. Set Direction to Encode or Decode.
  2. Paste your text into Input.
  3. When encoding, choose the Format: Decimal é or Hex é.
  4. Choose the Characters to convert: Every character, or Non-ASCII and & < > " ' to leave plain letters, digits and spaces readable.
  5. 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 &eacute; and &mdash;, 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)  →  &#233;&#128512;
Hi                       (hex, every)    →  &#x48;&#x69;
Café ✓ 😀 <tag>          (special only)  →  Caf&#233; &#10003; &#128512; &#60;tag&#62;
Caf&#233; &#x1F600;      (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. &#233 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?
A named entity uses a word, like &eacute;, and only exists for a fixed list of characters. A numeric reference uses the character's code point, like &#233;, and works for any Unicode character, including emoji that have no name.
Decimal or hex, which should I use?
Both work the same in HTML and XML. Decimal (&#8364;) is common in older documents; hex (&#x20AC;) matches the U+20AC notation in Unicode charts, so it is easier to look up. Pick whichever your team uses.
Why would I encode every character?
Mostly for testing parsers, or for systems that mangle anything non-ASCII. Encoding every character makes the text much longer and hard to read. For normal HTML, choose the Non-ASCII option under Characters so only the characters that need it are encoded.
Why does &amp; stay as it is when I decode?
This tool decodes numeric references only. Named ones such as &amp;, &lt; or &eacute; are left untouched. Use an HTML decoder if your text has both kinds.
Does an emoji need two references?
No. An HTML numeric reference uses the full code point, so 😀 is one reference, &#128512;. That is different from JavaScript, where the same emoji needs two \u escapes.

Sources

  1. HTML Standard — 13.1 Writing HTML documents (character references) — WHATWG, accessed 2026-10-08

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close