Pretty-print JSON for inspection
Paste a JSON value and select 2 or 4 spaces of indentation. The formatter parses the input, then writes a new JSON representation. Compact input such as {"name":"Alice","roles":["editor"]} becomes a multiline object with its nested array indented.
If parsing fails, the output shows the browser's error message. Property names and strings need double quotes. Comments, trailing commas, undefined, and JavaScript object literals are not valid JSON. Use JSON lint for a dedicated syntax report.
Check syntax and schema separately
Valid JSON syntax does not tell you whether a value meets an API's contract. An object can parse correctly while missing a required property. Use the JSON Schema validator to check the supported schema rules, or the JSON minifier to remove formatting whitespace.
This formatter uses JavaScript parsing and serialization. Large integer values can lose precision, duplicate keys collapse to the last value, and numeric notation can change. Keep identifiers that exceed JavaScript's safe integer range in strings. See the JSON.parse documentation.
Common questions
- Does formatting fix invalid JSON?
- No. The formatter reports a parse error. Correct the input syntax before formatting it.
- Does this validate a JSON Schema?
- No. It checks JSON syntax. Use the separate JSON Schema validator to check supported constraints such as required properties and value types.