How to use the JSON formatter
- Paste your JSON into the input box — or click Load sample to try it instantly.
- Click Format / Pretty Print to indent it with 2 spaces, Minify to collapse it to one line, or Validate Only to check syntax without changing anything.
- Copy the result with the Copy button. Valid JSON also shows its size in bytes.
Features
- Format & validate — indents nested objects and arrays for readability.
- Minify — strips all whitespace to produce compact JSON for APIs and storage.
- Precise errors — on invalid JSON you get the message plus the approximate line and column of the problem.
- Syntax highlighting — keys, strings, numbers and literals are color-coded in the output.
- 100% private — parsing runs locally in your browser. Your data is never uploaded.
What is JSON formatting?
JSON (JavaScript Object Notation) is the most common format for exchanging data between applications and APIs. It is often delivered minified — packed onto a single line to save bandwidth. That is great for machines but hard for humans. A JSON formatter pretty-prints the same data with consistent indentation so you can instantly read the structure: which fields are nested inside which object, what array items exist, and where values sit. Formatting never changes the data — only its visual layout — which makes it safe to use on real configs, responses and exports.
Frequently asked questions
Is the JSON I paste uploaded to a server?
No. The tool runs entirely in your browser using JavaScript. Your data is parsed locally on your device and never sent anywhere — you can even disconnect from the internet after the page loads and it still works.
Why does it say "invalid JSON at line … column …"?
JSON is strict about syntax: every key must be double-quoted, strings cannot contain unescaped control characters, and trailing commas are not allowed. When the parser stops, the message points to the approximate location of the problem — often a missing comma, an extra comma, or a stray quote.
What is the difference between "format" and "minify"?
Formatting adds indentation and newlines to make JSON readable. Minifying does the opposite — it removes all insignificant whitespace to produce the shortest valid representation, which is how JSON is usually transmitted over HTTP.
Can it handle very large JSON files?
Because everything happens locally, size is limited mainly by your browser's memory. For files up to a few megabytes it is instant; for extremely large exports you may prefer a command-line tool like jq. We recommend pasting in chunks if a paste feels slow.
Does it accept JSON with comments or single quotes?
No — only strict JSON per the specification. Files with comments or single-quoted keys (common in some config files) are technically not JSON; try a YAML tool or remove the comments first.