Free & unlimited

JSON Formatter & Validator

Format, validate, and minify JSON instantly in your browser.

What this tool does

Validates JSON and pretty-prints it with proper indentation, or minifies it down to a single line. If the JSON is invalid, it shows the exact parse error so you can find and fix the problem.

Parsing and formatting happen entirely in your browser using JavaScript's built-in JSON support — nothing you paste is uploaded.

How to use this tool

1Paste your JSON into the input box — a single object, an array, or a full API response.
2Click Format for readable indented output, or Minify to strip all whitespace into one line.
3If it's invalid, read the error message — it names what went wrong and roughly where.
4Copy the result with the Copy button.

Why valid-looking JSON gets rejected

Strict JSON is a stricter format than a JavaScript object literal. These are the usual culprits:

  • Trailing commas — a comma after the last item in an object or array is fine in JS, invalid in JSON.
  • Single quotes — JSON requires double quotes for both keys and string values.
  • Unquoted keys — {name: "x"} must be {"name": "x"}.
  • Comments — neither // nor /* … */ is allowed anywhere in JSON.
  • Stray values — undefined, NaN, and Infinity aren't valid; a leading zero or a hanging decimal point breaks a number.

Format makes JSON readable for debugging; Minify shrinks it for storage or transport, where every byte over the wire counts.

FAQ

It says my JSON is invalid but it looks fine — why?
Almost always a trailing comma, a single quote where a double quote is required, an unquoted key, or a comment. The error message points to the character position where the parser gave up.
What's the difference between Format and Minify?
Format adds newlines and two-space indentation so it's readable. Minify removes every optional space and newline to make the smallest possible valid JSON. Both produce the same data.
Does formatting change my data or reorder keys?
No. It re-serialises the exact same values in the exact same order — only the whitespace changes.
Is there a size limit?
No hard limit, but very large input (tens of megabytes) can be slow or memory-heavy since it all parses in your browser tab.
Is my data uploaded anywhere?
No. It's parsed with the browser's native JSON engine, locally — nothing is sent to or stored on a server.