JSON Formatter
Paste JSON, format or minify it, and find out precisely which line and column broke it.
- Input
- Output
- Minified estimate
Input
Syntax colouring is off for this document because recolouring something this large on every keystroke would slow typing down. Every tool still works normally.
Output
Syntax colouring is off for this document because recolouring something this large on every keystroke would slow typing down. Every tool still works normally.
The result appears here.
Warnings
Runs entirely in your browser. Nothing you paste is uploaded, and you can confirm that in your browser Network tab.
About this tool
Formatting and minifying here work on the token stream rather than parsing your document into a JavaScript value and printing it back out. That round trip quietly corrupts two things: integers longer than about sixteen digits lose precision, and keys that look like numbers get reordered. Several widely used online formatters ship both bugs. Your document comes back byte for byte as you wrote it, with only the whitespace changed.
How to use
- Paste your JSON into the input pane, or load the sample.
- Choose an indent width, then press Format. Press Minify instead to strip every optional byte.
- Copy the result or download it as a file. If the document is invalid, the failing line is marked in the gutter.