Skip to the tool
Tools

JSON Formatter

Format, validate, and minify JSON. Errors name the exact character that broke, and pasted Python dicts convert in one click.

View
Result Waiting for input
Paste JSON. Broken input is fine — try

Why valid-looking JSON gets rejected

Four things break JSON constantly, and none of them look wrong at a glance. A comma before a closing brace or bracket is legal in JavaScript and never in JSON. Strings must use double quotes, so 'single' fails. Object keys must be quoted too, so {name: "x"} fails. And JSON has no comments, which is why a file copied out of tsconfig.json will not parse.

All four are detected here by name, with the exact character marked.

Pasting a Python dict

Printing a dictionary in Python gives you single quotes and True, False, None where JSON wants true, false, null. Paste one and the repair button converts it. It uses the parser rather than find-and-replace, so an apostrophe inside a string survives.

Large numbers

JSON puts no limit on how big a number can be, but JavaScript reads every number as a 64-bit float, so anything above about 9 quadrillion loses its last digits. If you work with Snowflake IDs or large database keys, a formatter can quietly change them. This one re-emits the digits exactly as written.

Duplicate keys

{"id": 1, "id": 2} is valid JSON, and every parser silently keeps only the last value. That is data loss inside a document that looks fine, so it is flagged here rather than passed over.

One document per line

Log exports and streaming APIs usually emit one JSON object per line, which is NDJSON rather than a single document. Paste several and you will be offered a one-click wrap into an array.

Key order

Keys stay in the order you wrote them, including keys that look like numbers — a plain JavaScript object would reorder those. Turn on sort keys when you want a canonical order, for example before diffing two documents.

Your document stays in the browser

The parser runs on your machine. Nothing is sent anywhere, including tokens inside the JSON.