What Are HTML Entities? Plain-English Explanation
- HTML entities are codes that represent characters the browser would otherwise interpret as markup
- They start with & and end with ; — like < for < or & for &
- You need them to safely display special characters, symbols, and reserved characters
- Most commonly needed: & < > "
Table of Contents
HTML has a set of characters it treats as code — <, >, &, and a few others. When you want to display those characters on a page rather than have the browser interpret them as markup, you need HTML entities. They are the safe way to say "show this character literally, do not parse it."
Here is what they are, why they exist, and when you actually need them.
The Basic Idea: Escaping Reserved Characters
HTML uses certain characters to define its own structure. The angle brackets < and > wrap tags. The ampersand & starts entity references. If you want to display these characters in your content — rather than having the browser interpret them as syntax — you need a way to represent them that the parser will not confuse with markup.
That solution is HTML entities. Each entity is a short code starting with & and ending with ;. The browser sees the code, looks up what character it represents, and renders that character visually. The parser never confuses the entity for markup because entities are a defined part of the HTML specification.
Example: to show a literal < on your page, you write < in your HTML. The browser renders it as < without trying to open a tag.
Two Ways to Write HTML Entities
HTML entities come in two formats:
Named entities — Have a readable name. < means less-than, & means ampersand, © means the copyright symbol ©. These are easier to read and remember.
Numeric entities — Use the Unicode code point. < is the numeric form of < (decimal), and < is the hex form. Every character in Unicode has a code point, so numeric entities can represent any character — even ones without a named entity.
Both formats work the same way in browsers. Named entities are preferred when they exist because they are more readable. Numeric entities are useful for obscure symbols, emoji, or characters outside the basic ASCII set.
Sell Custom Apparel — We Handle Printing & Free ShippingThe Most Common HTML Entities You Will Actually Use
| Character | Named Entity | Numeric Entity | When You Need It |
|---|---|---|---|
| & | & | & | Anywhere you write & in content or attributes |
| < | < | < | Showing code examples, math, comparisons |
| > | > | > | Same — showing code or closing brackets |
| " | " | " | Quotes inside attribute values |
| (non-breaking space) | |   | Preventing line breaks between words |
| © | © | © | Copyright symbol in footers |
When Do You Actually Need HTML Entities?
You do not need entities for every character. Most text — letters, numbers, punctuation — can be written directly in UTF-8 encoded HTML without any escaping. Entities are only necessary in specific situations:
- Displaying reserved characters — < > & — these must be encoded whenever they appear in content or attribute values
- Showing code examples — Any HTML or XML code in a <pre> or <code> block needs its angle brackets encoded or the browser renders the tags instead of showing them
- URLs in attributes — & in href query strings must be &
- XML and RSS feeds — These formats are strict; all reserved characters must be encoded
- Special symbols without keyboard keys — © ® ™ — these are easy to type as named entities (© ® ™) rather than remembering how to insert the actual character
If your HTML is UTF-8 encoded (which it should be, declared with <meta charset="UTF-8">), you can write most Unicode characters directly. Entities are for the reserved characters and for old systems that do not handle UTF-8 reliably.
How to Encode HTML Entities Quickly
For one or two characters: replace them manually using the table above. & becomes &, < becomes <, and so on.
For a block of text: paste it into the free HTML entity encoder. It scans the entire text and converts all reserved characters at once. The output is safe to paste directly into your HTML. This is faster than manual replacement and catches characters you might overlook.
For programming: your language or framework almost certainly has a built-in function — htmlspecialchars() in PHP, HtmlEncoder.Default.Encode() in C#, html.escape() in Python. Use the language built-in for server-side encoding; the browser tool is for quick manual conversions.
Encode HTML Entities Instantly
Paste your text. All reserved characters encoded in one click. Free, no signup.
Open Free HTML Entity ToolFrequently Asked Questions
What are HTML entities?
HTML entities are codes that represent characters the browser would otherwise interpret as markup. They start with & and end with ; — like < for < or & for &.
Do I need HTML entities for emoji?
Not if your page is UTF-8 encoded (declared with meta charset=UTF-8). You can paste emoji directly. Entities are needed for the reserved HTML characters: &, <, >, and ".
What is the difference between named and numeric HTML entities?
Named entities use a word (& <) and numeric entities use a code point (& <). Both render the same character. Named entities are more readable; numeric entities cover any Unicode character.
When do I NOT need HTML entities?
For regular letters, numbers, and most punctuation in UTF-8 HTML. Entities are only required for &, <, >, and " in certain contexts, plus special cases like URLs in attributes.

