JSON Formatter and Validator

Format, minify, validate and repair JSON. Errors show the exact line and column, and big numbers stay exact.

How it works

Paste JSON and the tool reads it with a strict parser that follows the JSON standard (RFC 8259). If it is valid you get it back neatly indented, or squeezed onto one line. If not, it tells you the line and column of the first problem and shows the line.

Turn on "Repair common mistakes" to also accept things that look like JSON but are not: comments, trailing commas, single quotes, keys without quotes, and Python True, False and None. The tool lists what it fixed. Numbers are copied as typed, so a long ID like 9007199254740993 is never rounded the way JavaScript would round it.

Worked example

Input: {name: 'Aman', marks: [78, 91,],}

Strict mode says: line 1, column 2, a key must be in double quotes.

With repair on you get {"name": "Aman", "marks": [78, 91]} and the list "unquoted keys quoted, single quotes changed to double quotes, trailing commas removed".

Good to know

Common questions

Why does my JSON show an error at the very end?
Usually a bracket or brace was opened and never closed, or there is extra text after the last }. The message says which one.
What is the difference between format, minify and check?
Format adds line breaks and indentation so people can read it. Minify removes all spaces to make it smaller for sending. Check only validates and reports the structure.
Does sorting keys change the meaning?
No. Order of keys in an object has no meaning in JSON, but arrays keep their order.
Can it handle big files?
Yes, files of several MB work on most phones and laptops. Use Open a file to load one.

More in Data.