JSON Escape

Paste valid JSON on the left and get the escaped form on the right — quotes, newlines, backslashes and control characters all become their backslash-escaped forms. The output is safe to paste inside a JSON or JavaScript string literal.

100% Client-Side Instant No uploadYour data never leaves your browser

How to use this tool

Paste valid JSON into the input on the left (it is validated first — escaping garbage in would produce garbage out).

The escaped string appears on the right instantly.

Wrap the output in quotes and drop it into a string literal, config file, test fixture, or code snippet.

Copy with one click. Everything runs locally in your browser.

Frequently asked questions

Which characters get escaped?

Double quotes ("), backslashes (\), newlines (\n), carriage returns (\r), tabs (\t), and other control characters — exactly the set JSON.stringify escapes. The result is valid inside any JSON or JavaScript string.

When do I need to escape JSON?

Common cases: embedding a JSON payload inside another JSON string (webhook bodies, JWT claims), putting JSON in a code snippet or test fixture, or storing JSON in a system that only accepts strings.

Why does the input have to be valid JSON?

The tool validates before escaping so you catch typos early. If your input is not valid JSON you will get the parse error instead of silently escaping broken text.

Does it handle non-ASCII characters?

Yes. Unicode text is left as-is (not \u-escaped), which keeps the output readable. Escape sequences are only added where the JSON spec requires them.

Is my data uploaded anywhere?

No. Escaping is a pure string operation that runs in your browser. Nothing is sent to any server.

Related tools