JSON Formatter

Indent or validate JSON while keeping big numeric literals from being rounded.

Input

Processed on your device

How to use JSON Formatter

Format JSON for code reviews, documentation or inspecting a packed API response. Choose indentation and reveal the tree structure while retaining the original order of properties and the exact numeric literals, including large integers.

  1. Paste valid JSON or open a .json file.
  2. Select Indentation, run Format JSON and inspect the result.
  3. Copy it into a review or download a separate formatted file.
Example input
{"title":"Field Notes","inStock":true,"quantity":12,"tags":["paper","stationery"]}

Example use

A service returned a long single line with customer-safe example data. Indent it by two spaces, then compare one nested array and a long integer with the source. Use the tree viewer when you need to collapse unrelated branches before inspecting a specific field.

Output and compatibility

The formatter parses the input to validate syntax, then reorganizes whitespace outside strings. It preserves the original string escapes and number spelling. Comments, unquoted keys and trailing commas are invalid in strict JSON. Some JSON consumers may still round a large integer when they later parse the formatted result.

Troubleshooting

If formatting fails, check the error near brackets, quotes and trailing commas. Try JSON Repair only when you can review what the repair changes. Empty input and two separate top-level values also fail; for one record per line, use the NDJSON converter.

Use JSON Diff to review structural changes or JSON Schema Validator to test conformance to a supplied schema.

Frequently asked questions

Does it support tabs or spaces?

Use Indentation to select the spacing that matches your project.

Will it round long integers or standardize exponent notation?

It keeps number tokens exactly as written, while validating the overall document.

Does it alphabetize keys?

It keeps the input order. Choose Sort JSON Keys if you want canonical-looking ordering and can accept reserialization.

Can I format JSON5 or JavaScript object syntax?

This formatter expects strict JSON. Check the producer or use JSON Repair for malformed data you can verify.

Does it send my API response to a server?

The page formats the text locally. Remove unnecessary credentials before sharing the result elsewhere.

Can I get one line instead?

Use JSON Minifier to strip formatting whitespace.

Find a tool