JSON formatter and validator
Paste JSON to check that it is valid and make it readable, or minify it for transport. Errors show the line and column where parsing stopped.
Runs in your browser. Nothing is uploaded.
Loading tool…
How to use
- Paste your JSON.
- Choose indentation or minify, then select Format.
- Copy or download the output.
Common uses
- Make a one-line API response readable while debugging.
- Find the exact line and column of a syntax error in a config file.
- Minify JSON before embedding it in a URL, a script or a test fixture.
Example
- Input
- {"id":7,"tags":["a","b"]}
- Result
- { "id": 7, "tags": [ "a", "b" ] }
With a trailing comma, such as {"id":7,}, you get an “Invalid JSON” message with the line and column.
Good to know
- Strict JSON: no comments, no comma after the last item, and keys in double quotes.
- Long numbers: whole numbers above 9,007,199,254,740,991 get rounded, as in any JavaScript code. Keep long IDs in quotes.
- Repeated keys: if a key appears twice, the last value wins.
- Text stays in your browser tab and is not sent anywhere.
Questions
Is my data sent to a server?
No. Parsing uses your browser's built-in JSON engine.
Which indentation should I pick?
Two spaces is the most common style in web projects and keeps deeply nested data readable. Four spaces suits teams that prefer it; minify removes all spacing for the smallest size.
Does it sort keys?
No. Keys keep the order they have in your input, so the output is easy to compare with the original. One exception comes from JavaScript itself: keys that are whole numbers, such as "10", move to the front in numeric order.
Can it fix invalid JSON automatically?
No. It shows where parsing stopped so you can fix the cause. Automatic repair can silently change values, such as turning a broken string into a different one.
Why is my JSON invalid when it works in JavaScript?
JavaScript object syntax allows trailing commas, comments, single quotes and unquoted keys. JSON allows none of them.
Is there a size limit?
Up to 5 million characters can be pasted. Larger files may be slow on older phones.