Skip to content

JSON Validator

Validate JSON with precise error location and human-friendly explanations. Supports JSON5 and JSONC with comments and trailing commas. 100% client-side.

Input
Drop a JSON file to validate

What is a JSON Validator?

A JSON validator checks whether a piece of text conforms to the JSON specification (RFC 8259). Unlike a formatter which assumes valid input, a validator's primary job is to tell you exactly what is wrong and where — line number, column, and a clear error message — so you can fix it fast.

This validator supports three modes: strict JSON, JSONC (JSON with Comments, used by VS Code configs andtsconfig.json), and a relaxed JSON5 mode that additionally allows unquoted keys and single-quoted strings.

How to use this JSON Validator

  1. Select your validation mode — Strict JSON, JSONC, or JSON5.
  2. Paste your JSON into the input box, or drop a file. Validation is instant and updates as you type.
  3. If invalid, the error panel shows the exact message and line/column number.
  4. Click Attempt Fix to see a repaired version using jsonrepair.
  5. Click Use repaired JSON to replace the input with the fixed version.

Why validate JSON with a private tool?

Config files, API payloads, and exported data often contain sensitive values — database credentials in config JSON, PII in API responses, proprietary schema structures. Pasting these into a server-side validator means your data is processed on someone else's machine and potentially logged. This validator runs entirely in your browser: the JSON never leaves your tab.

JSONC vs JSON5 — what's the difference?

JSONC (JSON with Comments) adds single-line (// …) and block (/* … */) comments, plus trailing commas after the last item. It is used by VS Code's settings.json, TypeScript'stsconfig.json, and many other developer tools.

JSON5 goes further: unquoted property names, single-quoted strings, hexadecimal numbers, multi-line strings, and positive/negative Infinity. It is less common but occasionally appears in Babel configs and custom serialisers.

Frequently Asked Questions

What is the difference between JSON and JSON5?

JSON5 is a superset of JSON that allows comments, trailing commas, single-quoted strings, and unquoted keys. It is common in config files like tsconfig.json.

How do I find the exact line of a JSON error?

The validator reports the exact line and column of every error, and highlights the offending character in the editor.

Can I validate JSONC (JSON with Comments)?

Yes. Toggle the "Allow Comments" option to validate .jsonc files used by VS Code and other tools.

Why is my JSON invalid even though it looks correct?

Common gotchas include trailing commas after the last item, single quotes instead of double quotes, and unquoted property names.