Paste JSON and convert it into an escaped string literal ready to embed in code — or unescape a stringified string back into readable JSON. Validated as it converts, entirely in your browser.
No installation, no signup. Results in milliseconds.
Stringifying JSON means turning a JSON value into a JSON string — every quote, backslash, and newline is escaped so the whole structure becomes one string you can safely embed inside source code, store in a database column, or nest inside another JSON document. It is the same operation as JavaScript's JSON.stringify() applied to a string.
Stringify escapes JSON into a string; parsing does the reverse. This tool includes both — use Stringify to escape and Unescape to turn a stringified value back into clean JSON.
This tool mirrors JavaScript’s built-in JSON.stringify(value, replacer, space). Understanding its arguments explains exactly what the output will be.
| Argument | What it does |
|---|---|
value | The data to convert into a JSON string. |
replacer | An optional function or array of keys to filter or transform which properties are included. |
space | Indentation: a number of spaces or a string. Omit it for compact output, pass 2 for pretty output — the “Minify first” toggle here controls this. |
Stringify is not lossless for every JavaScript value — some are silently omitted or changed, which surprises people debugging missing fields:
| Value | Result |
|---|---|
undefined, functions, symbols | Dropped from objects; become null in arrays |
NaN, Infinity | Serialized as null |
Date | Converted to an ISO string via its toJSON() |
BigInt | Throws a TypeError |
Stringify turns data into an escaped JSON string; parsing does the reverse. Use the Unescape button here, or the JSON Parser, to turn a stringified value back into readable JSON. For character-level escaping of arbitrary text, use JSON Escape; to encode data as a string literal for code, see JSON Encode. Once you have clean JSON back, the JSON Formatter and Viewer help you read it.
See exactly what stringify escapes and why the output is wrapped in quotes.
Stringify wraps the whole value in quotes and escapes every character that would otherwise break a string literal: double quotes become \", backslashes become \\, and newlines become \n. The result is a single string you can paste inside source code, a database column, or a field of another JSON document without it falling apart.
Turn the wrapping quotes on or off depending on where the value lands — on when you need a complete literal, off when your editor already supplies the surrounding quotes. To reverse the process, use Unescape here or parse it with the JSON parser. To simply beautify JSON instead of escaping it, use the JSON formatter.
Escaping JSON into a string comes up all over real codebases.
Everything developers ask about stringifying JSON.
Hands-on articles from our blog.
All free, all browser-based, no signup required.