Text Escape/Unescape

Escape or unescape special characters for JSON, JavaScript, HTML, URL and other formats.

Original Text
Escaped Text

What is Text Escaping?

Text escaping is the process of converting special characters into a safe format so they can be used within specific contexts without causing errors. In programming, characters like quotes, backslashes, and angle brackets have special meaning. If these characters appear in string data without proper escaping, they can break code parsing, corrupt data structures, or even create security vulnerabilities. Whether you are building JSON APIs, rendering HTML content, writing JavaScript strings, or constructing URL parameters, text escaping is an essential technique for reliable data handling.

How It Works

The text escape tool applies different escaping rules depending on the target context. For HTML, it converts <, >, &, " to entities. For JSON, it converts ", \, and control characters to backslash sequences. For URLs, it converts reserved characters to %XX percent-encoding. It works by iterating through each character and matching against the escape table for the selected context.

Tools That Pair Well

Further Reading