About JSON Formatter
Turn compact or messy JSON into neatly indented, easy-to-read JSON — or minify it back down. If your JSON is invalid, the formatter points to the line and column of the first problem and explains it in plain language, such as a trailing comma or a missing quote. It is useful for API responses, configuration files and debugging.
How to use JSON Formatter
- Paste your JSON into the input box.
- Choose the indentation (2 spaces, 4 spaces or tab) and whether to sort keys.
- Read the formatted result, or the error message with its line and column.
- Copy the result or download it as a .json file.
Tips and good to know
- JSON requires double quotes around keys and strings, and does not allow trailing commas or comments.
- Numbers with more than 15–16 significant digits can lose precision in any JavaScript-based tool; the formatter warns you when this may have happened.
- Your JSON is processed locally and is never uploaded.
The most common JSON errors
Nearly all invalid JSON comes from a few mistakes: a trailing comma after the last item, single quotes instead of double quotes, keys without quotes, comments, and unescaped line breaks or quotes inside strings. JSON also has no undefined, NaN or Infinity, only null, true, false, numbers, strings, arrays and objects. When an API response won't parse, check the very first characters: an HTML error page starting with < is a frequent cause.
Indentation and key order do not change the meaning of JSON, so formatting is always safe. It makes changes easy to compare in code reviews and version control.
Frequently asked questions
Why does my JSON show an error when it works in my code?
Some programs accept relaxed JSON (comments, single quotes, trailing commas). Strict JSON, as defined by the standard, does not, and this tool checks against the strict rules.
What does sorting keys do?
It orders the keys of every object alphabetically, which makes two JSON documents easier to compare. Arrays keep their original order.
Is JSON Formatter free?
Yes. JSON Formatter is 100% free: no sign-up, no paid plan, no trial and no limit on how often you use it. It runs in your browser, and ToolzAura is paid for by ads, so every tool stays free.
Are my files uploaded?
No. This tool runs in your browser, so your input stays on your device.