JSON Formatter & Validator
Format, minify, and validate JSON in your browser. Errors show the exact line and column; numbers and escapes stay exactly as written. Nothing is uploaded.
Paste JSON to validate it.
You can also drop a .json file on the input.
Examples
The tool checks the input as you type. When the JSON is valid, the output panel shows it formatted or minified. When it is not, the message names the first problem with its line and column; "Go to error in input" places the cursor there. Only the first error is reported, because later errors usually depend on how the first one is fixed.
Common mistakes
Trailing comma
Invalid: {"a": 1, "b": 2,}Valid: {"a": 1, "b": 2}Single quotes
Invalid: {'name': 'Ada'}Valid: {"name": "Ada"}Unquoted key
Invalid: {name: "Ada"}Valid: {"name": "Ada"}Comment
Invalid: {"a": 1 // count }Valid: {"a": 1}Missing comma
Invalid: [1 2]Valid: [1, 2]Non-standard value
Invalid: {"ratio": NaN}Valid: {"ratio": null}
Pretty-printing JSON in code
JavaScript:
JSON.stringify(JSON.parse(text), null, 2)
Python:
python -m json.tool --indent 2 data.json
Both parse the text into values first, so large integers, number spelling such as1.0, and escapes such as \u00e9 may change. This tool rewrites only whitespace.
FAQ
- Does formatting change my data?
- No. Only whitespace changes. Numbers keep their exact text (
1.0stays1.0, long integers keep every digit), escapes stay as written, and key order and duplicate keys are preserved. - Why do I see a warning on valid JSON?
- Warnings flag content that is valid but may be read differently elsewhere: keys repeated in one object, and numbers that a typical parser stores as a 64-bit float would round, such as integers above 253. Warnings never block copying or downloading.
- Does it accept JSON5, JSONC, or comments?
- No. It validates standard JSON (RFC 8259). Comments, trailing commas, and single quotes are reported as errors.
- Does it validate against a JSON Schema?
- No. It checks syntax only.
- Is there a size limit?
- Yes, 10 MB. Larger input is refused with a message; it is never truncated. Large output shows a preview; Copy and Download include all of it.
- Is my JSON sent anywhere?
- No. Formatting and validation run in your browser; the input is not uploaded or stored.