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.
How to use the json formatter
- 1Paste your JSON into the input box.
- 2Choose an indent width, or pick Minify to strip all whitespace.
- 3Press Format. Errors are reported with a line and column number.
- 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?
Can I use single quotes?
Does sorting keys change the meaning?
Is my data sent to a server?
Related tools
JSON Validator
Developer Tools
Check JSON validity and get a structural summary — depth, key count and type breakdown.
Base64 Encoder / Decoder
Developer Tools
Encode text to Base64 and decode it back, with full Unicode and URL-safe support.
URL Encoder / Decoder
Developer Tools
Percent-encode and decode URLs and query parameters, with a query string breakdown.