JSON validator & formatter

Validate JSON with native JSON.parse, pretty-print with 2-space indent, or minify — all in your browser. No upload to WebTooly.

Sample JSON

Load realistic examples—no fake ratings, traffic, or personal data.

About JSON Validator

Native `JSON.parse` for validity; on success, `JSON.stringify(parsed, null, 2)` to pretty-print or `JSON.stringify(parsed)` to minify. No JSON Schema or third-party repair libraries.

How it works (technical)

Validate & format and Minify run on button click only (not live while typing).

Failures surface `Error.message` from the runtime—often a character index in the pasted string, not a line/column gutter.

Grammar matches ECMAScript JSON: double-quoted keys/strings, no comments or trailing commas.

When to use it

  • API responses

    Confirm a body parses before mapping fields in client code.

  • Config and env samples

    Catch typos and quote issues before commit or deploy.

  • Readability

    Expand one-line JSON for review; minify again for compact wire form.

How to Use JSON Validator

  1. 1Paste JSON into the left field.
  2. 2Click “Validate & format” to parse and indent, or “Minify” for a single-line string.
  3. 3If parsing fails, read the error message and fix the syntax (often a trailing comma or single quotes).
  4. 4Use Copy to grab the output from the right field.

Key Features

  • `JSON.parse` / `JSON.stringify` only
  • Pretty-print (2 spaces) or single-line minify
  • Runtime parse errors
  • Sample payloads

Benefits

  • Strict syntax check with no upload
  • Formatted output for review
  • Minify removes structural whitespace only

Frequently Asked Questions

Why does the error point to a position, not a line number?

The browser reports character position in the string you pasted. In a textarea, you can jump to that offset in your editor or split on newlines to estimate the line.

Is JSON with single quotes valid?

No. JSON requires double quotes for strings and property names. Single quotes are a JavaScript convenience only.

Does this validate against a JSON Schema?

No. It only checks that the text parses as JSON. For schema validation you need a schema-aware tool or library.

Related Tools