Escape ↔ unescape HTML entities
Runs locally in your browser with instant copy

This tool converts between two representations of the same text: raw characters (like ) and HTML entities (like ). It helps you safely display text that might contain HTML, and it helps you decode entity-encoded content back to readable form.
Use Escape when you want to show text literally (for example in docs or previews). Use Unescape when you receive entity-encoded text (from logs, CMS exports, or API responses) and want to read or edit it.
Who is this for?
Related tools that pair well:URL Encoder/Decoder for safe transport of special characters in URLs, andText to Unicode when you need numeric character references.
What does it escape?
This tool focuses on the most common HTML-sensitive characters:\texttt{&}, , ,, and \texttt{\'}.
Example 1: escape a title tag
Suppose you want to show the literal text of an HTML tag in documentation.
The output is safe to display inside HTML because the browser will render the characters instead of interpreting them as tags.
Example 2: unescape a snippet you received
If a CMS or API returns entity-encoded text, unescape it so you can read and edit it.
After unescaping, the ampersand becomes a normal character again.
Safe preview of user input
You want to show a preview of a user-supplied string without it turning into real HTML.
Escape the input before rendering it in an HTML context.
Debugging encoded logs
Some logs or error messages include entities, especially when they pass through an HTML layer.
Unescape to see the exact characters that caused the bug.
Copying snippets into docs
You are writing documentation where you need tags to appear as plain text.
Escape, then paste into your doc/knowledge base.
If you need to generate HTML from text, try Markdown to HTML after you finish preparing your content.
Cleaning CMS exports
Your CMS export contains entities and you need the raw text back for editing.
Unescape first, then if you will put it back into HTML, escape again at render time.
Rendering untrusted text
Escape before rendering if the text might contain tags or HTML-looking characters.
Preparing docs snippets
Escape tags so they show up as text in a wiki, ticket, or markdown preview.
Investigating weird output
Unescape to see the actual characters that were hidden behind entities.
Comparing two versions
Escape both strings to compare safely in tools that render HTML.
Cleaning up exports
Unescape text copied from CMS exports, then re-escape at the final render step.
Quick sanity-check
Spot whether a string contains real tags or literal angle brackets.
When it might not be the right tool: if you need to decode a wide set of named entities (beyond the common ones) or handle full HTML parsing. This tool targets a practical subset for everyday work.
Escape at the boundary
A reliable habit is to escape right before you render untrusted text into HTML. That keeps your stored data clean and your rendering safe.
Avoid double-decoding
If you unescape you should get, not . That prevents surprising behavior when content is encoded multiple times.
Know what this tool covers
This tool covers a practical subset of entities. If your input contains many named entities, consider using a more specialized HTML entity library.
If you are preparing links, combine this with URL Encoder/Decoder to avoid breaking query strings.
Think of escaping as a deterministic replacement function. For a string , the escaped output is:
Unescaping does the reverse replacement, but only for the specific entities this tool supports.
Variables and mapping
What is an HTML entity?
An HTML entity is a text sequence that represents a character. For example, is a way to represent inside HTML.
Escaping vs sanitizing
Escaping is about representation (show the text literally). Sanitizing is about removing or rewriting unsafe HTML. This tool escapes characters; it does not parse and sanitize HTML.
If you work with query strings, you may also want URL Encoder/Decoder because URL encoding and HTML entity escaping solve different problems.
Escaping is a strong baseline for safely rendering text in HTML, but XSS prevention depends on context (HTML, attributes, URLs, scripts). Use context-aware escaping and your framework’s recommended patterns.
Because it is double-encoded. One unescape step should produce , not. This avoids decoding more than you intended.
No. It focuses on the most common characters that frequently break markup.
For numeric entities like , use Text to Unicode.
Usually you store raw text and escape at render time. That keeps your data clean and avoids double-encoding.
If you need HTML parsing or sanitization, use a dedicated HTML parser/sanitizer. This tool is for string-level escaping/unescaping.
This tool is designed for everyday developer workflows. It does not parse HTML, sanitize markup, or guarantee security in every execution context.
Not a substitute for security review
For security-sensitive use (XSS defense, sanitizing user-generated HTML), follow your framework and security team guidelines.
Use a simple chronometer (stopwatch) to track elapsed time down to milliseconds. Runs locally in your browser.
Normalize email addresses to a standard format for easier comparison. Useful for deduplication and data cleaning. Runs locally in your browser.
Estimate the time needed to consume a total amount at a constant rate, and get an expected end time. Runs locally in your browser.
Parse and decode your JSON Web Token (JWT) and display its content. All computation runs locally in your browser.
Know which file extensions are associated to a MIME type, and which MIME type is associated to a file extension. Includes a full MIME types table.
Generate random Lorem Ipsum placeholder text with customizable paragraphs, sentences, and word counts. Runs locally in your browser.