Text & data

Format JSON

Paste JSON to pretty-print it, spot errors, and copy the result, or save it as a file in nopa.

Try it here, no account needed

Save and continue on the desktop

Download or copy your result here first. Open the free desktop to save to Files or use more features.

  • Tidy up JSON and see exactly where it breaks
  • Save to Files when you continue on the desktop
  • Every tool in one place, no new tabs
Open the free desktop

After you download, continue on the desktop for Files or the full app.

What JSON Formatter can do

Two-space indent, and nothing else touched

The output is your data re-serialized with two-space indentation, the default almost every codebase and diff tool expects. Keys stay in the order they arrived, values are untouched, and the only thing that changes is whitespace. There is no indent picker here on purpose: one predictable shape means a formatted file diffs cleanly against the last one.

Where the error message points

Invalid JSON gets the browser’s own parser message translated into a line and column, with the offending line printed and a caret under the exact character. Long lines are windowed so the caret stays visible. The usual culprits: a comma after the last item in an object or array, single quotes where JSON demands double, and a real line break sitting inside a string.

Strict JSON only, and every digit kept

Validation runs through the browser’s JSON engine, so comments and trailing commas are rejected: a tsconfig or a .jsonc file will fail here, and that is the format’s rule, not a missing feature. The text itself is never parsed into JavaScript values and written back. It is re-indented token by token. So an ID above 9,007,199,254,740,991 keeps its last digits, 1.10 stays 1.10, and a duplicated key is not quietly dropped: a 19-digit order number comes out exactly as it went in.

Related apps

Questions

Is there a size limit?

No fixed limit. Everything runs in your browser tab, so a few megabytes is fine and the pause you notice is your own CPU. Past about 80,000 characters the output stops following every keystroke, here and in the full app alike: press Format (or Minify) to see it.

Why does my config file fail with "unexpected token"?

Almost certainly comments or a trailing comma. Both are legal in JSON5 and .jsonc, neither is legal in JSON, and the strict parser stops at the first one. Delete them and the same file validates.

Can I minify JSON too?

Yes, right here: switch the output from Format to Minify and it becomes one line with no extra spaces, and Copy then takes that version. Values stay exactly as written either way.

What happens when I continue on the desktop?

Your JSON opens already pasted in the JSON app. Each Format or Minify there keeps a copy in Files without a save button, and you can download it as a .json file.