Developer

JSON Formatter

Beautify, minify and validate JSON with a clear error message when it is broken.

Validation
Paste JSON to validate.

JSON arrives minified from an API, or hand-edited with a missing comma, and either way you need to read it. This formatter indents it properly, sorts it out if you want keys in a predictable order, and tells you exactly where a syntax error is instead of just refusing.

It is deliberately strict. A JavaScript object literal is not JSON, and a formatter that quietly accepts trailing commas or unquoted keys will let a broken payload through to production. Numbers keep their full precision rather than being rounded by floating-point conversion, and very large integers are preserved as written.

How to use it

  1. Paste your JSON into the left box. It validates as you type and reports the first problem it finds, with the line and column.
  2. Press Format to pretty-print with your chosen indent — two spaces, four spaces or a tab.
  3. Press Minify to strip all optional whitespace, which is what you want to send over the wire.
  4. Tick Sort keys if you need a stable, diffable order rather than the order the data arrived in.
  5. Use Copy to take the result, or Download to save it as a .json file.

Questions

What exactly is reported when the JSON is invalid?

The parser reports the line number, the column and the character it did not expect, then shows the offending line with a caret underneath. It stops at the first error, because fixing one syntax problem usually reveals whether the next one was real or a knock-on effect.

Is my data sent anywhere?

No. Parsing and formatting happen in the page. That matters more than usual here: API responses are often the most sensitive data people paste into a formatter.

Does it preserve large numbers exactly?

Yes. When sorting and re-indenting, numbers are kept as the original source text rather than being run through floating-point conversion, so a 19-digit ID or a high-precision decimal does not come back altered.

Can it handle a JSON array at the top level?

Yes. Arrays, objects and bare scalars are all valid JSON and all validate. Trailing commas, comments and single-quoted strings are rejected, because they are not JSON — if your config file uses them, it is JSON5 or JSONC and needs a different editor.