HTML Entities: Writing Special Characters
An HTML entity is a code starting with an ampersand and ending with a semicolon that stands for a character which would otherwise be read as markup or is hard to type.
Represent reserved characters as text without accidentally introducing markup.
You are writing a page about maths and type if a < b. The browser sees < and thinks a tag is starting. Characters that HTML uses for its own syntax need a safe way to appear as plain text, and that way is the entity.
The rule
Ampersand, name, semicolon: a character HTML cannot take literally.
An entity is a short code that the browser replaces with a single character. It always starts with & and ends with ;. The ones you will use most:
| You want | Write |
|---|---|
< |
< (less than) |
> |
> (greater than) |
& |
& (ampersand) |
" inside an attribute value |
" |
| a space that never breaks a line | |
© |
© |
<p>In HTML, a paragraph starts with <p>.</p>
<p>Fish & chips, © 2026 Harbour Cafe</p>The visitor sees "In HTML, a paragraph starts with <p>." and "Fish & chips, © 2026 Harbour Cafe".
Entities can also use numbers. © and © both mean ©, using its Unicode code point in decimal or hexadecimal.
Do you need entities for every accented letter or emoji? No. If your page declares UTF-8 encoding (you will do this with a meta tag soon), you can type é, ₹ or 🌧 directly. Entities are essential only for characters that clash with HTML syntax, mainly < and &, and handy for invisible ones like .