How to use it
- Paste JSON into the box above. It is checked for syntax errors as you type.
- Press “Format” to pretty-print it with 2 spaces, 4 spaces or tabs.
- Press “Minify” to remove all whitespace and put it on one line.
- Tick “Sort keys” to order object keys alphabetically, which makes two JSON documents easier to compare.
Numbers stay exactly as written
Most online formatters load your JSON with JavaScript’s built-in parser and print it again. That silently changes some values:
| Your JSON | Typical formatter | This tool |
|---|---|---|
9007199254740993 | 9007199254740992 | 9007199254740993 |
1.0 | 1 | 1.0 |
1e3 | 1000 | 1e3 |
This tool uses its own parser and only changes whitespace. Numbers and strings come out exactly as they went in, so large IDs, amounts and other precise values are safe.
Finding errors
When the JSON is invalid, the tool shows the line and column of the problem. Pressing “Format” also moves the cursor to that spot. The most common causes are:
- Trailing commas, as in
[1, 2, ], which JSON does not allow. - Single quotes. Strings and keys must use double quotes (
"). - Unquoted keys. Write
{"name": 1}, not{name: 1}. - Comments. Neither
//nor/* */is part of JSON. - Missing brackets. Check that every
{and[is closed.
Frequently asked questions
Which JSON standard does it follow?
RFC 8259, the current JSON standard. Extensions such as JSON5 or JSONC, which allow comments and trailing commas, are reported as errors.
What happens to duplicate keys?
The standard discourages duplicate keys but does not forbid them. This tool keeps every occurrence as is.
Can it handle large files?
A few megabytes is fine on a typical computer. Everything runs on your device, so speed depends on its performance.
Is my JSON uploaded?
No. Even JSON containing API keys or personal data never leaves your browser.