JSON Validator

Validate JSON syntax instantly as you type. Pinpoints errors with line numbers — trailing commas, unquoted keys, missing brackets, invalid values. Paste your JSON and get an immediate pass/fail with a clear error message. Also formats and beautifies valid JSON in one click. 100% client-side — nothing sent to any server.

Frequently Asked Questions

What makes JSON invalid? Most common validation errors

The most common causes of invalid JSON:

— Trailing commas: {"a": 1,} or [1, 2, 3,] — JSON strictly forbids them, unlike JavaScript. — Single-quoted strings: JSON requires double quotes for both keys and values. — Unquoted keys: {a: 1} is valid JS but invalid JSON — keys must be double-quoted strings. — Comments: JSON has no comment syntax. // and /* */ will cause a parse error. — undefined and NaN: these are not valid JSON values. Use null instead. — Mismatched brackets: a missing } or ] is the hardest to spot in large payloads.

What is the difference between JSON validation and JSON formatting?

Validation checks whether a string is valid JSON — it either parses successfully or fails with an error. It's a yes/no check.

Formatting (also called beautifying or pretty-printing) takes valid JSON and re-renders it with consistent indentation and line breaks for readability. You can only format JSON that is already valid.

This tool does both: it validates as you type and formats on demand.

Does valid JSON mean the data is correct for my application?

No. JSON validation only checks syntax — it cannot verify that the data matches your expected structure, types, or business rules.

For structural validation (required fields, correct types, value ranges) you need JSON Schema, which is a separate standard. Tools like Ajv (JavaScript) or jsonschema (Python) can validate a JSON payload against a schema.

Think of it in two layers: JSON validation = is this parseable text? JSON Schema validation = does this data match the expected contract?

Why does JSON.parse() succeed in my code but the validator says it's invalid?

Some JavaScript environments are lenient and extend JSON.parse() to accept comments or trailing commas (older V8 versions, some edge cases). The JSON spec (RFC 8259) is strict.

More commonly, the issue is encoding: the validator receives the string with escape sequences or encoding that the browser's JS engine handles automatically. If your JSON contains BOM characters (\uFEFF at the start) or non-printable control characters, it may pass JSON.parse() but fail a strict validator.

What is the maximum size of a valid JSON file?

The JSON specification (RFC 8259) imposes no size limit. Practical limits come from the parser and runtime: Node.js's JSON.parse() can handle files in the hundreds of MB before hitting V8's string size limit (~512 MB). Browsers are more constrained by available memory.

For very large JSON files (10 MB+) you should consider streaming parsers (jsonstream in Node.js, ijson in Python) instead of loading the full string into memory at once.