JSON Formatter & Validator
Format, minify, and validate JSON with clear error messages.
Last updated August 26, 2026
About this tool
JSON is often transmitted or logged without any line breaks or indentation to save space, which makes it nearly unreadable by hand. This tool formats (“beautifies”) JSON with proper indentation, validates it against the JSON specification, and reports the exact line and character of any syntax error — so you can debug malformed API responses, config files, or logs quickly.
JSON specification versions
| Spec | Year | Notes |
|---|---|---|
| RFC 8259 | 2017 | Current IETF standard; recommended default |
| ECMA-404 | 2017 | Equivalent grammar, maintained by Ecma International |
| RFC 7159 | 2014 | Superseded by RFC 8259 |
| RFC 4627 | 2006 | Original JSON RFC, by Douglas Crockford |
Code examples
The second line (where shown) is the inverse operation.
| Language | Code |
|---|---|
| JavaScript | JSON.stringify(obj, null, 2)JSON.parse(jsonString) |
| Python | json.dumps(obj, indent=2)json.loads(json_string) |
| PHP | json_encode($obj, JSON_PRETTY_PRINT)json_decode($jsonString, true) |
| jq (shell) | cat file.json | jq .echo '{"a":1}' | jq . |
Frequently asked questions
Is my JSON data uploaded or stored anywhere?
No. Formatting and validation both run entirely in your browser — nothing you paste is sent to a server.
Why does my JSON fail validation even though it looks correct?
Common causes are trailing commas, single quotes instead of double quotes, unquoted object keys, or comments — none of these are valid in standard JSON even though many JavaScript objects allow them.
What's the difference between formatting and minifying?
Formatting adds indentation and line breaks for readability. Minifying strips all unnecessary whitespace to produce the smallest possible payload, typically for production API responses.
I have valid JSON — how do I turn it into a spreadsheet?
Use the JSON to CSV Converter to flatten nested objects, preview the columns, and download a .csv file.
More in Data & Code
Convert CSV data to JSON, with or without a header row.
Convert JSON arrays, objects, and API responses into spreadsheet-ready CSV. Flatten nested fields, choose how arrays are handled, preview the columns, and download the result — all in your browser.
Convert YAML to JSON or JSON to YAML, both ways.