JSON (JavaScript Object Notation) is the dominant data format for web APIs, configuration files, and data exchange between services. Keeping it readable is straightforward when you know the right tools.
What this tool does
Format parses your JSON and re-serialises it with consistent indentation. Choose 2 spaces for JavaScript convention, 4 spaces for Python convention, or a tab character for projects that use tab-indented code.
Minify parses your JSON and re-serialises it without any whitespace outside string values. The result is the smallest valid JSON representation of the same data — useful before embedding JSON in a request body or URL parameter.
Validate parses your JSON and reports whether it is syntactically valid. If valid, it summarises the top-level type and size (for example, “object with 5 keys” or “array with 12 items”). If invalid, it reports the error message and the line and column where parsing failed.
Example:
Input (minified):
{"user":{"name":"Alice","roles":["admin","editor"],"active":true}}
Format with 2-space indent:
{
"user": {
"name": "Alice",
"roles": [
"admin",
"editor"
],
"active": true
}
}
Validate result: “Valid JSON — object with 1 key”
Common JSON syntax errors
Trailing comma — {"a": 1,} is not valid JSON. Remove the comma after the last value in any object or array.
Single quotes — JSON requires double quotes for all strings and keys. {'a': 1} is JavaScript object literal syntax, not JSON.
Unquoted keys — {a: 1} is not valid JSON. Every key must be a quoted string: {"a": 1}.
Comments — JSON has no comment syntax. Remove // ... or /* ... */ before parsing.
JavaScript primitives — undefined, NaN, and Infinity are not valid JSON values. Replace them with null or a numeric equivalent.
Unescaped control characters — literal tab, newline, or carriage return inside a string must be escaped as \t, \n, or \r.
When line and column numbers are approximate
JSON.parse error messages in V8 (Node.js, Chrome) report a character offset from the start of the string. This tool converts that offset to a line and column by counting newlines before it. The result is exact when the error position is reported by V8, but some errors — particularly those on the very first character — may show null for line and column if no position is included in the error message.
Once the JSON parses cleanly, the JSONPath tester lets you pluck out specific values; for round-tripping to YAML or CSV, the YAML ↔ JSON converter and JSON ↔ CSV converter are the adjacent tools.