JSON Validator & Formatter
Paste or upload JSON to validate syntax, format with proper indentation, or minify for production. Errors are highlighted with exact line numbers. All processing happens in your browser.
What is JSON?
JSON (JavaScript Object Notation) is a lightweight data interchange format that is easy for humans to read and write, and easy for machines to parse and generate. It is the most common format for REST API responses, configuration files, and data exchange between web services.
Valid JSON must follow strict syntax rules: strings must use double quotes, no trailing commas are allowed, keys must be strings, and the document must contain a single root value (object, array, string, number, boolean, or null).
Learn more about JSON formatHow to Use This Tool
- 1Paste your JSON data into the editor, or click "Load Sample" to try with example data.
- 2Click "Validate" to check syntax. Errors will show the exact line and character position.
- 3Use "Format" to pretty-print with 2-space indentation, or "Minify" to compact the output.
- 4Copy the result to your clipboard with one click, or upload a .json file directly.
Common JSON Errors
Trailing comma
{"a": 1, "b": 2,}Remove the comma after the last value
Single quotes
{'key': 'value'}Use double quotes for strings
Unquoted keys
{key: "value"}Wrap keys in double quotes
Missing comma
{"a": 1 "b": 2}Add commas between key-value pairs
Unclosed bracket
{"a": [1, 2, 3}Close all brackets and braces
Comments
{"a": 1 // comment}JSON does not support comments
Download Sample JSON Files
Need sample JSON files for testing? Download free, well-formed JSON examples: