JSON Formatter
Format and beautify JSON online with configurable spaces or tabs, readable indentation, syntax highlighting, and validation errors. Read more
Format JSON online
This JSON formatter parses compact or inconsistently indented JSON and writes it back with predictable whitespace. Choose spaces or tabs and the indentation width to make nested objects and arrays easier to inspect, review, or paste into documentation.
Formatting changes whitespace outside string values. It does not rename properties, sort keys, convert data types, or change whitespace that belongs inside a quoted string.
How to beautify JSON
- Paste a JSON document into the input editor.
- Select spaces or tabs and choose the indentation amount.
- Click Format to parse and beautify the document.
- Review any syntax error, or copy the formatted output when parsing succeeds.
For example, {"name":"Ada","active":true} becomes a multi-line object with each property indented. The parsed values remain the string "Ada" and the Boolean true.
JSON syntax reminders
JSON is a text-based data interchange format standardized by RFC 8259. Object member names and string values use double quotes. Arrays and objects may be nested, but trailing commas and comments are not part of standard JSON.
JSON numbers do not use quotes. The literals true, false, and null are lowercase. A formatter must first parse the input, so invalid syntax produces an error instead of partially rewriting the document.
JSON formatter FAQ
Does formatting change the JSON data?
The object, array, and primitive values stay equivalent after a successful parse and format operation. Whitespace outside strings changes, and an application’s treatment of duplicate object names may still vary.
Can this format JavaScript object literals?
Only when the input is also valid JSON. JavaScript-only syntax such as comments, single-quoted strings, unquoted property names, functions, undefined, or trailing commas is rejected.
How do I make JSON smaller?
Use the JSON Minifier to remove unnecessary whitespace rather than add indentation. To check syntax without reformatting the document, use the JSON Validator.