Getting your file…

Free · runs in your browser · no upload · no quota

JSON Formatter & Validator

Paste JSON to pretty-print it with 2 or 4 spaces or tabs, minify it to one line, or sort its keys. If it is not valid, you see what is wrong and the exact line and column. Big numbers and the exact way values are written are kept as they are.

Good to know

Duplicate keys are kept and reported.

JSON with the same key twice in one object is legal but risky: most programs silently keep only the last value. The formatter keeps both and warns you.

Sorting is by key name, A to Z.

Keys are sorted by their character codes, so capital letters come before lowercase ones and digits before both. Arrays keep their order, since their order has meaning.

Large files are fine.

Files of tens of megabytes format in a second or two. Very large outputs are slow to display in a text box; downloading the result is quicker than scrolling it.

How to Format and Validate JSON

  1. Add your JSON
    Paste it into the left box, drop a .json file onto it or click Open file.
  2. Choose the layout
    Format indents it for reading, Minify removes all white space. Tick Sort keys A–Z to order every object's keys.
  3. Fix or copy
    Valid JSON appears on the right, ready to copy or download. Invalid JSON shows what is wrong and where, so you can fix it on the left.

Example

JSON
{"name":"Ana","age":31,"tags":["admin","editor"],"active":true}
Formatted JSON
{
  "name": "Ana",
  "age": 31,
  "tags": [
    "admin",
    "editor"
  ],
  "active": true
}

Frequently Asked Questions

More browser tools