How to type symbols in HTML
HTML has three ways to write a symbol: a named entity such as ©, a decimal
numeric escape such as ©, and a hex numeric escape such as ©. Named
entities are readable but only around 2,100 of them exist and they cover a fraction of
Unicode. Decimal and hex escapes work for every code point, so they are the reliable
fallback whenever a named entity is missing. All three are parsed as text and render
as the character.
Named entities
A named entity starts with &, uses a word or abbreviation from the HTML standard,
and ends with ;.
<p>© 2026 AltKeyCodes</p>
<p>Temperature: 20°C</p>
<p>½ cup of flour</p>
Renders as:
© 2026 AltKeyCodes Temperature: 20°C ½ cup of flour
The HTML5 named entity list also includes a set of five characters that must be
escaped because they have a structural meaning: < for <, > for >,
& for &, " for ", and ' for '. Those five are the ones you
will use most often, and getting them wrong is the usual cause of a broken page.
Decimal escapes
A decimal escape writes the code point as a base-10 number between &# and ;.
<p>↑ ↓ ← →</p>
Renders as ↑ ↓ ← →
Decimal escapes work for every code point in Unicode with no exceptions and no
dependence on which named entities a browser knows.
Hex escapes
A hex escape is the same idea in base 16, with an x after the #.
<p>✓ ✗ ☑</p>
Renders as ✓ ✗ ☑
The hex form matches how Unicode code points are written everywhere else, so it is the
form to use when you are copying a code point out of a reference table. It is also
what you paste when you are not sure whether a named entity is safe.
Which one to use
| Situation | Use | Why |
|---|---|---|
| A common symbol with a well-known entity | Named entity | More readable in source, © is obvious at a glance |
| A symbol you looked up in a table | Hex escape | Copy the code point directly, no name lookup |
| A symbol with no named entity | Decimal or hex | The only options |
| Inside an HTML attribute | Any of the three | All work; escape " if the attribute uses double quotes |
Where entities do not work
Entities are an HTML and XML feature. They are not processed in:
- Plain text files, which show the literal characters
© - Markdown, unless the renderer passes raw HTML through
- JSON, which has its own
\uXXXXescape and no entity syntax - CSS
contentvalues, which use backslash escapes instead
For JSON, write the character directly as UTF-8 or use the \uXXXX form. For CSS, see
the escape rules in the symbol pages on this site, where a trailing space is required
after a hex escape when the next character is a hex digit.
FAQ
Does the semicolon matter?
Yes. Writing © without the semicolon is not valid, and browsers only recover
from it in text content, not inside attributes or inside other entities. Always close
the entity.
Can I use named entities that are not in the HTML5 list?
No. A name the standard does not define renders as the literal text you typed. If
this site's symbol table shows a dash for "Named entity", no name exists and you
should use the decimal or hex form.