data
JSON formatter
Pretty-print, minify, and validate JSON without sending it anywhere.
Runs 100% in your browser. Nothing you paste is uploaded, stored, or sent to a server.
How to use
- Paste JSON into the editor. Trailing commas and single quotes will fail, just as they do in JSON.parse.
- Click Format to indent with two spaces, Minify to strip whitespace, or Validate to check without rewriting.
- If the input is invalid, the native parser message is shown so you can jump to the unexpected token.
- Copy the result. Use Minify before embedding JSON in a log line or an environment variable.
JSON is the lingua franca of APIs, and it is unforgiving. One trailing comma from a JavaScript object literal, or a smart quote from an email client, and JSON.parse throws. This formatter uses the same parser as your browser so “valid here” means “valid in Node, Deno, and every modern runtime.”
Because formatting is local, you can drop in a production webhook body, an ID token payload, or a customer export without opening a pastebin. That is the whole product: a trustworthy place to tidy data you should not upload.
Examples
Pretty print
{"ok":true,"items":[1,2]} becomes a multi-line document with indented keys. Key order is preserved.
Minify
The same document collapses to {"ok":true,"items":[1,2]}, which is what you want for a compact log field.
Broken input
{ok: true} is a JavaScript object, not JSON. Keys must be double-quoted. The validator will say so.
What counts as valid JSON
JSON is not JavaScript. Comments, undefined, NaN, trailing commas, and single-quoted strings are all illegal. Dates are just strings. Big integers beyond Number.MAX_SAFE_INTEGER will parse as IEEE numbers and can lose precision — if you care about 64-bit IDs, keep them quoted.
Format and minify both go through JSON.parse and JSON.stringify. That means escapes are normalized, and duplicate keys collapse to the last value, matching typical engines. It is a formatter, not a lossless pretty-printer for non-standard JSON5.
Need YAML or CSV instead? Use the JSON converter tool on this site. It shares the same local-only parser.
FAQ
Do you support JSON5 or JSONC?
No. Comments and trailing commas would make the output lie about what JSON.parse accepts. Keep this tool strict so it matches production parsers.
Will formatting reorder my keys?
JSON.stringify keeps insertion order, which modern engines preserve from JSON.parse. You should see the same key order you pasted.
Is large JSON OK?
A few megabytes is fine. Extremely large documents can freeze the tab because the whole string lives in memory — that is a browser limit, not a server timeout.
Is the JSON uploaded?
No. Parse, stringify, and copy all stay in the page.