About JSON Formatter
JSON Formatter takes messy or minified JSON and pretty-prints it with consistent 2-space indentation, so it's actually readable. It also validates that your JSON is syntactically correct and points to the exact line and column where it breaks, and can minify JSON back down for production use. Everything runs in your browser — nothing you paste is uploaded, logged, or stored anywhere.
How to use it
- 1
Paste or drop your JSON
Paste JSON into the input pane on the left, or drag a .json file directly onto it.
- 2
Choose an action
Click Format to pretty-print, Minify to compress, or Validate to check syntax without changing anything.
- 3
Copy the result
Click Copy to copy the output pane to your clipboard, or Clear to start over.
What it does
- Pretty-prints JSON with 2-space indentation
- Minifies JSON by stripping all non-essential whitespace
- Validates JSON syntax and reports the exact line and column of the first error
- Highlights broken tokens directly in the editor as you work
FAQ
Why does my JSON show an error even though it looks fine?
The most common causes are a trailing comma after the last item in an object or array (valid in JavaScript object literals, but not in JSON), string values wrapped in single quotes instead of double quotes, or object keys that aren't quoted at all. JSON's syntax is stricter than JavaScript's.
What's the difference between Format, Minify, and Validate?
Format rewrites your JSON with readable 2-space indentation. Minify strips all whitespace to produce the smallest possible output. Validate checks that the syntax is correct without changing the input at all — useful when you just want a yes/no answer.
Does this tool send my data anywhere?
No. Formatting, minifying, and validating all happen locally in your browser using JavaScript's built-in JSON parser. Your JSON is never sent over the network.
Is there a size limit?
There's no artificial limit imposed by the tool, only whatever your browser's memory can hold. Because parsing runs synchronously on the main thread (by design — this keeps the tool instant with no loading spinners for normal-sized input), very large files (tens of megabytes) may briefly freeze the tab while they process.