JSON Escape / Unescape

How to escape and unescape JSON strings

Use Escape to turn any text into a string you can paste into JSON. Use Unescape to turn an escaped JSON string back into readable text. Swap moves the result back into the input so you can check the round trip.

FAQ

What does escaping JSON do?

It turns text into a valid JSON string value: quotes become \", backslashes become \\, and line breaks and tabs become \n and \t.

How do I unescape a JSON string?

Choose Unescape and paste the string, with or without its surrounding quotes. Escape sequences such as \n, \" and \u00e9 are turned back into the characters they represent.

Why do I get an invalid escape error?

JSON only allows these escapes: \", \\, \/, \b, \f, \n, \r, \t and \u followed by four hex digits. Anything else, such as \x or a lone backslash, is invalid.