How this calculator works
- Step 1Read every characterRFC 8259A strict parser follows the JSON grammar, one character at a time.
- Step 2Stop at the first problemLine and columnIt reports exactly where the text stops being valid JSON.
- Step 3Rewrite the valueFormat or minifyValid JSON is printed again with your chosen spacing.
JSON is a text format for data: objects in braces, arrays in brackets, strings in double quotes, numbers, true, false and null. The check runs in your browser, so nothing is uploaded.
Worked example: finding a trailing comma
A comma after the last item is a common mistake. Here it is found at line 3, column 29.
- Text checked
{ "name": "WebTools", "tools": ["JSON", "Base64",] }
- Line 1: an object opens{
- Line 2: key "name" and a string valuevalid
- Line 3: key "tools" and an arraytwo strings
- Next character after the last comma]
- ResultLine 3, column 29: trailing comma
Remove that comma and the document is valid. Many editors and JavaScript allow trailing commas, but JSON does not.
Reading the result
- FormatReadableOne value per line with indentation, for reviewing and debugging.
- MinifyCompactNo spare spaces or line breaks, for sending or storing.
The summary counts keys and nesting depth. The sample on first load has 4 keys and a depth of 3. Duplicate keys are flagged, because most parsers silently keep only the last one.
- GrammarBrackets, commas, colons and quotes in the right places.
- StringsDouble quotes, valid escapes and no raw tabs or line breaks.
- NumbersNo leading zeros, no trailing dots, no NaN or Infinity.
- Duplicate keysFlagged as a warning, since the JSON standard advises unique names.
Related data tools
JSON is often the end of a data pipeline. Other tools convert, compare and decode it.
To turn a spreadsheet export into JSON, use the CSV to JSON converter. The diff checker compares two versions, and the JWT decoder reads the JSON inside a token.
Common mistakes
Mistake: Using single quotes around keys or strings.
Instead: JSON needs double quotes everywhere.
Mistake: Leaving a comma after the last item.
Instead: Remove it; JSON does not allow trailing commas.
Mistake: Adding comments to explain a value.
Instead: JSON has no comments; put notes in a separate field or file.
Mistake: Pasting live API keys or passwords into online tools.
Instead: Replace secrets with placeholders before you paste.
Read how we test our calculators, or browse more developer tools.