JSON Formatter — Validate & Format Online | nopa

Text & data

Format JSON

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

Try it now — no account needed

Save and continue on the desktop

Download or copy your result here first. Continue in nopa to save to Files or use more features.

  • Format, validate, and minify JSON in your browser
  • Results saved to Files automatically
  • 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.

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. In practice the three culprits are always the same: 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 what that costs

Parsing 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. Numbers go through JavaScript too, which matters for long IDs — anything above 9,007,199,254,740,991 comes back with the last digits changed. If your API returns 19-digit identifiers, they need to be strings on the wire.

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. In the full app the live preview stops re-formatting on every keystroke past about 80,000 characters; the Format button still works.

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 — open the full JSON app in nopa to switch between pretty-print and compact output.

What happens when I continue in the desktop?

Your JSON is pre-filled. Save to Files and reuse it across apps.