HTML Escaper and Unescaper
Escapes the five characters that matter for safe HTML, and decodes entities back the other way.
Loading the tool…
How to use this tool
- Paste the text you want to place safely into a page, or the escaped HTML you want to read.
- Select Escape or Unescape.
- Use the result for documentation and inspection. In an application, let the template engine escape output automatically rather than doing it by hand.
What html escaper does
Five characters need escaping before text can be dropped into a page: the ampersand, the two angle brackets, and both kinds of quote. The angle brackets are the famous ones, because they let text become a tag. The quotes matter just as much and are the ones people forget, because text placed inside an attribute can escape that attribute with a quote alone and never need a bracket at all.
This is a tool for inspecting and preparing content, not a security control. The right place to escape output is in the template engine that renders it, automatically, on every value. Escaping by hand in a utility and pasting the result is fine for a snippet of documentation and is not a substitute for output encoding in the application itself.