Output JSON

Choose Format JSON to see an indented result.

Make a JSON response easier to inspect

An API response can be valid JSON and still be difficult to read. Formatting adds indentation around objects and arrays so you can follow their structure. Use minification when you need the same data without unnecessary whitespace; neither operation checks your application’s business rules.

Why valid-looking JSON fails to parse

How to use JSON Formatter

  1. Paste JSON into the input editor or upload a .json file up to 5 MB.
  2. Choose an indentation level and click Format JSON.
  3. Copy or download the result.

Practical examples

Expand a compact API response

Input or settings

{"user":{"id":7,"active":true},"roles":["editor"]}

Expected result

{
  "user": {
    "id": 7,
    "active": true
  },
  "roles": [
    "editor"
  ]
}

Choose two spaces, then Format JSON. Indentation reveals which fields belong to the user object.

Minify without rounding an identifier

Input or settings

{
  "id": 9007199254740993,
  "ready": true
}

Expected result

{"id":9007199254740993,"ready":true}

The formatter preserves the original numeric tokens instead of serializing rounded JavaScript numbers.

Valid syntax is only the first check

Keys and string values need double quotes. Comments, trailing commas, undefined, and NaN are not JSON. On a syntax error, check the reported position and the punctuation immediately before it.

Formatting preserves key order and number spelling. It does not sort keys, remove duplicate keys, validate a schema, or prove that required fields exist. Avoid duplicate object keys because other applications may keep only the last value.

Local uploads are limited to 5 MB. Pretty printing stops beyond 256 nesting levels or 5 million output characters; use smaller sections or minification for unusually large documents.

When this tool helps

  • Inspect nested API responses before writing a client.
  • Validate a configuration file before committing it.
  • Prepare a compact JSON fixture for a request body.

Questions about JSON Formatter

Can I format a JSON array or a single value?

Yes. Arrays, strings, numbers, booleans, and null are valid top-level JSON values, as well as objects.

Will this fix invalid JSON automatically?

No. It reports a parse error so you can repair the source without silently changing its meaning. Check quotes, commas, and matching brackets first.

Is the downloaded file a backup of my input?

The JSON download contains the processed result. Keep your original separately if you need its exact whitespace. Results are not saved as an account history.