How to use the JSON formatter
Paste your JSON into the input box. If it's valid, the formatted result appears instantly below — choose pretty-printing with your preferred indentation, or minify it to a single compact line for embedding and transport. If it's invalid, the exact line and column of the first problem is shown above the input, with a caret pointing at the offending spot.
What the Repair button fixes
A lot of "broken" JSON is actually valid JavaScript, a Python dict, or a config file with comments. When validation fails, the Repair button rewrites the classic mistakes for you — and it's careful to leave the contents of your strings untouched:
- Single-quoted strings — 'like this' becomes "like this".
- Unquoted keys — {name: 1} becomes {"name": 1}.
- Trailing commas — [1, 2, 3,] becomes [1, 2, 3].
- Comments — // and /* */ blocks are stripped.
- Python and JS literals — True, False, None, NaN and undefined become their JSON equivalents.
Pretty vs minified
Pretty-printed JSON is for humans: indentation shows structure, diffs are readable, code review is sane. Minified JSON is for machines: no whitespace means smaller payloads and faster parsing. The same data round-trips between the two losslessly — the only thing that changes is whitespace. Sorting keys alphabetically is handy before diffing two documents, since it makes key order irrelevant.
Frequently asked questions
Is my JSON uploaded anywhere?
No. Parsing, validation, repair and formatting all run in your browser. Nothing you paste is stored, logged, or transmitted — safe for config files and API responses alike.
Why couldn't Repair fix my input?
Repair handles the common almost-JSON patterns: quotes, keys, commas, comments, and Python-style literals. It can't reconstruct genuinely missing structure — an unclosed brace or a truncated file needs a human. The error pointer shows where parsing stopped, which is usually right next to the problem.
What do the Keys and Depth numbers mean?
Keys is the total number of object properties across the whole document; Depth is the deepest level of nesting. Together they give a quick feel for how large and how complicated a payload really is.