JSON Formatter & Validator
Paste raw JSON below to format it with readable indentation, minify it down to the smallest size, or instantly find out why it will not parse — with the exact error message from your own browser.
How this JSON tool works
When you click Format, the page calls your browser's native JSON.parse to verify the syntax, then re-serialises the data with two-space indentation. Minify does the same parse but strips all whitespace, which is useful before embedding a payload in a URL or a build step. Sort keys recursively rewrites object keys in alphabetical order, which makes two JSON files diffable — handy when comparing API responses between environments.
If your input is invalid, the error line tells you exactly what the JavaScript engine rejected (for example a trailing comma or a single-quoted key, both of which are common mistakes in hand-written JSON). Nothing is transmitted anywhere: parsing happens inside this tab, so it is safe to format API responses containing tokens or personal data.
FAQ
- Does my JSON get uploaded to a server?
- No. Formatting happens in your browser's JavaScript engine. The network tab will show no requests containing your data.
- Why does my "JSON" fail to parse?
- The usual suspects are trailing commas, single quotes instead of double quotes, unquoted keys, and comments — all valid in JavaScript objects but not in strict JSON.
- Can it handle very large files?
- Files up to a few megabytes format instantly. For multi-hundred-megabyte files, use a desktop tool; browser tabs have memory limits.