Skip to content

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

  1. Paste a valid JSON document into the JSON Input panel.
  2. Read the Stringified panel, which updates as you type and shows the document as one quoted string with escaped quotes and backslashes.
  3. If an error appears, check that the input really is JSON; plain text belongs in the JSON Escape tool.
  4. Select Copy Output to copy the string, or Download to save it as output.txt.

Example input

{"user":"auro","active":true}

Frequently asked questions