Turn compact or inconsistently indented JSON into readable output. Choose spaces or tabs, validate while you edit, and inspect the result as formatted code, an expandable tree, or a table.
The formatter parses the source first and then serializes the same data with the selected indentation. It changes presentation—not keys, values, types, or array order—and refuses to format malformed input.
How to format JSON safely
Paste JSON into the input editor or load a .json, .jsonl, or text file. Resolve any syntax error shown below the editor, choose an indentation width, and select Format. Review the tree or code result before copying or downloading it.
Two spaces are a compact convention used in many JavaScript projects. Four spaces can be easier to scan in configuration files. Tabs let each reader control visual width, but may conflict with a repository’s style rules.
What formatting preserves
Whitespace outside a JSON string has no effect on the represented value. A formatter can therefore insert line breaks and indentation without changing the payload. Whitespace inside quoted strings is data and remains untouched.
Object key order is retained by this formatter, although consumers should not normally assign semantic meaning to object member order. Array order is significant and is always preserved.
Formatter versus minifier
A formatter adds optional whitespace for people; a minifier removes optional whitespace for transfer or storage. Both operations require valid JSON and should round-trip to the same parsed value. Formatting does not repair invalid syntax automatically because an inferred repair could change intent.
Frequently asked questions
Does formatting change JSON values?
No. It changes only insignificant whitespace outside strings.
Why will the formatter not accept my input?
The input must be valid JSON. Use the line and column error or open the repair preview for common issues.
Which indentation should I choose?
Match the convention used by your project. Two spaces is compact; four spaces is more visually separated; tabs follow the viewer’s tab-width setting.