HTML Entities
An HTML entity is a way of writing a character using only ASCII, either by name (©) or by code point (©). Only five are strictly required — the reserved characters that would otherwise be read as markup. The rest exist for convenience, and on a UTF-8 page you can usually type the character directly instead.
Entities solved a problem that has largely gone away. When pages were served in ASCII or Latin-1, an entity was the only way to write a curly quote or an em dash. On a modern UTF-8 page you can type those characters directly, and the file will be smaller and easier to read for it.
What has not gone away is the need to escape the reserved characters. A stray < or & is not a display bug — it is a parsing bug, and in the wrong place it is an injection vulnerability. Those five entities are the ones that matter; everything below them is convenience.
Reserved characters
5 entriesThe only entities you genuinely need. These characters have meaning in markup, so writing them literally changes how the document parses.
| Character | Named | Numeric | Escape it when |
|---|---|---|---|
| & | & | & | Always. An unescaped ampersand starts an entity, so © in text may render as ©. |
| < | < | < | Always in text content. An unescaped less-than sign starts a tag. |
| > | > | > | In text content. Less critical than < but conventional, and required inside some contexts. |
| " | " | " | Inside a double-quoted attribute value, where it would end the attribute. |
| ' | ' | ' | Inside a single-quoted attribute value. Use ' for older HTML, where ' was not defined. |
Spaces and typography
22 entriesPunctuation a word processor substitutes automatically, and the space variants that behave differently from a plain space.
| Character | Named | Numeric | Notes |
|---|---|---|---|
| (space) | |   | Non-breaking space. Prevents a line break and stops whitespace collapsing. Overuse for layout is a common mistake. |
| (space) |   |   | En space — the width of an en dash. |
| (space) |   |   | Em space — the width of an em dash. |
| (none) | ­ | ­ | Soft hyphen. Invisible until the word wraps at that point. |
| (none) | ‌ | ‌ | Zero-width non-joiner. Invisible, and a frequent cause of strings that look equal but are not. |
| – | – | – | En dash. Ranges: 2020–2024. |
| — | — | — | Em dash. Parenthetical breaks in a sentence. |
| … | … | … | Horizontal ellipsis — one character, not three full stops. |
| ‘ | ‘ | ‘ | Left single quote, also used as an apostrophe in typeset text. |
| ’ | ’ | ’ | Right single quote. The correct apostrophe character. |
| “ | “ | “ | Left double quote. |
| ” | ” | ” | Right double quote. |
| « | « | « | Left guillemet, used as a quotation mark in French and other languages. |
| » | » | » | Right guillemet. |
| • | • | • | Bullet. |
| · | · | · | Middle dot, often used as a separator in navigation. |
| † | † | † | Dagger — footnote marker. |
| ‡ | ‡ | ‡ | Double dagger. |
| ¶ | ¶ | ¶ | Pilcrow — paragraph mark. |
| § | § | § | Section sign. |
| ′ | ′ | ′ | Prime — minutes, feet. Not an apostrophe. |
| ″ | ″ | ″ | Double prime — seconds, inches. |
Currency and legal
10 entriesSymbols that appear constantly in commercial copy.
| Character | Named | Numeric | Notes |
|---|---|---|---|
| £ | £ | £ | Pound sterling. |
| € | € | € | Euro. |
| ¥ | ¥ | ¥ | Yen or yuan. |
| ¢ | ¢ | ¢ | Cent. |
| ¤ | ¤ | ¤ | Generic currency sign. |
| © | © | © | Copyright. |
| ® | ® | ® | Registered trademark. |
| ™ | ™ | ™ | Trademark. |
| ℠ | ℠ | ℠ | Service mark. No named entity. |
| ° | ° | ° | Degree — temperature and angles. |
Mathematical and technical
18 entriesOperators and symbols that are not on a standard keyboard.
| Character | Named | Numeric | Notes |
|---|---|---|---|
| × | × | × | Multiplication sign. Use this rather than the letter x for dimensions. |
| ÷ | ÷ | ÷ | Division sign. |
| ± | ± | ± | Plus-minus. |
| − | − | − | True minus sign, wider than a hyphen. |
| ≠ | ≠ | ≠ | Not equal to. |
| ≤ | ≤ | ≤ | Less than or equal to. |
| ≥ | ≥ | ≥ | Greater than or equal to. |
| ≈ | ≈ | ≈ | Approximately equal to. |
| ∞ | ∞ | ∞ | Infinity. |
| √ | √ | √ | Square root. |
| ∑ | ∑ | ∑ | Summation. |
| ∏ | ∏ | ∏ | Product. |
| ∫ | ∫ | ∫ | Integral. |
| ∂ | ∂ | ∂ | Partial differential. |
| ½ | ½ | ½ | One half. |
| ¼ | ¼ | ¼ | One quarter. |
| ¾ | ¾ | ¾ | Three quarters. |
| µ | µ | µ | Micro sign. Distinct from the Greek letter mu, though they look alike. |
Arrows
9 entriesCommon in navigation, diagrams and documentation.
| Character | Named | Numeric | Notes |
|---|---|---|---|
| ← | ← | ← | Left arrow. |
| → | → | → | Right arrow. |
| ↑ | ↑ | ↑ | Up arrow. |
| ↓ | ↓ | ↓ | Down arrow. |
| ↔ | ↔ | ↔ | Left-right arrow. |
| ⇐ | ⇐ | ⇐ | Double left arrow. |
| ⇒ | ⇒ | ⇒ | Double right arrow — often read as "implies". |
| ⇔ | ⇔ | ⇔ | Double left-right arrow — "if and only if". |
| ↵ | ↵ | ↵ | Carriage return arrow. |
Greek letters
15 entriesUsed in mathematics, science and engineering notation.
| Character | Named | Numeric | Notes |
|---|---|---|---|
| α | α | α | Alpha. |
| β | β | β | Beta. |
| γ | γ | γ | Gamma. |
| δ | δ | δ | Delta. |
| Δ | Δ | Δ | Capital delta — change or difference. |
| ε | ε | ε | Epsilon. |
| θ | θ | θ | Theta. |
| λ | λ | λ | Lambda. |
| μ | μ | μ | Mu. For the micro prefix, µ is the correct character. |
| π | π | π | Pi. |
| σ | σ | σ | Sigma. |
| Σ | Σ | Σ | Capital sigma. For summation, ∑ is the correct character. |
| φ | φ | φ | Phi. |
| ω | ω | ω | Omega. |
| Ω | Ω | Ω | Capital omega — ohms. |
Notes
- Every entity has a numeric form, and numeric forms always work. Named entities are more readable but the set is large and support for the more obscure names has historically been uneven, which is why numeric references are the safer choice in email templates.
- XML predefines only five entities — &lt; &gt; &amp; &quot; and &apos; — so &nbsp; in an XML document is an error unless a DTD declares it. Use the numeric form &#160; instead.
- Escaping is contextual. Escaping for HTML text is not the same as escaping for an attribute, a URL, JavaScript or CSS, and applying the wrong one leaves a hole. Escape at the point of output, for the context it is being written into.
Frequently asked questions
Which entities do I actually have to use?
Should I use named or numeric references?
Why does &nbsp; break my XML or RSS feed?
Is escaping HTML enough to prevent XSS?
Why do non-breaking spaces cause problems?
Related tools
All tools →- HTML Entity Encoder and Decoder Escape HTML special characters, or decode entities back. In your browser
- Unicode Escape and Unescape Convert characters to \uXXXX escapes and back. In your browser
- Text Cleaner Strip formatting, smart quotes and invisible characters. In your browser
- HTML to Text Converter Extract readable plain text from HTML, keeping the structure. In your browser
- URL Encoder and Decoder Percent-encode text for URLs, or decode it back. In your browser
More reference tables
All references →Last reviewed .