The JSON Formatter, Validator, and Minifier gives you instant control over JSON data. Paste any JSON to pretty-print it with consistent indentation, validate its syntax and highlight errors with line numbers, or minify it by removing all unnecessary whitespace for production use.
JSON formatting is essential for reading API responses, debugging data structures, reviewing configuration files, and working with database exports. Minifying JSON reduces file size for transmission and storage.
The validator catches all JSON syntax errors: missing commas, trailing commas, unquoted keys, single-quoted strings, mismatched brackets, and invalid escape sequences — and shows the line and character position of each error.
Everything runs in your browser. Your data never leaves your device.
Paste your JSON into the input.
Click Format to pretty-print with indentation, or Minify to remove all whitespace.
Syntax errors are highlighted with the exact line and column number.
Copy the formatted or minified result.
These tools solve different problems in a JSON workflow. The JSON Formatter reformats and validates a single JSON document — checking it's syntactically well-formed and making it readable or compact — but it doesn't describe what a valid document should look like.
The JSON Schema Generator instead produces a schema describing the expected structure, types, and required fields of your JSON, which you can use to validate other documents against that shape. Format your JSON first to check it's valid, then generate a schema from it if you need to validate future documents against the same structure.
2 spaces by default. Toggle to 4 spaces or tabs using the indentation selector.
Missing commas, trailing commas (not allowed in standard JSON), unquoted keys, single-quoted strings, mismatched brackets and braces, invalid escape sequences, and malformed numbers.
Standard JSON (RFC 8259) does not allow comments. If your JSON has // or /* */ comments, you have JSONC (JSON with Comments), which is used in some config files like tsconfig.json.
JSONC allows // single-line and /* */ multi-line comments. Standard JSON parsers reject JSONC. Some tools (VSCode, tsconfig) support JSONC specifically.
Minified JSON removes all whitespace, reducing file size for network transmission and storage. For a large JSON file, minification can reduce size by 20–50%.
Yes — enable the Sort Keys option to alphabetically sort all keys in all objects throughout the JSON tree.
The validator identifies exactly where the trailing comma is with a line and column number; removing it and reformatting is a manual step, but the formatter's own output never includes trailing commas.
Yes — paste the raw response body and click Format to get properly indented, readable JSON, which is often much easier to review than the browser's default single-line display.
No, unless you enable Sort Keys. By default, keys keep their original order from the input; Sort Keys reorders them alphabetically at every level of the JSON tree.