About the JSON Formatter
This JSON formatter turns long one-line JSON, such as API responses or config files, into readable, indented JSON, or strips all whitespace to minify it. It validates as you type and tells you the exact line, column and cause of problems like missing commas or wrong quotes.
The tree view lets you collapse and expand objects and arrays to explore the structure. Everything runs in your browser, so JSON containing company data or personal information is never uploaded to a server.
How to use
- Paste JSON into the input box or load a .json file with Open file.
- Beautify applies indentation (2 spaces, 4 spaces or tabs); Minify removes all whitespace.
- If there is an error, the red message shows the line and column. Click Go to error to select that spot in the input.
- Switch to the Tree view to explore the structure, then Copy the result or Download it as a .json file.
Common JSON errors
| Error | Wrong | Right |
|---|---|---|
| Trailing comma | {"a": 1,} | {"a": 1} |
| Single quotes | {'a': 'b'} | {"a": "b"} |
| Unquoted key | {a: 1} | {"a": 1} |
| Comments | // note | Not allowed |
| Capitalized literals | True, None | true, null |
| Leading zero | 007 | 7 or "007" |
JSON is stricter than JavaScript object syntax. Keys and strings must always use double quotes, and undefined, NaN and functions are not valid values.
JSON data types
A JSON value is one of six types: string ("text"), number (integer, decimal or exponent), boolean (true/false), null, object ({ }) and array ([ ]). There is no date type, so dates are usually stored as ISO 8601 strings such as "2026-10-01T09:00:00Z".
FAQ
Is my JSON sent to a server?
No. Validation and formatting happen entirely in your browser. Only your last input is saved locally in this browser, and the Clear button removes it.
Why do very large numbers change?
JavaScript stores numbers as 64-bit floating point, so integers larger than 9,007,199,254,740,991 (2^53โ1) lose precision. Send big IDs as strings to be safe.
When should I sort keys?
Sorting is handy when comparing two JSON documents or tidying config files. Object keys are sorted alphabetically at every level; the order of array items is never changed.
How large a file can it handle?
Several megabytes work fine. Results over 300,000 characters are shown without syntax highlighting for speed, and the tree view renders nodes only when you expand them.