JSON Formatter & Validator
Paste JSON to check it instantly. Format it to read, minify it to ship, and see exactly where any error is.
Checking…
What the formatter checks
Your JSON is checked with the browser’s own strict parser, the same rules used by APIs and JavaScript. If it is valid, you get a cleanly indented version. If not, you see the line and column of the first problem and, for the most common mistakes, a tip on how to fix it.
The most common JSON errors
- Trailing comma:
{"a": 1,}is invalid. Remove the last comma. - Single quotes:
{'a': 'b'}must be{"a": "b"}. - Unquoted keys:
{a: 1}must be{"a": 1}. - Comments:
// notesare allowed in JavaScript but not in JSON. - Special values:
undefined,NaNandInfinityaren’t valid. Usenullor a string.
Format or minify?
Formatting adds line breaks and indentation so people can read and compare the data. Minifying removes every unneeded space, which makes files smaller for APIs, configs that are loaded often, and embedding in pages. Both contain exactly the same data.
For SEO work
Schema markup is usually written as JSON-LD. Check that it is valid JSON here first, then test it against schema.org rules with the Schema Markup Validator.
How to use the JSON Formatter & Validator
- Paste your JSON or load a .json file.
- Click Format to make it readable, or Minify to make it as small as possible. Errors show their line and column.
- Copy the result or download it as a file.
Frequently asked questions
Why is my JSON invalid?
The most common causes are a trailing comma after the last item, single quotes instead of double quotes, keys without quotes, and comments. JSON allows none of these.
Is my JSON uploaded?
No. Formatting and validation run in your browser, so API keys or private data in your JSON never leave your device.
Does sorting keys change my data?
No. JSON objects have no meaningful key order, so sorting only makes the file easier to read and compare. Array order is never changed.