Skip to content

JSON Formatter & Validator

Format, minify and validate JSON in your browser, with the parser’s own error message when the input is invalid.

Paste JSON

Result

Paste JSON, then format or minify.

Your file is never sent to a server. It is read and processed by your own browser, and the results are not stored.

How to use it

  1. Paste JSON into the input box.
  2. Choose Format · 2 spaces, Format · 4 spaces or Minify.
  3. Copy the result. Invalid input shows the parser error, not a guess.

Limits worth knowing

  • Strict JSON only. Comments and trailing commas are refused, not stripped.
  • Error line/column appear only when the engine reports a position; otherwise the raw parser message is shown.
  • Inputs above 5 MB are refused to keep the tab responsive.
  • Formatting does not preserve key order beyond what JSON.parse keeps.

Why strict JSON

JSON is a data interchange format with a precise grammar. Pretty-printing it should produce exactly the object that input describes; anything else risks silently changing the data. This tool uses the browser’s own JSON.parse, so the rules are the same the browser uses everywhere else.

The output is canonical: two-space or four-space indentation and no extra whitespace beyond that.

When the parser complains

The message comes straight from the engine. On modern V8 it includes a snippet of the offending input, which is usually enough to spot the stray comma, unquoted key or smart quote. Some engines also report a character position, which this tool converts to line and column.

If the input is valid JSON but you want something else from it, this is the wrong tool. It formats the structure you gave it, no more.

Frequently asked questions

Does JSON Formatter & Validator upload my files to any server?

No. JSON Formatter & Validator runs in your browser, and the file is read there rather than sent to a server for processing. Our host still sees ordinary page-request metadata, which is described on the privacy page.

Is JSON Formatter & Validator free to use?

Yes, JSON Formatter & Validator is free, with no paid tier, no account, and no watermark added to your output. The limits are technical rather than commercial: file size, page count and supported formats are listed on this page.

What file formats and sizes are supported?

JSON Formatter & Validator supports .json, .txt files up to 5MB directly in your browser.

What happens to invalid JSON?

The tool does not guess, repair or silently rewrite it. It shows the parser’s own error message, with line and column when the engine reports a position, or the raw message otherwise.

Does my JSON leave the browser?

No. The text you paste is parsed in this tab. There is no server request in this tool.

Why not a full JSON5 or JSONC mode?

The tool uses the strict JSON grammar. Comments and trailing commas are valid in JSONC and JSON5, not in JSON. If you need those, say so explicitly and use a JSONC-aware editor.