JSON Formatter

Pretty-print and validate JSON text with your chosen indentation.

  • Free to use
  • Accurate results
  • No registration required
  • Works on all devices
Paste JSON text and choose an indent size to pretty-print and validate it.

Your result

Valid

Valid JSON?

Formatted JSON{ "name": "CalcuTool", "calculators": 500, "active": true }
Error (if invalid)

AI explanation

Formula

Parses the JSON text, then re-serializes it with the requested indentation

Worked example

A compact JSON object

Worked example: A compact JSON object
FieldValue
JSON text{"name":"CalcuTool","calculators":500,"active":true}
Indent size (spaces)2
Valid JSON?Valid
Formatted JSON{ "name": "CalcuTool", "calculators": 500, "active": true }

Assumptions

  • Uses standard JSON parsing rules — trailing commas, comments, and unquoted keys (all invalid in strict JSON) will be flagged as invalid, even though some JavaScript-like formats allow them.
  • Object key order is preserved as parsed; numeric formatting follows standard JSON number serialization.

Frequently asked questions

Why does my JSON show as invalid?

Common causes: trailing commas after the last item, unquoted object keys, single quotes instead of double quotes, or a missing/extra bracket or brace — strict JSON requires double-quoted keys and strings, and no trailing commas.

Can I use this to minify JSON instead of pretty-printing it?

Set the indent size to 0 for a compact, single-line output — useful before sending JSON over the network to reduce payload size.

Does this validate against a JSON Schema?

No — it only checks that the text is syntactically valid JSON, not that it matches any particular structure or set of required fields.

Related calculators

Report a calculation issue