Toolhaus

JSON Formatter & Validator

Beautify, minify, and validate JSON with clear error messages.

Paste JSON to pretty-print it with 2-space indentation, or minify it to a single line. Invalid JSON is reported with the parser error so you can fix it. All local.

Valid JSON
—

Paste your JSON into the text area, then click Beautify to pretty-print it with 2-space indentation, or Minify to compact it to a single line. If the JSON is invalid, the tool shows the parser error instead of output so you can locate and fix the problem.

Formula & methodology

Parsed with the native JSON parser and re-serialized. Invalid input surfaces the exact parser error.

Worked example

  • {"a":1} → {\n "a": 1\n}

Common mistakes

  • Trailing commas after the last item in an object or array, e.g. {"a": 1,} — standard JSON does not allow these.
  • Using single quotes instead of double quotes for strings and keys, e.g. {'a': 1} instead of {"a": 1}.
  • Adding comments (// or /* */) — some config formats allow them, but standard JSON does not.

Frequently asked questions

Is my JSON uploaded anywhere?

No. Parsing and formatting happen entirely in your browser.

Does it support comments?

No. Standard JSON does not allow comments.

Why does it say my JSON is invalid when it looks fine?

Common causes are trailing commas, single quotes, unquoted keys, or a stray comment. The error message points to the exact position the parser stopped at, so check just before that spot.

Does minifying change the data?

No. Minify only removes whitespace and line breaks; the values and structure stay exactly the same. Beautify just adds indentation back for readability.

What is the difference between beautify and minify?

Beautify formats JSON with 2-space indentation so it is easy to read. Minify strips all unnecessary whitespace to produce the smallest possible output, which is useful for sending over a network or storing compactly.

Privacy

All processing happens locally in your browser. Your data is never uploaded.

Read the practical guide for this category.

Related tools