JSON Formatter & Validator

Paste JSON, choose what to do with it, and press Format JSON. Errors are reported with their line and column, and the result comes with syntax colors and a collapsible tree.

Try an example

About this JSON formatter

JSON from APIs and log files often arrives on a single long line that is hard to read. This formatter indents it cleanly, colors keys, strings, and numbers, and shows the data as a tree you can open and close. Validate checks the syntax and points to the exact line and column of the first mistake; Minify removes all whitespace for smaller payloads; and Repair fixes the mistakes people make when writing JSON by hand, such as comments, single quotes, unquoted keys, trailing commas, and Python-style True, False, and None. Numbers are kept exactly as written, so large IDs do not lose precision.

How to format JSON

  1. Paste your JSON. Paste JSON from an API, a file, or a log, or press an example. An example only fills the box.
  2. Choose an action. Format & beautify, Minify, Validate only, or Repair & format. Pick the indent and whether to sort keys.
  3. Press Format JSON. The result appears with syntax colors, statistics, and a tree view, or with the exact position of the first error.
  4. Copy or download. Press Copy JSON or Download to use the result.

Frequently asked questions

What does Repair & format fix?

It removes // and /* */ comments, turns single quotes into double quotes, adds quotes around unquoted keys, drops trailing commas, inserts missing commas between items, and converts True, False, and None to true, false, and null. The result line lists which fixes were applied.

Why is a trailing comma an error?

The JSON standard does not allow a comma after the last item of an object or array, even though JavaScript does. Remove it, or use Repair & format to remove every trailing comma at once.

Are large numbers kept exactly?

Yes. Numbers are copied as written, so an ID such as 12345678901234567890 or a price written as 1.50 stays the same instead of being rounded.

What does Sort keys do?

It orders the keys of every object alphabetically, at every level, which makes two JSON documents easier to compare. Array order is never changed.

Is my JSON sent to a server?

No. Parsing, formatting, and repairing all run in your browser.