Web Analytics
Skip to content
← All tools

JSON Escape / Unescape

Escape a string into a safe JSON value, or unescape it back, instantly.

Runs 100% in your browser — nothing is uploaded.

About JSON escaping and unescaping

Putting a string inside JSON sounds trivial until the string contains a quote, a backslash, or a newline. Those characters have special meaning inside a JSON value, so they have to be escaped: a double quote becomes \", a backslash becomes \\, a tab becomes \t, and so on. Miss one and the JSON is invalid; add one too many and the data comes out wrong.

This tool does both directions. Escape takes any text and turns it into a value that’s safe to drop inside a JSON document. Unescape takes an escaped string and gives you back the original text. It all happens locally in your browser using the same JSON engine your code uses, so the result matches exactly what a real parser would produce. Nothing you paste is ever sent anywhere.

When you need to escape

The most common case is embedding one piece of data inside another: a log line inside a JSON payload, an HTML snippet inside a config file, a SQL query inside an API request body, or a multi-line message inside a single JSON field. Anywhere a string has to survive being wrapped in quotes, escaping is what keeps it intact.

By default the result is shown without the surrounding quotes, so you can paste it straight between quotes you’ve already typed. Tick Wrap in double quotes and you get a complete, ready-to-use JSON string value instead.

When you need to unescape

Going the other way is just as common. You’ve copied a string out of a JSON log, an API response, or an error message, and it’s full of \" and \n noise. Unescape turns it back into readable text, with actual line breaks and actual quotes, so you can read it or reuse it. The tool accepts the string with or without its outer quotes, so paste whichever you have.

Escaping is not encoding

Worth remembering: JSON escaping is not Base64, URL encoding, or HTML entity encoding. Those solve different problems. JSON escaping only makes a string safe to sit inside JSON. If your target is a URL or an HTML attribute, you want a different tool.

Our guide to JSON escape characters explains every valid sequence, including quotes, backslashes, control characters, and Unicode escapes.