Toolora

JSON Formatter and Validator

Paste JSON to format, minify or check it. Errors point at the line and column that broke. Everything runs in your browser.

Output style

Everything runs in your browser. Nothing you paste is uploaded.

How it works

  1. Paste or type JSON into the input pane. The result updates as you type — there is no button to press first.
  2. Choose Format for readable output, or Minify to strip every byte of insignificant whitespace.
  3. Pick your indentation: two spaces, four spaces, or tabs.
  4. If the JSON is broken, the error names the line and column so you can go straight to it.
  5. Copy the result to your clipboard, or download it as a .json file.

Your data never leaves the browser

Parsing happens locally with the browser’s own JSON engine. Nothing you paste is sent anywhere, which matters when the document you are debugging is an API response containing tokens, customer records or anything else you would not paste into a stranger’s server. Once the page has loaded, the tool keeps working offline.

Common questions

Why is my trailing comma an error? It works in JavaScript.
JavaScript has allowed trailing commas in object and array literals for years, but JSON is a separate, much stricter format that never adopted them. `{"a": 1,}` is valid JS and invalid JSON. It is the single most common reason a config file that looks fine gets rejected.
Can I use comments in JSON?
No. JSON has no comment syntax at all — neither `//` nor `/* */`. Formats that do allow them, like JSON5 and JSONC (what VS Code uses for its settings), are different languages that happen to look similar. If your file needs comments, it is not JSON, and a strict parser will reject it.
Why does my large ID number change?
JSON numbers become JavaScript doubles, which hold integers exactly only up to 9,007,199,254,740,991 — about 9 quadrillion. Beyond that, digits are silently rounded, so a 20-digit database ID can come back different. Every JavaScript-based tool has this limit, including this one. If you handle IDs that large, transmit them as strings.
Are NaN, Infinity and undefined allowed?
None of them. JSON only has strings, numbers, booleans, null, objects and arrays. `NaN` and `Infinity` are valid JavaScript numbers but not valid JSON, and `undefined` has no JSON equivalent at all — `JSON.stringify` drops object properties holding it rather than encoding them.
Does formatting reorder my keys?
No. Key order is preserved exactly as written. The JSON specification says object key order is not meaningful, but every mainstream parser preserves insertion order in practice, so a formatted file stays diff-friendly against the original.
Is it safe to paste a JSON payload from an untrusted source?
Yes. Parsing JSON does not execute it — that is the whole reason `JSON.parse` exists rather than `eval`. A `__proto__` key arrives as ordinary data and does not alter any prototype. The output is only ever written as text, never inserted as HTML.