JSON Formatter

Beautify, minify and validate JSON with helpful error feedback.

Runs in your browser. Your input stays on this device.

JSON workspace JSON
Ready when you are. JSON is processed locally.
INPUT
230 chars · 11 lines
OUTPUT

Your formatted JSON appears here

Paste or edit JSON in the input editor, then choose Format JSON or Minify.

What this tool does

Reindent parsed JSON for reading, compact it for transport, or remove trailing commas with Correct JSON.

When to use it

A readable inventory response makes it easier to spot which records are missing fields. A compact version fits into fixtures or a one-line log entry.

How to use it

  1. Paste one JSON document into Input or load the sample.
  2. Choose Format JSON for indentation, Minify for compact output, or Correct JSON when trailing commas are the issue.
  3. Review the status and output before copying or downloading.

Worked example

Paste {"team":"platform","checks":[{"name":"build","passed":true},{"name":"lint","passed":false}]} and choose Format. The two check objects appear on separate indented lines, so you can scan the names and compare their passed values without counting braces. Choose Minify to put the payload back on one line for a fixture that expects compact JSON. If someone adds a comma after the final check object, try Correct JSON, then inspect the result before replacing the fixture. Keep the original nearby when debugging a parser error in a shared file so you can confirm the exact edit.

Example input
{"id":"sku-42","stock":[3,8]}
Example output
{
  "id": "sku-42",
  "stock": [
    3,
    8
  ]
}

Supported features and limitations

Accepts a single standard JSON value. Correct JSON handles trailing commas. Check payload-specific requirements with the receiving schema.

Common mistakes and edge cases

JSON requires double quotes around property names and strings. Single-quoted strings, comments and unquoted keys are common when copying a JavaScript object literal. Correct JSON handles trailing commas and leaves other syntax errors for you to fix. A comma inside a quoted message is part of the value and should stay there. Duplicate keys deserve special attention because parsing can keep only the last value. Keep unusually large identifiers in strings when exact digits are important. For a regression test, format a fixture containing a string such as a,b and compare the parsed values before and after formatting. That check catches accidental changes to values while allowing line breaks and indentation to change.

Frequently asked questions

Can I format an array or a single value?
Yes. Arrays and standalone JSON values such as true or null are valid. A file containing several independent JSON values on separate lines needs to be split into individual inputs first.
When should I use the JSON Validator?
Use it when you want to check whether the original text parses. Keep the formatter for changing whitespace or correcting trailing commas. When an API rejects valid JSON, compare the field names and types with the endpoint’s schema before changing the indentation.

Related tools

Developer guides