JSON Stringify
Stringify JSON online: turn a JSON document into an escaped string you can embed in another JSON value, an env var or a test fixture.
About this result
What It Does
This tool does what JSON.stringify does to a value that is already JSON: it turns the whole document into a single string, escaping every quote and backslash, so it can sit inside another JSON value. The document is minified first, because indentation inside an escaped string is just noise, and you can choose whether to keep the surrounding quotes. Switch direction to turn an escaped string back into a document.
When to Use It
- You need to send a JSON payload as a string field inside another JSON body, such as a webhook that wraps messages.
- You are putting a JSON config into an environment variable or a single-line YAML value.
- You are writing a unit test and need a JSON document as a string literal.
- You want to see exactly what a double-encoded payload will look like on the wire.
Worked Examples
{
"event": "signup",
"user": { "email": "[email protected]" }
}
Becomes "{\"event\":\"signup\",\"user\":{\"email\":\"[email protected]\"}}" — minified, then every quote escaped.
{"path":"C:\\Users\\ada"}
Backslashes are escaped again, so each one becomes two more. This doubling is why Windows paths look so alarming inside nested JSON.
"{\"ok\":true}"
The reverse direction: an escaped string becomes the document {"ok": true}.
Features
How to Use
1. Paste your input into the top box. 2. Adjust the options if the page has any — the result updates as you type. 3. Read the notes under the result, then copy it.
Common Mistakes
- Editing the result by hand and breaking the escaping. If you need to change the content, change the input and run it again — a single stray backslash makes the whole value invalid.
- Assuming the browser preserved Windows line endings. A pasted CRLF becomes LF in any text box, so a byte-exact comparison with the original file can still differ.
- Trusting that two documents are equal because they look equal. Key order, whitespace and number formatting differ between serializers; compare parsed values, not text.
Frequently Asked Questions
Everything runs in your browser. Your JSON is never uploaded, logged or stored.