HTML escape
EncodeExperimentalLimited support. Verify anything critical.
HTML escape replaces ampersands, angle brackets, and quotes with HTML entities so a string can sit in text or a quoted attribute without being parsed as markup. It escapes only five characters, is not a full-document sanitizer, and does not parse or rewrite tags.
Skip to the toolThis tool processes text on your device. The text is not uploaded.
Steps
Paste the untrusted text
Run locally
Embed the entities
How to use HTML escape
Five entities only
| Character | Entity |
|---|---|
& |
& |
< |
< |
> |
> |
" |
" |
' |
' |
Ampersand must be first. This does not sanitize javascript: URLs or unquoted attributes.
How it works
- Enter what you haveType or pick your text. Nothing is submitted anywhere.
- It runs in this tabThe calculation happens on your device, using your browser's own data.
- Take the resultRead the text, then copy or download.
Reimplemented locally. Not derived from IT-Tools source.
- Basis
- independent
- Licence
- MIT
- Last reviewed
Frequently asked questions
What characters are escaped by this tool?
The tool escapes the five core HTML/XML special characters: ampersand (& -> &), less-than (< -> <), greater-than (> -> >), double quote (" -> "), and single quote (' -> ').
Does HTML escaping protect against all XSS attacks?
HTML entity escaping protects text nodes and attribute values from tag injection. However, it does not sanitize dangerous URI schemes (like 'javascript:') or unquoted attribute contexts. Comprehensive defense requires context-aware sanitization.
Why is the ampersand (&) escaped first?
Escaping the ampersand first ensures that subsequent entity replacements (such as <) are not accidentally double-escaped into &lt;.
Is single quote represented as ' or '?
The tool uses numeric entity ''' for maximum backward compatibility across older browsers and XML/HTML parser implementations.