Skip to main content
Syllabus
On this page

HTML Entities & Special Characters

Badar KhalilUpdated September 27, 2026 2 min read

HTML Entities & Special Characters

Focus Keyword: html entities  |  Trending Keyword: html special characters list

HTML entities let you safely display reserved characters (like < and >) and special characters that aren't easily typed on a keyboard. Every entity begins with an ampersand & and ends with a semicolon ;. Searches for an "html special characters list" spike constantly among developers who need quick reference tables like the one below.

Why Use Entities?

  • To display reserved HTML characters (<, >, &, ", ') without breaking the markup.
  • To insert characters not present on a standard keyboard (©, €, ♥).
  • To ensure consistent rendering across browsers and encodings.

Entity Syntax

There are three ways to write an entity:

  1. Named entity: &copy; → ©
  2. Decimal numeric reference: &#169; → ©
  3. Hexadecimal numeric reference: &#x00A9; → ©

Essential Reserved Character Entities

CharacterEntity NameNumericDescription
<&lt;&#60;Less than
>&gt;&#62;Greater than
&&amp;&#38;Ampersand
"&quot;&#34;Double quote
'&apos;&#39;Single quote/apostrophe
 &nbsp;&#160;Non-breaking space

When You Must Use Entities

If you want a literal "<" to appear as text on the page (not be interpreted as the start of a tag), you MUST use &lt;. Typing a raw "<" in content will confuse the browser's HTML parser.

Common Mistakes

  • Forgetting the trailing semicolon (some browsers tolerate it, but it's invalid and unreliable).
  • Double-escaping ampersands, producing &amp;amp;.
  • Using raw "&" in URLs instead of "&amp;" inside HTML attribute values.
Try it Yourself HTML
Output

Press Run to execute.

Try it Yourself HTML
Output

Press Run to execute.

Try it Yourself JAVASCRIPT
Output

Press Run to execute.

Exercise: Escape the Reserved CharactersHTML

Rewrite the following text so it displays correctly as literal text in a browser, using proper HTML entities: Use <div> & <span> tags for "layout".

Try it Yourself HTML
Output

Press Run to execute.

This is a self-check — compare your result with the expected output above.

Was this page helpful?