JSON Formatter & Validator

Paste JSON to format it nicely, minify it, or find exactly where it's broken. Errors point to the line and column.

Result

    

How to use the JSON formatter

  1. Paste your JSON on the left. It's checked as you type.
  2. Click Format for readable, indented JSON, or Minify to remove all spaces and line breaks.
  3. If the JSON is invalid, the message tells you the line and column of the problem.

Choose the Indentation (2 spaces, 4 spaces or tabs), tick Sort keys A–Z to order every object's keys, and press Copy to take the result. Load sample fills in an example to try. When the JSON is valid, the status line also says what it contains, such as an object with 12 keys, and how big the result is.

Common JSON mistakes

JSON in one minute

JSON (JavaScript Object Notation) is the most common format for sending data between programs. It has only six kinds of values: text in double quotes, numbers, true, false, null, and two containers: objects in curly braces, which hold "key": value pairs, and arrays in square brackets, which hold a list of values.

FAQ

Is my JSON sent to a server?

No. It's parsed by your browser, so it's safe for API keys or private data, though you should still avoid pasting secrets anywhere you don't need to.

Why did a very large number change?

JavaScript can only represent whole numbers exactly up to 9,007,199,254,740,991. Bigger numbers (like some IDs) get rounded when parsed. Store such values as strings.

What's the difference between formatting and minifying?

Formatting adds line breaks and indentation so people can read the data. Minifying removes them so the file is smaller and faster to send. Both contain exactly the same data.

Does sorting the keys change my data?

No. The order of keys inside a JSON object has no meaning, so sorting them only makes two files easier to compare. Arrays keep their order, because there the order matters.