JSON Stringify Online
Stringify JSON — wrap in JSON.stringify.
Loading…
About JSON Stringify Online
Some APIs expect a JSON document to arrive as a string inside another JSON document, with every quote escaped. Paste the JSON and this page checks it, strips the formatting and returns a single double-quoted string literal, so {"a":1} becomes "{\"a\":1}". It does what JSON.stringify does to the compact text of the document, and long integers such as 12345678901234567890 keep every digit.
Features
- Returns one quoted string literal ready to paste into another JSON value
- Validates and compacts the input before quoting it
- Quotes and backslashes inside the document are escaped for you
- Keeps long integers and numbers such as 1.10 exactly as written
- Points plain text to the JSON Escape tool
Limitations
- The input must be valid JSON: plain text or a JavaScript object with unquoted keys is rejected rather than escaped.
- The document is compacted first, so the original indentation is not preserved inside the string.
- Downloading the result needs a free account; copying it does not.
How it works
- Paste a valid JSON document into the JSON Input panel.
- Read the Stringified panel, which updates as you type and shows the document as one quoted string with escaped quotes and backslashes.
- If an error appears, check that the input really is JSON; plain text belongs in the JSON Escape tool.
- Select Copy Output to copy the string, or Download to save it as output.txt.
Example input
{"user":"auro","active":true}Frequently asked questions
- Paste the payload here, copy the quoted result and use it as the field's value, so the outer document reads {"payload": "{\"a\":1}"}. The quotes and backslashes inside are already escaped.
- Paste the quoted string into the JSON Escape tool and choose Unescape. It accepts the surrounding quotes and returns the compact JSON text, which you can then indent with the JSON Formatter.
- This page expects valid JSON, compacts it and returns the string with its outer quotes. JSON Escape accepts any text and returns only the escaped characters, without outer quotes and without checking that the text is JSON.
- The input is not valid JSON, which includes plain sentences such as say "hi" and object literals with unquoted keys. The message adds a pointer to the JSON Escape tool for ordinary text.
