HTML Entity Converter
Encode and decode special characters for XSS prevention.
Common HTML Entities Reference
| Char | Named | Decimal | Hex | Description |
|---|---|---|---|---|
| & | & | & | & | Ampersand |
| < | < | < | < | Less than |
| > | > | > | > | Greater than |
| " | " | " | " | Double quote |
| ' | ' | ' | ' | Single quote |
| |   |   | Non-breaking space | |
| © | © | © | © | Copyright |
| ® | ® | ® | ® | Registered trademark |
| ™ | ™ | ™ | ™ | Trademark |
About this tool
The HTML Entity Converter is a lightweight developer utility designed to translate special characters (like < > & " ') into HTML-safe equivalents. It supports both encoding plain text into Named, Decimal, and Hexadecimal entities, and decoding them back into human-readable text.
HTML entities like &, < or > are supported in three formats: named entity, decimal, and hexadecimal.
How to use
Select mode
Choose the 'Encode' or 'Decode' tab.
Enter text
Input HTML to decode, or plain text to encode.
Copy result
Copy the encoded/decoded result to clipboard.
Glossary
- HTML Entity
- A piece of text ("string") that begins with an ampersand (
&) and ends with a semicolon (;). Entities are used to display reserved characters in HTML. - Named Entity
- Uses an easy-to-remember name, like
&copy;for the copyright symbol ©. - Decimal / Hexadecimal Entity
- Uses the character's numeric code (base-10 or base-16) to specify it directly. This works for all Unicode characters including emojis.
- XSS (Cross-Site Scripting)
- A vulnerability where hackers inject malicious scripts. Escaping HTML characters is the primary defense against XSS.
FAQ
- Q.Which characters are encoded?
- The five essential HTML characters (
&,<,>,",') are encoded to their named equivalents. Additionally, all non-ASCII characters (like emojis and accented letters) are encoded into decimal/hex numeric references. - Q.Does it handle full HTML documents?
- Yes, you can paste entire HTML documents into the Encode tab to safely escape the source code so it can be displayed inside a
<pre><code>block on a webpage. - Q.Can it decode JavaScript escapes like \u00A9?
- No. This tool is strictly for HTML entities (
&...;).
Use Cases
Displaying Code Snippets
Encode HTML source code so it can be safely displayed on a tutorial blog without being rendered by the browser.
Security / Sanitization
Double-check how user input is escaped to prevent Cross-Site Scripting (XSS) injection attacks.
Email Templates
Convert Unicode characters and emojis to numeric entities to ensure they render correctly across older or restrictive email clients.
Send Feedback
Please let us know your thoughts to help us improve the tool.
Feedback is temporarily suspended
The server is busy or spam protection is active. Please try again later.