An HTML entity is a piece of text that starts with & and ends with ; and stands in for a character, for example © for © or € for €. You only strictly need them for characters HTML treats as markup (&, < and, in attributes, quotes) and for invisible characters you want to keep visible in your source.
The three kinds of character reference
HTML calls these “character references”, and there are three forms. All three below produce the same copyright sign ©:
| Type | Syntax | Example |
|---|---|---|
| Named | &name; |
© |
| Decimal numeric | &#DDD; |
© |
| Hexadecimal numeric | &#xHHHH; |
© |
Named entities are readable, but only characters that have been given a name in the HTML specification have one. The current HTML standard defines over two thousand names, including many math and arrow names, while the older HTML 4 list had about 250.
Numeric references work for every Unicode character, with or without a name. The number is the character’s Unicode code point. For hexadecimal, copy the digits after U+: U+20AC becomes €. For decimal, convert the hex number: 0x20AC is 8364, so €. The Unicode Converter does this for you and shows both forms side by side.
When you actually need entities
1. Characters that HTML reserves
These must be escaped when you want them to appear as text:
&→&. Always escape it in text and in attribute values, including URLs inhrefthat contain query strings like?a=1&b=2.<→<. Otherwise the browser thinks a tag is starting. This is how you show code such as<div>on a page.>→>. Not strictly required in normal text, but escaping it alongside<is standard practice."→"inside a double-quoted attribute value.'→'or'inside a single-quoted attribute value.'is valid in HTML5 and XML but was not defined in HTML 4, so'is the most compatible choice.
Escaping these characters is also a security measure. Any time user input is written into a page, converting & < > " ' to references prevents that input from being interpreted as HTML or script.
2. Invisible and ambiguous characters
Some characters look like nothing, or like something else, in your source code. Writing them as references makes your intent clear to the next person who edits the file:
for a non-breaking space that keeps “10 kg” on one line.­for a soft hyphen that marks where a long word may break.​for a zero width space, and‍or‌for the zero width joiner and non-joiner.−for the minus sign −, which is easy to confuse with a hyphen in source.
3. When you cannot rely on the file encoding
If a page, email template or CMS field might not be saved or served as UTF-8, a numeric reference survives because it is made entirely of ASCII characters. € becomes € no matter how the file is encoded.
When you do not need them
If your page is saved as UTF-8 and declares <meta charset="utf-8">, you can type or paste ©, €, é, → and emoji directly. That is easier to read and edit than a wall of entities. Modern practice is to escape only the reserved characters and the invisible ones.
HTML entity cheat sheet
These are the characters people reach for most often. Every named entity below is part of the HTML standard; the numeric forms work everywhere. Click through for copy buttons and keyboard shortcuts, or see the full HTML entity reference.
| Character | Name | Named entity | Decimal | Hex |
|---|---|---|---|---|
| & | Ampersand | & |
& |
& |
| < | Less-Than Sign | < |
< |
< |
| > | Greater-Than Sign | > |
> |
> |
| “ | Quotation Mark | " |
" |
" |
| ‘ | Apostrophe | ' |
' |
' |
| (space) | Non-Breaking Space | |
  |
  |
| © | Copyright Symbol | © |
© |
© |
| ® | Registered Trademark Symbol | ® |
® |
® |
| ™ | Trademark Symbol | ™ |
™ |
™ |
| — | Em Dash | — |
— |
— |
| – | En Dash | – |
– |
– |
| … | Ellipsis | … |
… |
… |
| ‘ | Left Single Quotation Mark | ‘ |
‘ |
‘ |
| ’ | Right Single Quotation Mark (Apostrophe) | ’ |
’ |
’ |
| “ | Left Double Quotation Mark | “ |
“ |
“ |
| ” | Right Double Quotation Mark | ” |
” |
” |
| • | Bullet Point | • |
• |
• |
| ° | Degree Symbol | ° |
° |
° |
| × | Multiplication Sign | × |
× |
× |
| ÷ | Division Sign | ÷ |
÷ |
÷ |
| ± | Plus-Minus Sign | ± |
± |
± |
| ≠ | Not Equal Sign | ≠ |
≠ |
≠ |
| ≤ | Less Than or Equal To | ≤ |
≤ |
≤ |
| ≥ | Greater Than or Equal To | ≥ |
≥ |
≥ |
| ∞ | Infinity Symbol | ∞ |
∞ |
∞ |
| € | Euro Sign | € |
€ |
€ |
| £ | Pound Sign | £ |
£ |
£ |
| ¥ | Yen Sign | ¥ |
¥ |
¥ |
| ¢ | Cent Sign | ¢ |
¢ |
¢ |
| → | Right Arrow | → |
→ |
→ |
| ← | Left Arrow | ← |
← |
← |
| ½ | One Half Fraction | ½ |
½ |
½ |
| § | Section Sign | § |
§ |
§ |
| ¶ | Paragraph Sign (Pilcrow) | ¶ |
¶ |
¶ |
| ✓ | Check Mark | ✓ |
✓ |
✓ |
| ♥ | Black Heart Suit | ♥ |
♥ |
♥ |
Rules that trip people up
- Names are case-sensitive.
Δis Δ andδis δ.©happens to work because the specification includes it as an alias, but most uppercase variants do not exist. - Always include the semicolon. Browsers tolerate a missing semicolon on a few legacy names such as
©, which means unescaped page text like?id=5©=2can display as ?id=5©=2. Always write the semicolon, and always escape a literal&as&. - Not every character has a name. The Indian rupee sign ₹, the interrobang ‽ and most emoji have none. Use a numeric reference such as
₹. - XML is stricter. XML, SVG and XHTML files only predefine
& < > " '. Use numeric references for everything else there. - Entities are HTML only. In CSS
contentuse a backslash escape like"2192", in JavaScript strings use"u2192", and in JSON use the literal character or auescape. - Emoji above U+FFFF need the full code point in a reference: 😀 is
😀, not two separate surrogate values.
Entities in WordPress and other editors
In the WordPress block editor you can usually paste the character itself; it will be stored as UTF-8. If you need an entity, for example a non-breaking space between a number and its unit, switch the block to “Edit as HTML” and type it there. Some visual editors convert entities to raw characters when you save, so check the output with your browser’s view-source if a specific entity matters.
To find out what an unknown character in your content actually is, paste it into the Unicode Lookup tool; it shows the code point, which gives you the numeric reference immediately.
Frequently asked questions
What is the difference between © and ©?
Nothing in the output. Both produce ©. The first is a decimal numeric reference, the second a named reference. Numeric references work for every character; named ones only exist for some.
Do I need for spacing?
Not for layout. Use CSS margins and padding for spacing. Use only when two words must not be split across lines, such as a number and its unit.
How do I write an HTML entity for any Unicode symbol?
Take the code point (for example U+2713 for ✓), and write ✓. You can look up any character’s code point on its SymbolHero page or in the Unicode Converter.
Are HTML entities the same as Unicode?
No. Unicode assigns the characters their numbers; HTML entities are just a way to write those characters in HTML source. Numeric references use the Unicode code point directly.