HTML Entities vs Unicode Code Points: What's the Difference?
When inserting special characters in HTML, you have two main options: HTML entities (like & or ©) and Unicode numeric references (like © or ©). They're not the same thing, and knowing which to use—and when—saves you debugging headaches.
HTML Named Entities
Named entities are a shorthand defined by the HTML specification. Common examples include & for the ampersand U+0026 &, < for less-than U+003C <, for non-breaking space U+00A0, and © for the copyright symbol ©. There are over 2,000 named entities in HTML5, covering a large subset of mathematical, typographic, and symbol characters.
Named entities are human-readable, but they only exist in HTML—you can't use © in XML, SVG, or plain text. Also, not every Unicode character has a named entity. Browse the full list at the HTML entities reference.
Numeric Character References
A numeric character reference directly encodes a Unicode code point in HTML. There are two forms:
- Decimal:
©= © (U+00A9) - Hexadecimal:
©= © (same character)
Numeric references work for any assigned Unicode code point, making them universally applicable. The hex form is preferred by developers because it matches the U+XXXX notation directly—🔥 is the fire emoji 🔥 U+1F525.
When to Use Which
In modern HTML with a correctly declared UTF-8 charset, you don't need to escape most characters—just include them directly. The only characters you must escape in HTML content are <, >, and & (using <, >, and &). Everything else can be typed or pasted as-is.
Use named entities in HTML templates where readability matters. Use numeric references when you need to represent a character that might cause encoding issues in your source code or text editor—or when you want to make the code point explicit in documentation. Use the character comparison tool to see multiple characters' entity representations side by side.