Unicode and HTML Character Reference

Unicode gives every supported character a stable code point, while HTML provides several ways to place those characters in a web page. This reference brings the two systems together so you can identify a symbol, choose the safest representation, and understand what browsers actually receive.

Fast rule: use UTF-8 and type the character directly when the source file is reliably encoded. Use a named or numeric HTML character reference when the literal character would be unclear, reserved by HTML, difficult to type, or vulnerable to encoding mistakes.

Four Ways to Represent the Same Character

FormatDegree sign exampleBest use
Literal UTF-8 character°Readable modern HTML, text, and data files
Named HTML entity°Recognizable entities with memorable names
Decimal reference°Any Unicode character by decimal value
Hexadecimal reference°Any Unicode character using its familiar hex code point

Start with the Right Reference

Characters HTML Treats Specially

The ampersand begins a character reference, and the less-than sign can begin a tag. Those characters should be escaped when they are intended as ordinary text inside HTML source. Quotation marks also require care inside matching quoted attribute values.

Use the Interactive Code Tools