Developer Tool
HTML Escape / Unescape Tool ๐
Convert HTML special characters to their safe entity equivalents, or unescape entities back to readable characters. Essential for web developers and content writers.
Common entities (click to insert)
< โ <
> โ >
& โ &
” โ "
‘ โ '
ยฉ โ ©
ยฎ โ ®
โข โ ™
0 characters
๐ How To Use
1
Select a mode. Choose “Escape HTML” to convert characters like < > & into safe HTML entities, or “Unescape HTML” to convert entities back to their original characters.
2
Configure options. In Escape mode: toggle whether to escape quotes (useful for attribute values), escape non-ASCII characters, or use numeric entities (<) instead of named ones (<).
3
Paste your text. Enter HTML code, raw text, or any string containing special characters into the input box.
4
Click the button. The result appears immediately with a count of how many replacements were made. Copy it with one click.
โ๏ธ How It Works
HTML Escaping
Replaces reserved HTML characters with their entity equivalents so they are rendered as literal text rather than interpreted as HTML markup by the browser.
HTML Unescaping
Converts both named entities (&, <) and numeric entities (<, <) back to their original characters using a browser DOM parser.
Numeric Entities
When enabled, outputs < instead of <. Numeric entities are universally supported and useful when named entities might not be recognized by older parsers.
Non-ASCII Escaping
When enabled, converts characters outside the ASCII range (like รฉ, รผ, โฌ, โข) to their numeric HTML entities, ensuring compatibility with ASCII-only systems.
| Char | Character Name | Named Entity | Numeric Entity |
|---|---|---|---|
| < | Less than | < | < |
| > | Greater than | > | > |
| & | Ampersand | & | & |
| “ | Double quote | " | " |
| ‘ | Single quote | ' | ' |
| ยฉ | Copyright | © | © |
| ยฎ | Registered | ® | ® |
| โข | Trademark | ™ | ™ |
| โฌ | Euro sign | € | € |
| | Non-breaking space | |   |
โ Frequently Asked Questions
If you insert raw HTML characters like < and > directly into web page content without escaping, the browser interprets them as HTML tags rather than literal characters. This can break your page layout and โ more critically โ create Cross-Site Scripting (XSS) security vulnerabilities if the content comes from user input. Always escape user-generated content before displaying it in HTML.
Both represent the less-than character (<). < is a named entity โ a human-readable shorthand defined in the HTML specification. < is a numeric entity โ it directly references the Unicode code point of the character (60 in decimal). Both are valid and render identically in browsers. Named entities are more readable; numeric entities work in any context regardless of whether named entities are supported.
Yes, when the content appears inside HTML attribute values. For example, <input value=”user’s name”> is fine, but <input value=”say “hello””> would break the attribute. Escaping the inner double quotes as " fixes this. Inside regular text content between tags, escaping quotes is optional but harmless.
Cross-Site Scripting (XSS) is a security attack where malicious JavaScript is injected into a web page through unescaped user input. For example, if a user submits <script>alert(‘hacked’)</script> and it is displayed without escaping, the script executes in other users’ browsers. Escaping converts this to harmless text: <script>alert(‘hacked’)</script>, which browsers display as literal characters, preventing execution.
Use HTML unescaping when you have received entity-encoded text that you want to read as plain characters. Common scenarios: converting escaped HTML from a database or API back to readable text for editing, processing escaped content in scripts before transformation, reviewing the actual content of HTML templates, or converting entities in metadata or RSS feeds to plain text.
๐ Related Tools
๐ ๏ธ
Found a Bug or Have a Suggestion?
Help us improve this tool. If you found an error, have a feature request, or think something could work better โ we would love to hear from you.