Character Entities
5 min read
Special Characters in HTML
Some characters have special meaning in HTML (<, >, &) and cannot be typed directly as content. Others are difficult to type on a keyboard. HTML entities are escape codes that represent these characters.
html
<!-- Displaying reserved characters -->
<p>Use <p> for a paragraph and <h1> for a heading.</p>
<!-- Ampersand must be escaped -->
<p>Alice & Bob</p>
<!-- Copyright and trademark -->
<p>© 2026 CPCODELAB — All Rights Reserved™</p>
<!-- Non-breaking space (keeps words together) -->
<p>10 km from the city centre</p>
<!-- Quotes -->
<p>“Hello,” she said.</p><— Less-than sign<>— Greater-than sign>&— Ampersand&"— Double quotation mark"'— Apostrophe' — Non-breaking space©— Copyright symbol ©—— Em dash —
Ready to test yourself?
Practice HTML— quiz & coding exercises