How to Add Special Characters in HTML
Use HTML entities when you need to display characters that are reserved in HTML or are not easy to type directly from your keyboard. This works well for symbols like <, >, copyright marks, currency signs, and accented characters.
What you’ll build or solve
You’ll learn how to add special characters in HTML using entity codes. You’ll also know when to use named entities versus numeric codes.
Learn HTML on Mimo
When this approach works best
This approach is the right choice when a character would otherwise be treated as HTML code or may not display consistently.
Common real-world scenarios include:
- Showing
<and>in code examples - Displaying copyright and trademark symbols
- Adding currency symbols like euro, pound, or dollar
- Showing accented characters in names
- Displaying ampersands in company names
This is a bad idea when the character already works normally as plain text and readability is better without the entity.
Prerequisites
You only need:
- A basic HTML file
- A text editor
- Basic HTML knowledge
Step-by-step instructions
Step 1: Replace the special character with its HTML entity
Use the correct entity code in the exact spot where the character should appear.
HTML
<p>5 < 10</p>
<p>Use & for an ampersand</p>
For symbols and accented characters, use the matching entity name or numeric code.
HTML
<p>© 2026 Mimo</p>
<p>Price: £19</p>
<p>François</p>
What to look for:
- Use
<for< - Use
>for> - Use
&for& - Use entities for symbols like
©,™, and£ - Every entity starts with
&and ends with;
Examples you can copy
Code comparison
HTML
<p>3 < 7 and 9 > 4</p>
Copyright footer
HTML
<footer>© 2026 Code Academy USA</footer>
French name with accent
HTML
<p>François Dubois</p>
Common mistakes and how to fix them
Mistake 1: Typing < directly in visible text
What the reader might do:
HTML
<p>5 < 10</p>
Why it breaks: the browser may treat < 10 as the start of a broken HTML tag.
Corrected approach:
HTML
<p>5 < 10</p>
Mistake 2: Forgetting the semicolon
What the reader might do:
HTML
<p>© 2026</p>
Why it breaks: some browsers may still render it, but the entity is incomplete and less reliable.
Corrected approach:
HTML
<p>© 2026</p>
Mistake 3: Using plain & in company names
What the reader might do:
HTML
<p>Johnson & Johnson</p>
Why it breaks: the browser may expect an entity after &.
Corrected approach:
HTML
<p>Johnson & Johnson</p>
Troubleshooting
If the symbol does not appear, check that the entity starts with & and ends with ;.
If the page HTML looks broken, replace raw < or > characters with < and >.
If the wrong accent appears, verify the correct named entity or use the numeric code instead.
If the symbol still fails, confirm the page uses UTF-8 encoding.
Quick recap
- Use HTML entities for reserved or special characters
- Start with
&and end with; - Use common entities like
<,>, and& - Use named entities for symbols like
©and£ - Replace raw
<and&characters when they should display as text
Join 35M+ people learning for free on Mimo
4.8 out of 5 across 1M+ reviews
Check us out on Apple AppStore, Google Play Store, and Trustpilot