HTML Entity Codes: A Simple Reference Guide for 2026

HTML entity codes let you show special characters in a web page without confusing the browser. A browser reads angle brackets as HTML tags, so typing a raw less-than sign inside content can break your markup. Entities solve that problem by giving each special character a safe text form. You do not need to memorise hundreds of them, since a small set covers most daily work.

Contents

What HTML Entity Codes Are

An entity is a short code that stands for one character, and it always starts with an ampersand and ends with a semicolon. For example, the copyright sign can be written as a named entity, and the browser displays the sign instead of the code text. Entities exist because some characters have a special job in HTML, while others are hard to type on a normal keyboard.

Think of entities as a safe spelling for characters that would otherwise be misunderstood. The browser converts the code into the intended character when it renders the page. Visitors never see the code itself unless they view the page source. That separation keeps your markup valid and your visible text correct at the same time.

HTML Entity Codes for Characters You Must Escape

Diagram of the most used entities: copyright, less than, greater than, ampersand, and dash

Only a few characters must always be escaped in HTML content, and learning those few will prevent most markup problems. The less-than sign must be escaped because it starts a tag, and the greater-than sign should be escaped for symmetry and clarity. The ampersand must be escaped because it starts an entity itself, so a raw ampersand can confuse the parser.

Quotes need care inside attribute values, since a quote can end an attribute early and break the tag. Use the matching quote entity when a quote appears inside an attribute delimited by the same quote type. Outside attributes, quotes are usually safe to type directly, but escaping them never hurts. Master these five cases first, and treat every other entity as a convenience rather than a requirement.

Named Decimal and Hex Formats

Entities come in three forms, and each form points to the same character in a different way. A named entity uses a readable word, such as the name for copyright, and it is the easiest form to remember. A decimal entity uses the character number, while a hex entity uses the same number in hexadecimal with an extra letter marker.

Named forms are best for common signs that readers may need to recognise in source code. Numeric forms are best for rare symbols that have no short name or where you only know the character number. Hex forms appear often in reference tables and in code copied from character maps. All three forms are valid HTML, so pick the one that makes your source easiest to read and maintain.

Common HTML Entity Codes at a Glance

CharacterNamed formNumeric form
Copyright signand-copy-semicolon169
Less than signand-lt-semicolon60
Greater than signand-gt-semicolon62
Ampersand signand-amp-semicolon38
Double quoteand-quot-semicolon34
Registered signand-reg-semicolon174
Trade mark signand-trade-semicolon8482
Euro signand-euro-semicolon8364
Pound signand-pound-semicolon163
Long dashand-mdash-semicolon8212
Bullet dotand-bull-semicolon8226
Right arrowand-rarr-semicolon8594

Note: In real HTML, each named form is written as an ampersand, then the name, then a semicolon. The table spells the parts out in words so this draft itself does not get altered by rendering. The numeric column gives the decimal number, written in real HTML as an ampersand, then a hash, then the number, then a semicolon.

When You Can Skip Entities in Modern Pages

Diagram explaining named, numeric, and direct typing options for special characters

Modern pages declared with UTF-8 encoding can include most characters directly, including accented letters, currency signs, and common symbols. If your editor saves files as UTF-8 and your page declares that encoding, typing the character itself is usually cleaner than hunting for its entity. This is why many modern guides use entities less often than older guides did.

Direct typing does not remove the escaping rules for reserved characters, so angle brackets and ampersands still need entities. It also pays to stay consistent within a project, so other editors can follow your style. When in doubt, escape the reserved characters and type the rest directly. That balance keeps source readable without risking broken markup.

Mistakes That Break Your Page

The most common mistake is forgetting the final semicolon, which can make the browser read the entity as ordinary text or merge it with the next word. Another common mistake is escaping a character twice, which shows the code itself on the page instead of the symbol. Both mistakes are easy to spot by previewing the page after every edit.

Copying text from a word processor can also introduce smart quotes and long dashes that look fine but behave oddly in some editors. Check pasted content in preview, and replace problem characters with entities or with plain typed characters as needed. A quick preview habit catches these issues before visitors ever see them.

Leave a Reply

------------------ ...........................................