HTML Escape / Unescape
Convert special characters to HTML entities (or reverse it) to safely embed text inside HTML.
About this tool
The HTML Escape / Unescape tool converts special characters into HTML entities and turns entities back into their original characters. Symbols like <, >, & and quotes have structural meaning in HTML; escaping them as <, >, & and " lets you display them as literal text instead of having the browser treat them as markup.
It is essential for safely embedding user-supplied text, showing code samples on a page, or debugging content that arrives with stray entities. Escaping and unescaping run locally in your browser, so it is a fast, private way to prepare snippets for HTML.
How to use
- Choose to escape raw text into HTML entities, or unescape entities back to plain text.
- Paste your content into the input box.
- Read the converted output generated instantly below.
- Use escape mode before placing text inside HTML so tags are shown, not rendered.
- Copy the result with one click into your template, article or code.
Features
- Two-way conversion between raw text and HTML entities.
- Escapes the key characters < > & " ' that break or alter markup.
- Unescapes named and numeric entities back to characters.
- Instant results as you type or paste.
- One-click copy of the output.
- Runs entirely in the browser — your text stays private.
Frequently asked questions
Does escaping happen locally or on a server?
Locally. All conversion runs in your browser, so nothing you paste is uploaded.
Which characters need to be escaped in HTML?
The core ones are < and > (which start and end tags), & (which begins an entity), and quotes " and ' when text goes inside an attribute. Escaping these prevents your text from being misread as markup.
Does escaping HTML protect me from XSS?
Escaping output is an important part of preventing cross-site scripting, but it is not a complete solution on its own. Always escape in the correct context (HTML, attribute, JavaScript, URL) and follow your framework's security guidance.
What is the difference between named and numeric entities?
Named entities like & are human-readable aliases, while numeric entities like & reference a character by its code point. Both decode to the same character, and the unescape mode handles both.