Pretty print JSON while keeping the original values intact
Formatting adds indentation and line breaks so a compact JSON document becomes easier to read and review. The source and formatted output remain separate.
When should you use it?
- Read a one-line API response.
- Prepare a diff-friendly sample for documentation.
- Inspect nested arrays without changing their values.
Example: format a compact response
Only structural whitespace changes. Names, values, and array order stay the same.
{"name":"Alex","roles":["author","reviewer"]}{
"name": "Alex",
"roles": [
"author",
"reviewer"
]
}Why preserving source tokens matters
A conventional parse-and-stringify formatter first converts JSON into language values. That intermediate step can change a large integer or rewrite number notation. This formatter works from the source tokens, so 9007199254740993, 1e3, and an escaped string keep their original spelling. Only whitespace outside strings is rearranged.
That makes the result useful for inspecting financial identifiers, exported database keys, and reproducible bug reports. It does not make every downstream parser precision safe; the application that eventually consumes the JSON still needs a suitable number representation.
Use indentation to reveal structure
Choose a consistent indentation width when preparing an example for a repository. Smaller indentation is convenient for deeply nested data; wider indentation can make short configuration files easier to scan. If you need to compare two payloads, format both with the same settings or use path comparison in JSON Diff to avoid differences caused only by layout.
A readable copy. An untouched source.
Format compact API responses into consistently indented JSON. Keep the input beside the result to review it, then copy or download the formatted document.
Open the compact response
Paste JSON or drag a local file into the workspace.
Choose indentation
Use two spaces, four spaces, or tabs.
Export the formatted copy
Copy or download; replace the source only when you choose.
How can I pretty print one-line JSON without rounding a large integer?
Paste the original JSON text into Formatter and choose an indentation width. The core formatter rewrites whitespace around tokens, so it keeps a number such as 9007199254740993 spelled exactly as received. A JavaScript parse-and-stringify round trip can lose that precision.
JSON: precision-sensitive input to paste
json{"invoice":{"id":9007199254740993,"paid":false}}The formatted result places invoice fields on separate lines but retains the same id token. Keep identifiers as strings in systems that cannot represent large integers exactly.
Will formatting fix a missing comma or change object values?
Formatting requires valid JSON and changes only structural whitespace. Use Validator for an error location or Repair for a reviewed syntax suggestion.
What should you check before using the result?
Formatting does not repair missing commas, verify schema rules, or shrink a payload. Use Minifier for compact transport and Validator for a precise syntax diagnostic.
Formatting preserves source tokens
Only whitespace outside strings changes. Large integers, decimal precision, exponent spelling, escaped strings, duplicate keys, array order, and object member order are preserved. Formatting does not sort or normalize values.
From formatting to editing
The input is editable and the output is read only. Use “Use result as input” to continue working on the formatted version, or open the editor for a format-in-place workflow. Undo restores the previous source.
Technical reference: JSON syntax and interoperability · RFC 8259