Skip to content
ToolBoxGenie

JSON Formatter

Developer Tools · Added 12 July 2026

Paste raw JSON — a minified API response, a config file, a log line — and get it back indented and readable. Minify in the other direction, sort keys for easier diffing, and see the exact line and column when the parser rejects something.

Parsed in your browser — nothing is sent to a server.

How to use the json formatter

  1. 1Paste your JSON into the input box.
  2. 2Choose an indent width, or pick Minify to strip all whitespace.
  3. 3Press Format. Errors are reported with a line and column number.
  4. 4Copy the formatted output, or download it as a .json file.

Examples

Beautifying an API response

Input
{"id":42,"name":"Ada","tags":["math","code"]}
Result
Indented across eight lines with each key on its own line

A syntax error located

Input
{"a": 1,}
Result
Line 1, column 9 — trailing comma: JSON does not allow a comma after the last entry

About the json formatter

Reading a parse error properly

A JSON parser reports the position where the document stopped making sense, which is usually just after the actual mistake. An error at the closing brace normally means something went wrong earlier in that object — a missing comma between two pairs, or an unquoted key.

Work backwards from the reported position rather than staring at it. The character named in the message is the symptom; the defect is typically on the preceding line.

What JSON deliberately leaves out

There are no comments, no trailing commas, no date type, no integers distinct from floats, and no way to express NaN or Infinity. Every one of those omissions was intentional, to keep the format small and unambiguous across languages.

The practical consequences are worth knowing. Dates travel as ISO 8601 strings by convention, not by specification. Large integers beyond 2^53 lose precision in JavaScript, so identifiers should be sent as strings. And if you need comments in a config file, you want JSON5, YAML or TOML instead.

Frequently asked questions

Are trailing commas allowed in JSON?
No. JSON does not permit a comma after the last element of an array or object, even though JavaScript does. This is the single most common cause of a parse failure in hand-edited files.
Can I use single quotes?
No. JSON strings must use double quotes, and keys must be quoted strings. {name: 'Ada'} is valid JavaScript and invalid JSON — a distinction that catches people out when copying object literals out of source code.
Does sorting keys change the meaning?
Not for any conforming parser — JSON objects are unordered by specification. Sorting is purely a convenience that makes two versions of the same document diff cleanly. Arrays are never reordered, because their order is significant.
Is my data sent to a server?
No. Parsing and formatting use the browser's own JSON engine. Nothing leaves the tab, which matters when the payload contains tokens or personal data.