JSON Formatter and Validator

Paste JSON to make it readable, check that it is valid, or squash it down to one line.

How to format JSON

  1. Paste your JSON into the top box.
  2. It is checked and formatted automatically. A green message means it is valid.
  3. Choose Beautify for readable output or Minify for a single compact line.
  4. Copy the result or download it as a .json file.

If the JSON has an error, the message tells you roughly where it is, for example "near line 4, column 12". Look just before that spot, as the real mistake is often one character earlier.

Fixing common errors

WrongRight
{'name': 'Sam'}{"name": "Sam"}
{name: "Sam"}{"name": "Sam"}
[1, 2, 3,][1, 2, 3]
{"ok": True}{"ok": true}
{"note": undefined}{"note": null}

What is JSON?

JSON (JavaScript Object Notation) is a plain text format for storing and sending structured data. It is used by nearly every web API, many config files and lots of databases. It has only six kinds of values: strings in double quotes, numbers, true, false, null, plus arrays in square brackets and objects in curly braces. That simplicity is why it took over from XML for most web work.

Tips

Frequently asked questions

What are the most common JSON errors?

A trailing comma after the last item, single quotes instead of double quotes, keys without quotes, and comments. JSON allows none of these, even though JavaScript does.

Does formatting change my data?

No. Formatting only adds or removes spaces and line breaks. The values stay exactly the same. The only exception is "Sort keys", which changes the order of keys inside objects but not their values.

Is my JSON uploaded anywhere?

No. Parsing and formatting happen in your browser. That makes it safe for API responses that include personal or business data.

Why would I minify JSON?

Minified JSON has no extra whitespace, so it is smaller. That is useful for config values, environment variables, or sending data where size matters.