Skip to content

JSON Formatter & Validator

Format, minify, and validate JSON with clear error messages.

Last updated August 26, 2026

Data

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

SpecYearNotes
RFC 82592017Current IETF standard; recommended default
ECMA-4042017Equivalent grammar, maintained by Ecma International
RFC 71592014Superseded by RFC 8259
RFC 46272006Original JSON RFC, by Douglas Crockford

Code examples

The second line (where shown) is the inverse operation.

LanguageCode
JavaScriptJSON.stringify(obj, null, 2)JSON.parse(jsonString)
Pythonjson.dumps(obj, indent=2)json.loads(json_string)
PHPjson_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.