HTML Entities: Encoding Special Characters for the Web

· 2 min read

HTML entities provide a way to include characters in HTML that would otherwise be interpreted as markup or that aren't easily typeable. They come in two forms: named entities like & for &, and numeric references like © or © for the copyright symbol ©.

When You Must Use Entities

A small set of characters must be escaped in HTML to avoid parse errors. The ampersand & must be written as &amp; to avoid being interpreted as the start of an entity. The less-than sign < must be &lt; to avoid starting an HTML tag. Inside attribute values, quotes also need escaping. Everything else is optional when your document is correctly declared as UTF-8.

Named vs Numeric Entities

HTML5 defines over 2,000 named character references, from familiar ones like &nbsp; (non-breaking space) and &copy; (©) to obscure mathematical operators. Named entities are readable but require memorization. Numeric references work for any Unicode character: &#x1F600; renders as 😀. Browse all named entities in our HTML entities reference.

The UTF-8 Alternative

With a proper <meta charset="UTF-8"> declaration, you can include most characters directly in HTML source without entities. Writing © 2026 directly is equivalent to &copy; 2026 and is often clearer. Entities are mainly useful when your source file doesn't support the target encoding, or for the handful of structurally significant characters (<, >, &, and quotes in attributes).

Finding the Right Entity

Each character in our character browser shows its HTML entity representation — both the named form (if one exists) and the numeric reference. You can also use the text encoder to convert any string into HTML entity form in bulk.

More Articles

View all articles