Skip to the tool

JSON Formatter and Validator

Paste JSON and get it indented, minified, or with its keys sorted. When it is broken you get a line number, a column and the offending line printed with a marker underneath — not a character offset.

JSON Formatter and Validator

Valid JSON · object with 2 keys · 38 bytes larger

{
  "name": "Kavitha",
  "tools": [
    {
      "slug": "json-formatter",
      "free": true
    }
  ]
}

How to use it

  1. Paste your JSON into the input box.
  2. Choose format, minify, or sort keys. Formatting re-serialises the parsed value, so the output is always canonical.
  3. If it fails to parse, read the line and column reported and look at the marked line below it.
  4. Use sort keys before diffing two API responses — it removes false differences caused by key order.
  5. Copy the result with the button rather than selecting it by hand.

Frequently asked questions

Why does my JSON fail with a trailing comma?
The JSON specification forbids it, even though JavaScript allows it in object and array literals. It is the single most common cause of a parse failure — remove the comma before the closing brace.
Can I use comments in JSON?
Not in standard JSON. Some parsers accept a superset called JSON5 or JSONC, but anything strictly conforming, including this page, will reject them.
Why did my long ID number change?
JSON numbers are parsed as double-precision floats, which cannot represent every integer above roughly nine quadrillion exactly. Send large identifiers as strings if they need to survive a round trip.

Related tools

Kavitha Kanchana

Built and maintained by Kavitha Kanchana

Software engineer at Cortana AI and co-founder of Ryzera Technologies, based in Sri Lanka. Found a bug or a wrong number? Email me.