Test site — not live. Nothing here is public yet.

JSON Formatter

Format messy JSON into something readable, minify it back down, or validate it — with the error location pointed out precisely when it fails to parse.

Nothing is uploaded. Your file stays on this device.

JSON
Input
Output

How to format JSON

  1. Paste your JSON into the box on the left, or open a .json file.
  2. Press Format to indent it, or Minify to strip every unnecessary byte.
  3. If it will not parse, the exact line and column is pointed out along with the line itself.

Questions people ask

Is my JSON uploaded anywhere?

No. Parsing and formatting happen on your own device.

Why does it say "Unexpected token" when the JSON looks fine?

The three usual culprits are a trailing comma after the last item, single quotes instead of double quotes, and unquoted keys. All three are valid JavaScript but invalid JSON. Comments are also not allowed in strict JSON. The error message here gives you the line and column so you can go straight to it.

What is the difference between formatting and minifying?

They produce the same data. Formatting adds indentation and line breaks so a human can read the structure; minifying removes every space and newline so the file is as small as possible to transmit. Converting back and forth is lossless — you can minify a formatted file and format it again with no change to the values.

Does sorting the keys change my data?

Not in any way that matters to JSON: objects are unordered by specification, so a parser will read the same values either way. It is useful when you are comparing two documents by eye or with a diff tool, because it removes ordering as a source of noise. Arrays are never reordered — order is meaningful in an array.

How big a file can it handle?

Files of a few megabytes format instantly. Very large documents — tens of megabytes — will work but may pause the tab while the browser parses them, and the tree view is the slow part. If you only need to check validity on something enormous, minify instead of formatting.

Will it preserve very large numbers?

Numbers are parsed as JavaScript doubles, so an integer beyond about 9 quadrillion (2^53) loses precision — this is a limitation of JSON in every JavaScript environment, not of this tool. If you are handling IDs that big, they should be strings in your JSON to begin with.