HTML Entity Encoder / Decoder
Convert special characters to HTML entities and back. Prevent XSS and display issues.
Common HTML entities
| Character | Entity | Description |
|---|---|---|
| & | & | Ampersand |
| < | < | Less-than |
| > | > | Greater-than |
| " | " | Double quote |
| ' | ' | Single quote |
| | Non-breaking space | |
| © | © | Copyright |
| ® | ® | Registered trademark |
| ™ | ™ | Trademark |
Common use cases
HTML encoding is a fundamental security and compatibility technique for web development.
Prevent XSS vulnerabilities
Encode user input before rendering it in HTML templates to neutralize script injection attempts.
Fix display issues
Encode special characters that break HTML rendering, such as angle brackets in code examples or ampersands in URLs.
Prepare email templates
Encode special characters in HTML email content to ensure consistent rendering across email clients.
Frequently asked questions
Short answers to the questions people usually have before using the tool.
When should I HTML-encode text?+
Encode user-supplied text before inserting it into HTML to prevent XSS attacks and ensure special characters like < > & display correctly instead of being interpreted as markup.
What is the difference between named and numeric entities?+
Named entities like & are human-readable aliases. Numeric entities like & use the Unicode code point. Both render the same character in browsers.
Does this tool handle emoji and Unicode?+
Yes. When the Encode all non-ASCII option is checked, emoji and other Unicode characters are converted to numeric HTML entities.
Related tools
Keep moving through related utility tasks without leaving the toolbox.
Convert between CSV and JSON data formats instantly. Supports custom delimiters.
Format, validate, and beautify JSON data with syntax highlighting.
Beautify and indent SQL queries for better readability. Supports SELECT, INSERT, UPDATE, and DELETE.
Convert text to binary, hexadecimal, decimal, and octal — or reverse any format.