HTML Escape and Unescape
Escape text into HTML entities or unescape entities back into plain characters. Handles the reserved characters and numeric references in both directions.
Calculator by Toolsloft ↗Escape text so it is safe to drop into HTML, or unescape HTML entities back into plain characters. Escaping turns characters like the angle brackets, ampersand, and quotes into their entity codes so a browser shows them as text instead of markup. Unescaping does the reverse, including numeric entities.
How this is calculated
Escaping replaces the five reserved characters (&, <, >, double quote, and apostrophe) with their standard HTML references, replacing the ampersand first to avoid double escaping. Unescaping decodes numeric references first, then the named ones, resolving the ampersand last so nested entities decode correctly. This follows the HTML character-reference standard.
How to use
- Choose escape to encode text for HTML, or unescape to decode entities.
- Paste your text or HTML into the input box.
- Copy the converted result.
Examples
- Escape:
<b> to <b> - Ampersand:
a & b to a & b - Unescape:
<p> to <p>
FAQ
- Which characters get escaped?
- The five that have special meaning in HTML: the ampersand becomes &, the less-than sign becomes <, the greater-than sign becomes >, the double quote becomes ", and the apostrophe becomes '.
- Does unescape handle numeric entities?
- Yes. It decodes both decimal references like ' and hexadecimal references like ☺, as well as the named entities, so mixed content converts back to plain text.