How to format and validate JSON
Paste text, load a local file, drop a file, or choose a sample. Select Validate JSON to check syntax, Format to add readable indentation, or Minify to remove insignificant whitespace. Valid input can also be inspected in the searchable Tree tab.
Validation reads every token against strict JSON grammar. If it finds an error, it reports a consistent diagnosis, exact line and column, selects the offending range, and suggests a safe next step. Repair Preview recognizes only carefully scoped JSON-like features and never changes input until you select Fix JSON.
Pretty print versus minify
Pretty printing makes nested objects and arrays easier to review. Minifying is useful for transfer or compact storage. Both modes preserve number spellings—including large integers—and duplicate keys instead of round-tripping through JavaScript’s Number and object types.
Minified input
{"name":"Ada","active":true}Formatted output
{
"name": "Ada",
"active": true
}Invalid input
{"name": "Ada",}Trailing comma before } at line 1, column 15.
Common JSON syntax errors
Frequent problems include single quotes, unquoted object keys, comments, trailing commas, missing commas or colons, mismatched closing brackets, invalid escapes or numbers, uppercase True/False/Null, and multiple root values. The repair preview can safely propose changes for comments, single-quoted strings, unquoted keys, and trailing commas; other errors need a manual decision.
When to sort object keys
Sorting keys can make configuration files and source-control diffs deterministic. It does not sort arrays. Object member order is not semantically significant in JSON, but some consuming systems display or process insertion order, so sort only when that change is appropriate.
