The team behind OnlineTools4Free — building free, private browser tools.
Published Apr 1, 2026 · 7 min read · Reviewed by OnlineTools4Free
HTML Entities: Special Characters Reference Guide
What Are HTML Entities?
HTML entities are codes that represent characters which have special meaning in HTML or cannot be typed easily on a standard keyboard. They begin with an ampersand (&) and end with a semicolon. For example, < displays a less-than sign (<) without the browser interpreting it as the start of an HTML tag.
Entities exist because HTML uses certain characters for its own syntax. The less-than sign (<), greater-than sign (>), ampersand (&), and quotation marks all have structural meaning in HTML. If you want to display these characters as text content rather than as markup, you must encode them as entities.
Beyond reserved characters, entities provide access to thousands of symbols, mathematical operators, arrows, currency signs, and accented letters. While modern HTML documents using UTF-8 encoding can include most characters directly, entities remain useful for clarity, backward compatibility, and characters that are difficult to type.
Essential HTML Entities
Five entities are mandatory knowledge for any HTML author because they represent characters that conflict with HTML syntax:
- < — Less-than sign (<). Without this entity, the browser would interpret the character as the start of a tag.
- > — Greater-than sign (>). While technically only required in certain contexts, encoding it is best practice for consistency.
- & — Ampersand (&). Since entities themselves start with an ampersand, a literal ampersand must be encoded to avoid being interpreted as the start of an entity.
- " — Double quotation mark ("). Required inside attribute values that are delimited by double quotes.
- ' — Apostrophe/single quote ('). Required inside attribute values delimited by single quotes. Note that
'is not defined in HTML 4 but is valid in HTML5 and XHTML.
If you remember nothing else about HTML entities, remember these five. Using them correctly prevents rendering bugs, XSS vulnerabilities, and validation errors.
Named vs. Numeric Entities
HTML entities come in three forms:
Named entities: Human-readable names like © (copyright symbol), € (euro sign), and — (em dash). Named entities are easier to read and remember but not every character has a named entity.
Decimal numeric entities: Use the character's Unicode code point in decimal: © for the copyright symbol (Unicode code point 169). Every Unicode character can be represented this way.
Hexadecimal numeric entities: Use the code point in hexadecimal with an x prefix: © for the copyright symbol (A9 in hex = 169 in decimal). Hex entities match the code point format used in Unicode documentation, making them easier to look up.
All three forms produce the same result: ©, ©, and © all display the copyright symbol. Use named entities when available for readability. Use numeric entities for characters without named equivalents.
Common Symbol Entities
These frequently used entities cover common typographic and symbolic needs:
Typography: — (em dash), – (en dash), … (ellipsis), ‘ and ’ (left and right single quotes), “ and ” (left and right double quotes), • (bullet), · (middle dot).
Currency: € (euro), £ (British pound), ¥ (Japanese yen / Chinese yuan), ¢ (cent), ¤ (generic currency).
Math: × (multiplication), ÷ (division), ± (plus-minus), ≠ (not equal), ≤ (less than or equal), ≥ (greater than or equal), ∞ (infinity), ∑ (summation).
Arrows: ← (left arrow), → (right arrow), ↑ (up arrow), ↓ (down arrow), ↔ (left-right arrow).
Legal/IP: © (copyright), ® (registered trademark), ™ (trademark).
Spaces: (non-breaking space),   (en space),   (em space),   (thin space). Non-breaking space is the most commonly used — it prevents a line break between two words.
When to Use Entities in Modern HTML
With UTF-8 encoding (which should be the default for all modern HTML documents), most characters can be typed directly into the source code. You can type accented characters (e, u, a), currency symbols, and most special characters directly. So when are entities still necessary?
- Always: For the five reserved characters (<, >, &, ", ') when they appear in content or attributes.
- Readability: Entities like
—are more readable in source code than the actual em dash character, which looks like a long hyphen and is easily confused with a regular dash or en dash. - Non-breaking spaces:
is more visible in source code than an actual non-breaking space character, which looks identical to a regular space. - Invisible characters: Zero-width joiners, zero-width spaces, and other invisible Unicode characters should be represented as entities so they are visible in the source code.
- Templating safety: When outputting user-generated content, encoding all special characters as entities prevents HTML injection and XSS attacks.
Encode HTML Entities Online
Our HTML Entity Encoder converts special characters to their HTML entity equivalents and vice versa. Paste text containing special characters and get the encoded version instantly, or paste encoded text to decode it back to readable characters.
The tool handles named entities, decimal entities, and hexadecimal entities. Use it to prepare user input for safe HTML output, decode entities found in source code, or look up the entity code for any character.
HTML Entity Encoder
Encode and decode HTML entities for safe rendering in web pages.
OnlineTools4Free Team
The OnlineTools4Free Team
We are a small team of developers and designers building free, privacy-first browser tools. Every tool on this platform runs entirely in your browser — your files never leave your device.
