CalcHub

JSON Formatter & Validator — Pretty-Print and Find Errors

Paste JSON to validate and pretty-print it — with error location (line and column) when it's broken, plus key count, depth and size stats. Runs entirely in your browser.

Waiting
Paste content above
The tool runs instantly, entirely in your browser.

Last reviewed 2026-10-19. Rates change — verify against the official sources linked below before relying on these figures.

What this is based on

  • Strict JSON per RFC 8259 — comments, trailing commas, single quotes and unquoted keys are invalid (that's JSONC/JSON5, a different format).
  • Everything runs locally in your browser — pasted content is never uploaded, logged or stored.

The five errors behind 95% of invalid JSON

Trailing commas (valid in JS objects, fatal in JSON), single-quoted strings, unquoted keys, comments, and a truncated paste from a log file. When this validator reports an error, the line/column it shows points at the first place parsing failed — which is usually a few characters after the actual mistake.

If your file uses any of the above deliberately, it's probably JSONC or JSON5 — formats that look like JSON but allow comments and trailing commas. Config files for VS Code, tsconfig and many tools are JSONC, not JSON.

Why browser-side validation matters

API responses routinely contain tokens, user data and internal URLs. Server-side formatters send your payload to someone's backend — this one runs entirely in the tab you're looking at, so production payloads and signed responses stay private. Open DevTools → Network while you paste; nothing is sent.

Frequently asked questions

Why does my JSON fail with single quotes?
JSON requires double-quoted strings and keys — {'a':1} is a JS object literal, not JSON. Use double quotes throughout.
Are trailing commas allowed in JSON?
No — [1,2,] is invalid JSON though valid JavaScript. JSONC/JSON5 (VS Code configs) do allow them.
What's the biggest JSON this can handle?
Comfortably into the tens of megabytes — it's bounded by your browser's memory, not a server limit. For multi-GB files, use a streaming tool like jq instead.
How do I minify instead of format?
Strip it in code (JSON.stringify(JSON.parse(x))) — this tool pretty-prints only, since that's what humans debugging payloads need.

Related calculators