↑↓ to move ↵ to open Esc to close Browse all tools

HTML Entity Converter

Escape special characters as HTML entities or unescape entities back to plain text, with named, decimal or hex references and a table to look up and copy any entity.

HTML entities

Characters to encode
Reference style

Encoded
 

Entity lookup

123 common entities

Click a cell to copy it. The search also covers all 2,231 names of the WHATWG list.

CharNamedDecimalHexMeaning
Ampersand
Less-than sign
Greater-than sign
Double quotation mark
Apostrophe, single quote
Non-breaking space
En space
Em space
Thin space
Soft hyphen
Zero-width non-joiner
Zero-width joiner
Left-to-right mark
Right-to-left mark
En dash
Em dash
Ellipsis
Left single quote
Right single quote, typographic apostrophe
Left double quote
Right double quote
Low single quote
Low double quote
Left angle quote, guillemet
Right angle quote, guillemet
Single left angle quote
Single right angle quote
Bullet
Middle dot
Dagger
Double dagger
Section sign
Paragraph sign, pilcrow
Inverted exclamation mark
Inverted question mark
Prime, minutes, feet
Double prime, seconds, inches
Cent sign
Pound sign
Yen sign
Euro sign
Currency sign
Copyright sign
Registered sign
Trademark sign
Degree sign
Plus-minus sign
Multiplication sign
Division sign
Micro sign
One quarter
One half
Three quarters
Superscript one
Superscript two, squared
Superscript three, cubed
Per mille sign
Not sign
Check mark
Ballot X
Black star
White star
Heart suit
Spade suit
Club suit
Diamond suit
Minus sign
Not equal to
Less than or equal to
Greater than or equal to
Almost equal to
Identical to
Infinity
Sum
Product
Square root
Partial differential
Integral
Element of
For all
There exists
Empty set
Nabla
Left arrow
Up arrow
Right arrow
Down arrow
Left right arrow
Double left arrow
Double right arrow, implies
Double left right arrow
Down arrow with corner left, return
Greek small alpha
Greek small beta
Greek small gamma
Greek small delta
Greek capital delta
Greek small theta
Greek small lambda
Greek small mu
Greek small pi
Greek small sigma
Greek capital sigma
Greek small omega
Greek capital omega
e with acute
e with grave
e with circumflex
a with acute
a with grave
a with diaeresis, umlaut
o with diaeresis, umlaut
u with diaeresis, umlaut
A with diaeresis, umlaut
O with diaeresis, umlaut
U with diaeresis, umlaut
Sharp s, eszett
n with tilde
c with cedilla
o with stroke
a with ring above
Ligature ae
Ligature oe

Your text is encoded and decoded by your own browser. Nothing is sent to a server.

What HTML entities are

An HTML entity, or character reference in the words of the HTML Standard, writes a character as plain ASCII text that starts with an ampersand. There are three kinds, and browsers decode all of them to the same character:

  • Named references like © for ©. The name must match exactly, including upper and lower case, so É is É and é is é.
  • Decimal numeric references like ©, the code point of the character in base ten.
  • Hexadecimal numeric references like ©, the same number in base sixteen, with an x or X after the #.

The names come from the named character references table of the HTML Standard. It holds 2,231 entries: 2,125 names with a semicolon, plus 106 of them that are also accepted without one for compatibility with old pages. This HTML entity converter uses that list, read from the official entities.json file. Numeric references work for every character, also the many that have no name.

Which special characters you have to escape

The HTML syntax rules are narrower than many people think. In normal text the standard forbids two things: a literal <, and an ambiguous ampersand, which is an & followed by letters or digits and a semicolon that do not form a known name. In an attribute value written in double quotes, a literal " is not allowed, and in single quotes no literal '. A > never has to be escaped.

CharacterNamedDecimalHexMust be escaped
&&amp;&#38;&#x26;When letters, digits or # follow it
<&lt;&#60;&#x3C;In text
>&gt;&#62;&#x3E;Never, but escaping it is harmless
"&quot;&#34;&#x22;In attribute values in double quotes
'&apos;&#39;&#x27;In attribute values in single quotes

Escaping all five special characters, & < > " ', is still the simple rule that is safe everywhere, whether the text lands between tags or in an attribute. That is what the default setting does, and you never have to think about which quotes an attribute uses or whether an ampersand happens to be followed by a word. It is also the escaping to use when you show code samples on a web page, so the browser displays <div> instead of creating an element. Note that escaping protects text in HTML only; inside a script element or a URL other rules apply.

The option Also all non-ASCII writes every character above U+007F as a reference too, so the result is pure ASCII. You seldom need that today: the HTML Standard requires documents to be encoded in UTF-8, which holds every character directly. It helps when the text has to pass through a system that only handles ASCII.

How browsers decode entities, and how this tool does

The decoder follows the character reference states of the HTML tokenizer step by step, so the result matches what a browser shows, including the odd cases:

  • Longest match. The parser takes the longest name it can find. That is why &notit; becomes ¬it; while &notin; becomes ∉, the example the standard itself gives.
  • No semicolon. The 106 legacy names also work without the semicolon, so &copy 2026 shows © 2026. Other names, and every name inside an attribute value that is followed by = or a letter or digit, stay as they are. Switch on Read as an attribute value to get that behavior for an href or a title.
  • Numbers 128 to 159. These are control codes in Unicode, but the parser maps 27 of them to the characters they have in the Windows-1252 character set, so &#128; becomes € and &#153; becomes ™.
  • Impossible numbers. &#0;, numbers above 10FFFF in hex and surrogate code points become the replacement character �.

Every case that the standard calls a parse error, such as a missing semicolon or an unknown name like &foo;, is listed in a note with its position, so you can clean up your markup. If the decoded text still contains references, for example after &amp;lt;, the tool spots the double encoding and offers to decode once more.

The decoder was checked against the browser's own HTML parser and against the open source entities package for Node.js, on tens of thousands of generated strings, with no difference. For other kinds of escaping, the URL encoder and decoder handles percent encoding and the Base64 encoder turns text or files into Base64.

How to use the HTML entity converter

  1. 1Choose Encode to escape text for HTML, or Decode to unescape entities back into plain text.
  2. 2Paste your text. The result updates as you type.
  3. 3When encoding, pick which characters to encode and whether to write named, decimal or hex references.
  4. 4Copy the result, or press Use as input to run it the other way and check the round trip. Look up any single character in the entity table below the tool.

Frequently asked questions

Is my text sent to a server?

No. Encoding, decoding and the lookup run in your browser, and the list of entity names is part of the page. Copy link only shares the mode and options, never your text.

Do I need entities for accents, symbols and emoji?

Usually not. The HTML Standard requires documents to be encoded in UTF-8, which can hold every character directly, so é, € and emoji can stay as they are. Entities are still handy for invisible characters such as &nbsp;, for characters that are hard to type, and for systems that only pass ASCII text.

Should I use named or numeric references?

Named references like &copy; are easier to read. Numeric ones like &#169; or &#xA9; work for every character, including the many that have no name. Browsers decode all three forms the same way.

Why does &copy turn into © even without a semicolon?

For compatibility with old pages, the HTML parser accepts 106 names without the semicolon, such as &amp, &lt, &copy and &eacute. It is still a parse error. Inside an attribute value, a name without a semicolon that is followed by = or a letter or digit is left alone, so a URL like ?a=1&copy=2 in an href keeps working.

Is &apos; valid in HTML?

Yes. &apos; is in the WHATWG list of named character references, so every browser that follows the HTML Standard decodes it to an apostrophe. &#39; is the numeric alternative.

What does &amp;lt; mean?

It is double encoding: the & of &lt; was encoded again as &amp;. Decoded once, it shows &lt; instead of <. The decoder notices when its result still contains references and offers to decode it again.