Skip to content
Free data tool

JSON formatter

This JSON formatter checks that your JSON is valid and rewrites it with clean, readable indentation. Developers, analysts and students use it to read API responses, fix config files and find the exact spot where a JSON document breaks.

  • Runs in your browser
  • Free, no account needed
  • Copy or download the result
Private: runs on this device

Input

44 characters

Result

{
  "name": "Ada",
  "active": true,
  "scores": [
    12,
    9
  ]
}

Example

Input
{"name":"Ada","active":true,"scores":[12,9]}
Result
{
  "name": "Ada",
  "active": true,
  "scores": [
    12,
    9
  ]
}

How to use the json formatter

  1. Paste your JSON into the JSON box.
  2. Pick an Indentation option: 2 spaces, 4 spaces, Tabs or Compact.
  3. Press Run to validate and format it.
  4. Press Copy result, or Download to save it as a text file.

How it works

Compact removes every extra space and line break, so it also works as a JSON minifier.

Strict JSON rules apply. Comments, trailing commas and single-quoted strings are rejected, and the error names the character position to check.

Duplicate keys in the same object are rejected instead of silently keeping one value. The keys __proto__, prototype and constructor are rejected too.

Integers above 9007199254740991, or numbers with more digits than JavaScript can store exactly, are rejected so they are not changed by accident. Put them in quotes to keep them as text.

Numbers are written in their shortest form, so 1.50 becomes 1.5. Nesting deeper than 100 levels or more than 100,000 values is rejected.

Everything runs in your browser. Your input is not uploaded or stored.

Questions and answers

How do I format JSON online?

Paste the JSON into the box, choose an indentation, and press Run. The formatted result appears below, ready to copy or download.

Why does my JSON show an error?

The tool follows the strict JSON standard. Common causes are trailing commas, comments, single quotes or a missing quote, and the message tells you which character to look at.

Can it minify JSON?

Yes. Choose Compact in the Indentation menu to get the same data on one line with no extra spaces.

Is my JSON uploaded to a server?

No. The formatter runs in your browser, and your input is not sent anywhere.

All 100 SnowRock tools