Convert special characters to HTML entities and back. Supports named entities, decimal numeric entities, and hex numeric entities. Runs entirely in your browser — nothing is uploaded.
& < > " ', or All characters for a fully encoded representation.
Click any row to insert that entity into the input field.
| Char | Description | Named Entity | Decimal | Hex | Use |
|---|
HTML entities are special text strings that represent characters which would otherwise be interpreted as HTML markup or are difficult to type directly. An entity begins with an ampersand (&) and ends with a semicolon (;). For example, the less-than sign (<) is written as < so the browser displays it as a character instead of treating it as the start of an HTML tag.
<, >, and & must be escaped to appear as literal text inside HTML documents.There are three ways to write an HTML entity:
&, <, ©, —. Not every character has a named entity.& for & or — for an em dash. Works for every character.x, e.g. & or —. Commonly used in XML and SVG contexts.Special characters only encodes the five characters that have special meaning in HTML: &, <, >, ", and '. This is the correct approach for HTML escaping in most web development scenarios — it produces readable output while preventing markup injection.
All characters encodes every character that has a named entity (such as accented letters, currency symbols, and mathematical operators) and represents any remaining non-ASCII characters as numeric entities. Use this mode when you need a fully ASCII-safe representation of text, for example in legacy systems or certain email clients.
Decoding converts entity strings back to their original characters. This tool handles all three entity forms: named (&), decimal (&), and hex (&). Use decode mode to inspect HTML source code or to extract plain text from HTML-encoded content.
Always encode user-supplied content before inserting it into an HTML page. Even if a string looks harmless, failing to encode < and & can allow script injection. This tool is useful for manual inspection; in production code use your framework's built-in escaping functions.