1666889← Home

JSON Formatter

Paste JSON on the left and get clean, indented JSON on the right — or minify it to one line. Everything runs 100% in your browser: what you paste never leaves your computer, there is no account and no sign-up. The formatter also catches the three mistakes that waste the most debugging time: trailing commas, big numbers that JavaScript would silently round, and duplicate keys that JSON.parse would silently drop. When something is wrong you get the exact line and column, the offending line, and a pointer showing where to fix it — not a vague “Unexpected token”.

Paste JSON on the left. It is formatted in your browser — nothing is uploaded.

How to use it

  1. Paste your JSON into the input box, or click “Upload file” (or drag a .json file onto the input box) to load a file — the file is read locally in your browser, never uploaded. It is checked as you type (large pastes over 100,000 characters wait for the Format button so the page never freezes).
  2. Pick an indent — 2 spaces, 4 spaces or a tab — or hit Minify for a single line. Turn on “Sort keys” to order object keys alphabetically.
  3. Copy the result or download it as a .json file. If the result is very long, only the first part is shown — Copy and Download always give you the full text.
  4. Read the warnings: a big integer is kept exactly as written, and a duplicate key keeps only its last value. If the JSON is nested too deep (around 5,000 levels or more) the page tells you so instead of failing silently — flatten it or split it into smaller files.

FAQs

Frequently asked questions

Why does my JSON say “trailing comma”?

JSON does not allow a comma after the last item in an object or array. Remove the comma before } or ]. The formatter points at the exact line and column.

Why did my big number change?

JavaScript numbers are 64-bit floats, so integers beyond 9,007,199,254,740,991 (2^53 − 1) get rounded by JSON.parse — snowflake IDs and 64-bit database keys are the usual victims. This tool keeps big integers exactly as written and warns you about them.

What does “duplicate key” mean?

The same key appears twice in one object, for example {"a": 1, "a": 2}. That is legal JSON, but only the last value survives — usually a copy-paste mistake. The formatter warns you and shows where the second key is.

Can I upload a JSON file instead of pasting?

Yes. Click “Upload file” next to the input box, or drag a .json file onto it. The file is read locally with file.text() in your browser and never sent anywhere. Files over 100,000 characters wait for the Format button, same as pasted text.

What does “nesting too deep” mean?

The JSON has around 5,000 or more levels of nesting, which exceeds the browser’s call stack. The formatter now says so on the page instead of failing silently. Flatten the structure or split it into smaller files and try again.

Is my JSON uploaded anywhere?

No. The formatter is pure JavaScript running in your browser. Nothing is sent to a server, there is no account and no tracking of what you paste. You can even disconnect from the internet after the page loads and it keeps working.

What is the difference between Format and Minify?

Format adds line breaks and indentation so the structure is easy to read. Minify removes all unnecessary whitespace so the JSON takes as little space as possible — useful for pasting into a request body or a config file.

More tools are coming. Back to thetool list.