HTML Entities
An HTML entity is a short code that stands for a character in the page text. The browser swaps the code for the character when the page renders.
Angle brackets as text
HTML reads angle brackets as tag markers, so the page cannot type them raw. The entities print the brackets as plain text.
<p>Write <p> to start a paragraph.</p>Ampersand and copyright
The ampersand starts every entity, so a real ampersand needs its own entity. The copy entity draws the copyright sign.
<p>Tom & Ana wrote this page.</p>
<p>© 2026 Ana Lane</p>Quotes inside text
The quot entity prints a double quote mark. Quotation marks inside the text stay safe as entities.
<p>She said "hello" twice.</p>A space that holds words together
The nbsp entity prints a space that keeps the two words on one line. The render shows a normal space between the words.
<p>New York</p>Entities as numbers
A numeric entity names a character by its number code. The number 169 draws the same copyright sign as the copy entity.
<p>The number © draws the copyright sign.</p>Example
<!DOCTYPE html>
<html lang="en">
<head>
<title>Entity Practice</title>
</head>
<body>
<h1>Entity Practice</h1>
<p>5 < 8 and 8 > 5.</p>
<p>Tom & Ana share one bike.</p>
<p>She said "well done".</p>
<p>© 2026 Hill School</p>
</body>
</html>Key points
- Entity: a short code that stands for one character in the text
- An entity lets a page print characters that HTML uses for its own work
- <: the entity that shows a less-than sign
- >: the entity that shows a greater-than sign
- &: the entity that shows an ampersand
- ©: the entity that shows a copyright sign
- : the entity that shows a space that keeps two words on one line
In this example, every paragraph carries one or two entities. The first line prints a less-than sign and a greater-than sign as text. The second line prints a real ampersand through its entity. The third line prints quote marks, and the last line prints the copyright sign. The browser swapped each code for its character during the render.
Note
An entity starts with an ampersand and ends with a semicolon, and a missing semicolon can leave the code showing
Try it Yourself
Edit the code, then press Run.
Runs in your browser — the preview under the editor is the real result. Nothing is sent to a server. The code runner panel (right) does the same with more room.
Exercise
Which entity shows an ampersand in the page text?