Runs entirely in your browser. Nothing you enter is sent anywhere.
How to use JSON Formatter
- Paste JSON into the input box.
- Choose Format to pretty-print or Minify to compact it.
- If the JSON is invalid, the error message explains what the parser found.
The rules of valid JSON
JSON is stricter than JavaScript object syntax. Keys must be in double quotes, strings must use double quotes, trailing commas are not allowed, comments are not allowed, and the only values are strings, numbers, true, false, null, arrays and objects.
Most errors come from a trailing comma, single quotes or a missing closing bracket. The formatter reports the problem so you can fix it.
Formatting and minifying
Formatting adds indentation so a nested structure is easy to read while debugging an API response or a configuration file. Minifying removes all optional whitespace, which makes the text smaller to send over a network.
Both keep the data identical; only the spacing changes. Large numbers beyond 15 or 16 digits can lose precision in JavaScript, so treat identifiers of that size as strings.
Frequently asked questions
Is my JSON sent to a server?
No. Parsing and formatting happen in your browser.
Why does my JSON fail to parse?
Common causes are trailing commas, single quotes instead of double quotes, and unquoted keys. JSON is stricter than JavaScript objects.
Does formatting change my data?
No. Only whitespace changes; keys and values stay the same, in the same order.