HTML Escape
Escape HTML special characters so text renders literally instead of as markup. It runs entirely on your device — nothing is uploaded.
Reviewed by the CalcCafe editorial team · Last updated 1 July 2026 · How we test our tools
Example
<b>Bold</b> & "quoted"
<b>Bold</b> & "quoted"
How it works
Characters like <, >, &, " and ' are replaced with their HTML entities so the text displays as-is.
Good to know
HTML Escape converts the five characters that have special meaning in HTML — the less-than sign, greater-than sign, ampersand, double quote, and single quote — into their named entity equivalents (<, >, &, ", and ' or '). The result is text that a browser will display exactly as written instead of trying to interpret it as tags or attributes. It is built for developers, technical writers, and anyone who needs to show code or markup on a web page without it being rendered.
Reach for it whenever literal angle brackets or ampersands need to survive a trip through HTML: pasting a code snippet into a blog post, putting example markup inside a documentation table, dropping user-supplied text into an HTML email, or hand-building a static page where stray characters would otherwise break the layout. Escaping is also the core defense against stored or reflected cross-site scripting (XSS) — if any value originating from a user ends up inside HTML, escaping it first prevents that value from becoming executable markup.
To read the output, compare it character by character with your input: each special character becomes a short sequence starting with an ampersand and ending in a semicolon, while everything else (letters, digits, spaces, line breaks) passes through untouched. When that output is later placed in an HTML document and viewed in a browser, it will look identical to your original input, because the browser decodes the entities back into the visible characters.
One important caveat: escaping for HTML body content is not the same as escaping for other contexts. A value that is safe inside a paragraph may still be unsafe inside a URL, a JavaScript string, or an unquoted attribute, so do not treat HTML escaping as a universal sanitizer. Also avoid escaping the same text twice — double-escaping turns an ampersand into &amp; and will show the raw entity codes to your readers; if you need to go back, pair this with the HTML Unescape tool instead.
Frequently asked questions
Is my data uploaded anywhere?
Is this tool free?
People also ask
What is the difference between HTML escaping and HTML encoding?
Which characters need to be escaped in HTML?
Does HTML escaping prevent XSS attacks?
How do I reverse HTML escaping?
Should I escape single quotes and double quotes?
What happens if I escape text that is already escaped?
Do I need to escape characters like accented letters or emoji?
Is escaping handled automatically by web frameworks and template engines?
Related tools
- HTML Formatter
- HTML Pretty Print
- HTML Editor
- HTML Viewer
- HTML Validator
- HTML Unescape
- Minify HTML
- HTML to Jade
Sources & references
These tools follow our methodology and provide educational estimates only — verify important figures with a qualified professional.