JSON Formatter

Beautify, minify, and validate JSON with clear error messages — free and fully private.

Read, fix and shrink JSON

JSON is the text format most APIs, config files and apps use to exchange data. Machines write it on one long line, which is impossible to read, and a single missing comma makes the whole file fail. Paste your JSON here and Beautify it with two-space indentation, Minify it back to one compact line, or Validate it. When the JSON is invalid you get the parser's error message, which tells you what went wrong and where.

How to format or validate JSON

  1. Paste your JSON into the box.
  2. Click Beautify to format it neatly, or Minify to compact it.
  3. Click Validate to check for errors.
  4. Copy the cleaned output for your project.

Features

  • Beautify, minify, and validate in one place.
  • Clear error messages when JSON is invalid.
  • Handles large JSON structures.
  • Private — nothing is uploaded.
  • Free with no sign-up.

Beautify and minify, side by side

Minified (for sending)Beautified (for reading)
{"id":7,"name":"Asha","tags":["new","vip"]}
{
  "id": 7,
  "name": "Asha",
  "tags": [
    "new",
    "vip"
  ]
}

Both contain exactly the same data. Minify for API requests and storage, beautify when a person needs to read or edit it.

The errors you will see most often

MistakeWrongRight
Trailing comma{"a": 1, "b": 2,}{"a": 1, "b": 2}
Single quotes{'name': 'Asha'}{"name": "Asha"}
Unquoted key{name: "Asha"}{"name": "Asha"}
Comment{"a": 1 // id}JSON has no comments; remove it
Missing bracket{"list": [1, 2}{"list": [1, 2]}
Special values{"x": undefined, "y": NaN}Use null or a number

The error message names the position where reading stopped. The real mistake is usually just before that point, for example the comma on the line above.

Good to know

  • Very large numbers, more than 15 to 16 digits, are rounded by JavaScript. Store long IDs and account numbers as strings (in quotes).
  • Duplicate keys are not reported: if a key appears twice, the last value wins. Keys that are whole numbers, such as "2" and "10", are moved to the front in number order when the JSON is beautified or minified.
  • JSON is case-sensitive: true, false and null must be lowercase.

Finding a value in API output

Beautify first, then follow the nesting from the outside in. In the example below, the city is at data.customer.address.city and the second order's amount at data.orders[1].amount (counting starts at 0):

{
  "data": {
    "customer": { "name": "Asha", "address": { "city": "Dehradun" } },
    "orders": [ { "id": 101, "amount": 499 }, { "id": 102, "amount": 1299 } ]
  }
}

That path is what you write in JavaScript, in a no-code tool's mapping field or in a spreadsheet's import settings. If you need the data as rows and columns, a list of similar objects such as orders converts naturally into a table with one column per key.

Your privacy

The JSON is checked and formatted by your own browser and is not uploaded, so API keys, tokens and customer data in it stay on your device. Nothing is kept after you close the page.

Frequently asked questions

Why does it say Unexpected token?

The parser found a character it did not expect, often a single quote, a trailing comma, an unquoted key or a comment. Look just before the position in the message.

What is the difference between beautify and minify?

Beautify adds line breaks and indentation for reading. Minify removes all spaces that are not needed, for the smallest size. The data is identical.

Can JSON contain comments?

No. Standard JSON does not allow comments. Remove them, or keep notes in a separate field such as "_note".

Why did my long ID number change?

JavaScript numbers are exact only up to about 15 to 16 digits. Put long IDs and account numbers in quotes so they stay strings.

Is my data uploaded?

No. Formatting and validation happen in your browser, so tokens and private data stay on your device.

Related tools