JSON formatter and validator
Format, minify and validate JSON with a specific error location on failure.
How it works
- Paste your JSON.
- Choose Format or Minify. Invalid JSON is reported with its line and column as soon as you paste it.
- Copy the result or download it.
What the check finds and what it does not
The tool checks that your text is valid JSON syntax, then pretty-prints it with 2 or 4 spaces, or minifies it. That covers the jobs people search for as JSON formatter, beautifier, pretty print, validator, lint and minifier: they are the same operation on the same text.
It does not check your data against a JSON Schema, and it does not convert JSON to CSV. Neither is available yet.
A worked example with a real error
This synthetic order has a trailing comma after the last property, which JSON does not allow:
{
"order": "A-1001",
"items": ["pen", "notebook"],
"paid": true,
}In browsers that report a position, the tool points at line 5, column 1: the closing brace, where the parser expected another property name after the comma.
Delete the comma and the same text formats cleanly. If the input is invalid, no formatted output is produced, so the tool never guesses what you meant.
Things that can change when you format valid JSON
- Whole numbers larger than 9,007,199,254,740,991 lose their exact digits, because the browser holds numbers as 64-bit floats. The tool warns when it sees one. Keep such IDs as strings.
- If an object repeats a key, only the last value is kept. The tool warns about this too.
- Number spelling can change while the value stays the same: 1.0 becomes 1 and 1e3 becomes 1000.
- JSON with comments or single quotes is not valid JSON and is rejected with a position.
Frequently asked questions
- Is my JSON uploaded?
- No. It is processed in your browser.
- Does it validate against a JSON Schema?
- No. It checks JSON syntax only.
- Can it convert JSON to CSV?
- Not yet. This tool formats and validates JSON only.
- Why does it show a different error from another validator?
- The wording and exact position come from your browser's JSON parser, and browsers differ. The line and column shown point to where the parser gave up, which can be just after the real mistake.