All 127 tools

HTML Escape / Unescape

Escape HTML special characters to entities so code displays as text, or unescape entities like & and ₹ back to characters.

Runs in your browser. Nothing you paste is sent anywhere.

Output

About this tool

Escape code before putting it inside a blog post or a <pre> block. Unescape handles named, decimal and hex entities.

Showing code as text with HTML escaping

Browsers treat certain characters as instructions. An angle bracket starts a tag, and an ampersand starts an entity. If you want to show a code example on a web page, in a blog post or inside a documentation tool, those characters must be converted into entities such as &lt; and &amp;, otherwise the browser tries to interpret your example instead of displaying it. Escaping is the step that makes code samples appear exactly as written.

This tool escapes the five characters that matter most in HTML: the less-than and greater-than signs, the ampersand, and both double and single quotation marks. It can also reverse the process, turning named, decimal and hexadecimal entities back into normal characters. That is useful when content copied from a website or an export file is full of codes like &nbsp; or &#8377; that should be readable text again.

Escaping is a core part of keeping websites safe, because it stops user input from being treated as HTML or script. However, it is only one layer of protection. The right method depends on where the text is placed, such as inside an attribute, a script block or a URL, and modern frameworks usually handle this automatically. If you are building a site, rely on your framework's built-in escaping rather than doing it by hand, and use this tool for content preparation, documentation and debugging. Everything runs in your browser, so the code and content you paste here stay on your device. You can also choose to escape every non-English character as a numeric entity, which helps with older systems that mishandle Unicode text.

How to use it

  1. Paste your text into the input box, or open a file from your device.
  2. Adjust the options. The result updates instantly.
  3. Copy the result, or download it as a file where offered.

Questions

Which characters are escaped?

& < > " and ' by default. Turn on 'Escape non-ASCII' to also convert characters such as ₹ and é to numeric entities.

Does escaping prevent XSS?

Escaping text placed between HTML tags is one important defence, but attributes, URLs and scripts need context-specific encoding. Use your framework's built-in escaping.

Last reviewed 16 October 2026.