JSON Escape / Unescape

Escape text into a JSON string literal, or unescape one back to raw text.

Frequently asked questions

What does it mean to escape a JSON string?

Escaping converts raw text into a form that can sit safely inside a JSON string literal, adding backslashes before characters like double quotes, backslashes and newlines. This lets you embed arbitrary text as a JSON value without breaking the syntax.

What is the difference between escaping and unescaping?

Escaping turns raw text into an escaped JSON string, while unescaping does the reverse, decoding the backslash sequences back into the original characters. This tool does both directions.

Which characters get escaped in JSON?

Double quotes, backslashes and control characters such as newline, carriage return and tab are escaped with a backslash sequence. Other printable characters are usually left as is.

Why does my text have backslashes after escaping?

Those backslashes are the escape markers that make special characters safe inside a JSON string. When the JSON is parsed, each escape sequence is turned back into the single character it represents.

Is my text sent to a server?

No. The escaping and unescaping run entirely in your browser, so your text is never uploaded. This keeps sensitive strings private.

Does escaping add the surrounding quotes?

Escaping prepares the inner content of a JSON string; whether the wrapping double quotes are included depends on how you use the output. You add or keep the outer quotes when placing the value into your JSON.

Can I use this to fix a broken JSON string with special characters?

Yes. If raw text with quotes or line breaks is breaking your JSON, escaping it first produces a valid string literal you can drop straight into the document.