All tools / Formatters

JSON Stringify & Unstringify

Turn JSON into an escaped string, or back again.

Runs in your browser · your data never leaves your device
Ad space

How it works

Stringify minifies your JSON and wraps it in quotes with every inner quote escaped, so you can paste it into code, an environment variable or another JSON field. Unstringify reverses it and pretty-prints the result.

Frequently asked questions

When do I need this?

Typical cases are sending JSON as a string field in an API request, storing it in a config value, or putting it in a test fixture.

Why does Stringify fail?

The input must be valid JSON first. Run it through the JSON Formatter to find the error.

Related tools