HTML Escape and Unescape Tool
Escape HTML-sensitive characters for examples, snippets, and safe display, or decode entities back into readable text.
HTML unescape and URL decode are different
HTML unescape changes entities such as <, &, and " back into characters. URL decoding changes percent sequences such as %20. Use the URL Encoder and Decoder for URL or URI components.
This tool does not convert a Word document or TXT file into a structured HTML document, parse a complete webpage, sanitize untrusted markup, or make unsafe HTML safe to execute. It only escapes and unescapes text entities.
How this tool helps
HTML entities are useful when text should appear on a page instead of being interpreted as markup. A code example that contains angle brackets, an ampersand in a company name, or a copied snippet from a CMS can behave differently if the characters are not escaped correctly.
How to use it
- Paste the text that contains characters such as angle brackets, quotes, or ampersands.
- Choose encode when you need text to display safely inside HTML; choose decode when you received entity text and want readable characters.
- Copy the output and test it in the exact template, CMS field, or code block where it will be used.
Practical tips
- Do not encode an entire HTML document if you only meant to display one visible snippet.
- Decode copied text before editing it heavily, because mixed entities and normal characters can hide mistakes.
- When working with attributes, pay attention to quotes because they can break the surrounding markup if left unescaped.
FAQ
What characters are encoded?
The tool handles common HTML-sensitive characters including ampersands, angle brackets, quotes, and apostrophes.
Is this the same as URL encoding?
No. HTML entities are for markup display, while URL encoding is for values inside web addresses.
Can this sanitize unsafe HTML?
No. It escapes text for display, but security-sensitive sanitizing needs a dedicated, context-aware sanitizer.
Related tools
Convert HTML to plain text
To convert HTML to plain text, paste the HTML code into the decoder above, select the decode mode, and copy the output. The tool strips HTML tags, converts entities (like & to &, < to <), removes scripts and styles, and returns clean readable text.
For reverse conversion (text to HTML), paste plain text and use the encode mode to wrap it in paragraph tags with proper entity escaping. This is useful for embedding user-generated content safely in web pages. The encoder handles special characters like &, <, >, quotes, and non-breaking spaces.
HTML escape characters and codes
HTML escape characters are special codes that represent characters with reserved meaning in HTML. The ampersand (&) starts every entity: < for less-than, > for greater-than, & for ampersand, " for double quote, and ' for apostrophe.
Numeric character references use decimal or hexadecimal codes: < or < both render as <. Use the encoder/decoder above to escape or unescape any HTML entity. For URL encoding (percent-encoding), use the URL Encoder/Decoder instead.