HTML Entity Encoder and Decoder

Convert Unicode text to named, decimal or hexadecimal HTML character references, or decode references such as &, © and 😀 back to text.

Your text is processed in this browser and is not submitted to UnicodeNow.

Processed locally in your browser

Named mode uses named references where available and hexadecimal numeric references otherwise.

HTML escaping depends on where the value will be inserted.

Advanced options

HTML entity encoding does not require Unicode normalization. Enable this only when you intentionally want to change the Unicode representation.

Paste text or HTML character references. Input remains local to this browser.

What this HTML entity tool does

This tool converts Unicode text into HTML character references and decodes HTML references back into Unicode text. Encoding can produce minimal HTML escaping, named references such as ©, decimal references such as ©, hexadecimal references such as ©, or a structured comparison of all representations. Decoding accepts valid named, decimal and hexadecimal references and returns text, not executable markup. Processing is local in your browser.

The controls are designed for text values that will be inserted into HTML, not for validating complete documents. If you need to place a value into JavaScript, CSS or a URL, use the matching encoder for that context. HTML escaping protects syntax boundaries; it does not decide whether markup is trustworthy.

HTML entity examples

CharacterNamedDecimalHexadecimal
&&&&
<&lt;&#60;&#x3C;
>&gt;&#62;&#x3E;
"&quot;&#34;&#x22;
'&apos;&#39;&#x27;
é&eacute;&#233;&#xE9;
©&copy;&#169;&#xA9;
😀No common named entity&#128512;&#x1F600;

Named vs decimal vs hexadecimal entities

Named references are readable for common characters, but not every Unicode character has a named HTML reference. Decimal and hexadecimal references identify a Unicode code point numerically. Hexadecimal often aligns naturally with Unicode U+ notation: U+00E9 becomes &#xE9;. Numeric HTML references are not UTF-8 bytes.

Which HTML characters should be escaped?

In HTML text, ampersands can begin character references and less-than signs can begin markup. This tool also escapes greater-than signs in minimal mode for clarity. In attributes, the matching quote character must be escaped too: &quot; for double-quoted attributes and &apos; for single-quoted attributes. Ordinary accented letters, CJK text, Cyrillic text, Arabic text and emoji usually do not need entities in UTF-8 HTML.

HTML entities are not UTF-8

é
U+00E9
HTML: &#xE9;
UTF-8: C3 A9

The HTML parser resolves &#xE9; into the Unicode character é. UTF-8 later encodes that character as bytes C3 A9. Writing &#xC3;&#xA9; is not the correct reference for é; it references two separate code points.

Avoid double encoding

Double encoding happens when already-escaped text is escaped again: & becomes &amp;, then &amp;amp;. Store Unicode text where possible and escape at the output boundary for the actual HTML context. If the decoder returns literal text such as &eacute;, one layer has been decoded and another may remain by contract or by mistake.

How to use the tool

  1. Choose Encode or Decode.
  2. For encoding, choose the output format and HTML context.
  3. Leave normalization set to Do not normalize unless you intentionally need NFC, NFD, NFKC or NFKD.
  4. Paste input or load the mode-specific example.
  5. Review warnings and statistics.
  6. Copy or download the UTF-8 text output.

Privacy and processing

This tool runs in your browser. Your input is not submitted to UnicodeNow. The page uses local JavaScript for conversion, statistics and warnings, and the output textarea contains selectable text only.

Common uses

Frequently asked questions

What is an HTML entity?

An HTML entity, more precisely an HTML character reference, is source syntax that represents a character in HTML.

What is the difference between &eacute;, &#233; and &#xE9;?

They are named, decimal and hexadecimal references for U+00E9, LATIN SMALL LETTER E WITH ACUTE.

Should I convert every Unicode character to an HTML entity?

No. Literal UTF-8 text is normally preferable for ordinary content.

Which characters must be escaped in HTML?

Escaping is context-dependent, but ampersands and less-than signs require attention in text; quotes matter in matching attribute contexts.

Is &nbsp; the same as a normal space?

No. It represents U+00A0 NO-BREAK SPACE, which affects line breaking.

Why does &amp;eacute; display as &eacute;?

The ampersand was escaped, so after one HTML parsing layer the result is literal entity text.

Are HTML entities the same as UTF-8?

No. HTML entities are markup syntax for characters. UTF-8 is a byte encoding.

Can this tool decode named and numeric references?

Yes. It decodes valid named, decimal and hexadecimal HTML character references.

Does decoding HTML entities make the result safe HTML?

No. Decoding returns text. It must still be escaped or sanitized for its destination.

Is my input uploaded?

No. This tool runs in your browser and does not submit input to UnicodeNow.

Related tools

PHP Escape and Unescape

Escape and unescape PHP-style single and double quoted strings.

DeveloperProcessed locally

Unicode Escape Converter

Convert text to and from Unicode escape sequences and numeric entities.

DeveloperProcessed locally

XML Escape and Unescape

Escape and decode XML entities and numeric character references.

DeveloperProcessed locally

Unicode Character Inspector

Inspect each Unicode character, encoding, category, script and normalization form.

UnicodeProcessed locally

URL Encoder and Decoder

Encode and decode URL components, full URLs and form-style strings.

EncodingProcessed locally

Related guides

Unicode vs UTF-8

Unicode defines characters and code points. UTF-8 encodes those code points as bytes for files, databases, web pages, APIs and network messages.

Unicode Normalization Explained

Learn NFC, NFD, NFKC and NFKD, canonical and compatibility equivalence, and safe normalization for comparison, search and identifiers.