JSON Validator

Validate JSON and pinpoint the exact error location.

Open tool

Overview

The JSON validator parses a JSON document, reports whether it's syntactically valid, and pinpoints the exact line and column of the first error if it isn't. Beyond just yes/no, it surfaces the kind of mistake — unterminated string, missing comma, trailing comma, unexpected token — so you can fix it without re-reading the whole document.

It's the simplest tool a developer uses when an API request returns "400 Bad Request, malformed JSON". Frontend developers, API consumers, and anyone hand-editing JSON config use a json validator to find and fix the comma they forgot at 2 AM.

How it works

The parser implements strict JSON per RFC 8259 / ECMA-404. Each parse error includes the byte offset, the surrounding token, and a human-readable explanation. Common mistakes — single-quoted strings, unquoted keys, trailing commas, comments — get a specific error message rather than a generic "syntax error", so the fix is obvious.

For documents written in JSON5 (with comments, trailing commas, and other extensions), use the JSON5 decoder first to convert to strict JSON, then validate. The two-step keeps the validator focused on what conforming consumers actually accept.

Examples

Input:
{
  "name": "Alice",
  "age": 30,
}

Result: FAIL — line 4, column 1: trailing comma not allowed in JSON
Input:
{ "name": "Alice }

Result: FAIL — line 1, column 11: unterminated string
Input:  {"name":"Alice","age":30}
Result: PASS

FAQ

Does it check more than just syntax?

It only checks syntax — whether the document parses. For type and structural validation against a schema, use the JSON Schema validator.

What about duplicate keys?

JSON technically allows duplicate keys, though most parsers keep only the last. The validator flags duplicates as a warning so you can spot accidental overrides in hand-written config.

Can I validate a large file?

Yes — the parser is streaming-friendly and handles documents up to several megabytes in the browser. Beyond that, run a native validator at the command line; in-browser tabs have memory limits.

Try JSON Validator

An unhandled error has occurred. Reload ×