← All Tools
JS Object Formatter🔒 100% local
Format and validate JSON/JavaScript objects. Pretty-print with configurable indentation.
Indent Size (spaces)
JSON/JS Object Input
Related Tools
Expands a compact JSON object into one property per line, using the browser's own JSON.parse followed by JSON.stringify at an indent width you choose between 1 and 8 spaces. Keys keep the order they appear in the source; only whitespace and line breaks are added. The input is read by the page's JavaScript engine and never posted to a server.
How to use it
- Paste the object you want expanded into the text area.
- Enter an indent width, or leave the default of 2.
- Press Format and use Copy Output for the expanded text.
Worked example
{"name":"Ada","age":36}becomes{
"name": "Ada",
"age": 36
}Key order is preserved exactly; compare with JSON Sort, which reorders keys instead.
When to use it
- You want to inspect an object that was pasted out of a log line as one long string.
- You need the same object at a different indent width - 4 spaces for a Java codebase, 1 for a narrow terminal - and do not want to re-indent by hand.
- You are preparing a fixture for a test file and want it readable in the diff.
What it does not do
- Despite the JavaScript in its name it accepts strict JSON only: unquoted keys, single quotes and trailing commas fail with a parse error instead of being repaired.
- It reformats and nothing else - it does not sort keys, diff two documents or infer types.
- Values are round-tripped through the parser, so duplicate keys collapse to the last value and any comments are gone before you ever see the output.