JSON Formatter
Format, validate and minify JSON with line-and-column errors and a tree view. Runs in your browser.
The result appears here as you type.
JSON Formatter FAQ
How do I format JSON online?
Paste the JSON into Input JSON. It is formatted as you type with 2-space indentation; choose 4 spaces or a tab in Indent, then click Copy or Download.
Why does my JSON say invalid?
The error box shows the line and column and the likely cause. The most common ones are a trailing comma before } or ], single quotes instead of double quotes, keys without quotes, comments, and curly quotes copied from Word or WhatsApp.
Why does my JSON number change in other tools?
JavaScript stores numbers as 64-bit floating point, so whole numbers above 9,007,199,254,740,991 (2^53 − 1) are rounded by JSON.parse: 12345678901234567890 becomes 12345678901234567000. This formatter keeps the digits as written and warns you; store such IDs as strings.
What is the difference between formatting and minifying JSON?
Formatting adds line breaks and indentation so people can read it. Minifying removes all the spaces and line breaks to make the file smaller. The data is the same in both.
Is my JSON uploaded or saved anywhere?
No. Formatting and validation run in your browser, so the JSON never leaves your device and nothing is stored after you close the page.