About JSON Formatter / Validator
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.
How to Use JSON Formatter / Validator
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.
Examples
Frequently Asked Questions
What indentation size does it use?
2 spaces by default. Toggle to 4 spaces or tabs using the indentation selector.
What JSON errors does the validator catch?
Missing commas, trailing commas (not allowed in standard JSON), unquoted keys, single-quoted strings, mismatched brackets and braces, invalid escape sequences, and malformed numbers.
Does JSON allow comments?
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.
What is the difference between JSON and JSONC?
JSONC allows // single-line and /* */ multi-line comments. Standard JSON parsers reject JSONC. Some tools (VSCode, tsconfig) support JSONC specifically.
Why minify JSON?
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%.
Can I sort JSON keys alphabetically?
Yes — enable the Sort Keys option to alphabetically sort all keys in all objects throughout the JSON tree.