JSON Formatter & Validator
Paste JSON to format, validate, and minify it instantly. No uploads, no signup, no network calls.
Input
Output
What is JSON?
JSON (JavaScript Object Notation) is a text format for structuring data as key-value pairs, arrays, and nested objects. It's the default format for most web APIs, config files, and data exchange between services because it's lightweight and easy for both humans and machines to read.
Unlike a JavaScript object literal, JSON is stricter: every key and string value must use double quotes, and it can only contain strings, numbers, booleans, null, arrays, and objects — no functions, no comments, no trailing commas.
Common JSON errors
Trailing comma
{"a": 1, "b": 2,}Remove the comma before the closing } or ].
Single quotes
{'a': 1}JSON requires double quotes for both keys and string values.
Unquoted keys
{a: 1}Wrap every key in double quotes: {"a": 1}.
Missing comma
{"a": 1 "b": 2}Add a comma between each key-value pair.
Comments
{"a": 1} // noteJSON has no comment syntax. Remove // and /* */ comments entirely.
FAQ
Is my JSON uploaded anywhere?
No. Everything stays in your browser.
Does this validate JSON syntax?
Yes, with the exact parser error if something's wrong.
What's the difference between JSON and a JavaScript object?
JSON needs double-quoted keys and strings, and can't hold functions, undefined, or comments.
Can I format large JSON files?
Yes, though very large files may take a moment longer since parsing runs in your browser.
What causes "Unexpected token" errors?
Usually a trailing comma, single quotes, an unquoted key, or a missing comma — see common errors above.
Is this the same as JSON.stringify?
It uses the same browser JSON.parse/stringify, plus readable errors and one-click copy.
Quick tips
- Use 2-space indent for compact diffs.
- Minify before pasting into config files.
- Trailing commas and comments aren't valid JSON.