JSON Formatter

Turn compact JSON into readable two-space indentation. Load an example or paste JSON to check its syntax and format it.

Your input is processed in this browser and is not uploaded.

JSON Formatter

Turn compact JSON into readable indentation while checking that it parses. Formatting helps inspect API responses and fixtures; it does not validate their business meaning.

How to use it

  1. Select Load example or paste JSON into Input text. The example button replaces the current input and clears old output.
  2. Select Format JSON. A parse error leaves no formatted output.
  3. Inspect the values, then copy or download the result.

Worked example

{"active":true,"items":[1,2]}

formats as:

{
  "active": true,
  "items": [
    1,
    2
  ]
}

Limits and troubleshooting

  • Single quotes: change {'name':'Ada'} to {"name":"Ada"}. JSON property names and strings need double quotes.
  • Trailing commas: change {"items":[1,2,]} to {"items":[1,2]}.
  • JavaScript comments: remove comments and express the data as JSON; this tool does not execute JavaScript.

Parsing and serialization use JavaScript. Numbers outside its safe integer range can lose precision; quote long numeric identifiers before processing. A numeric literal beyond JavaScript's finite range, such as 1e400, serializes as null, so inspect numbers before using the result. Repeated object keys retain only their last value. Comments, trailing commas, unquoted keys and single-quoted strings are rejected. Limit: 200,000 input characters.

Frequently asked questions

Does valid JSON mean an API request is valid?

No. Required properties, types and application rules need JSON Schema or the receiving API’s validator.

Can formatting preserve duplicate keys?

No. Parsing resolves duplicate keys before serialization. Keep an untouched source copy if those distinctions matter.

Reference

For a syntax verdict without formatted output, use JSON Validator. To inspect changes between two formatted versions, use Text Compare. An array of objects can be exported as columns with JSON to CSV; arbitrary nested JSON is not automatically flattened into a spreadsheet.

RFC 8259 defines JSON syntax and discusses interoperability limits for numbers and repeated object names.