HTML Entities Encoder & Decoder
Convert reserved and special characters into HTML entities (such as <, >, and &) or decode entities back to plain text.
Plain Characters / HTML
HTML Entities
Encode & Decode HTML Entities Online
In HTML syntax, certain characters are reserved for markup structure. For instance, the less-than symbol (<) signals the opening of a tag, while the ampersand (&) indicates the start of an entity reference. If you want these symbols to display as visible text on a webpage rather than being interpreted by the browser as code, they must be converted into their corresponding HTML entities.
Named Entities vs. Numeric Character References
- Named Entities: Easy-to-remember mnemonics preceded by an ampersand and terminated with a semicolon, such as
<for<,>for>, and&for&. - Decimal References: Numeric representations corresponding to the character's Unicode code point, such as
<for<. - Hexadecimal References: Hex-encoded representations of the Unicode code point, such as
<for<.
Essential HTML Reserved Characters
| Symbol | Named Entity | Decimal Entity | Description |
|---|---|---|---|
| & | & | & | Ampersand symbol |
| < | < | < | Less-than sign (opening HTML tag) |
| > | > | > | Greater-than sign (closing HTML tag) |
| " | " | " | Double quotation mark |
| ' | ' | ' | Single quotation mark (apostrophe) |
| © | © | © | Copyright symbol |
| ™ | ™ | ™ | Trademark symbol |
Why Escaping HTML is Critical
- Displaying Code Snippets: Whenever you publish code tutorials, programming blogs, or documentation, wrapping raw HTML in
<and>entities allows code to display safely inside<pre><code>tags without executing. - Preventing XSS Vulnerabilities: Rendering unescaped user input in web browsers creates Cross-Site Scripting (XSS) risks. Converting user text to HTML entities defangs potentially malicious script tags.
Related Web & Text Utilities
Explore more text processing and encoding tools:
- URL Encode & Decode — percent-encode query strings and web addresses.
- Base64 Encode & Decode — convert binary data and text into Base64 strings.
- Find and Replace — batch replace text strings or strip HTML tags with regex.
- Clean Whitespace — remove accidental indentation, spaces, and line breaks.