Skip to main content
Convert2JSON Tools

JSON Validator

Find out whether a document is valid JSON and, when it is not, precisely which character broke it.

Your data stays on your device

JSON to validate

characters
0
lines
0
size
0 B

This page checks syntax and structure. To validate a document against a JSON Schema, use the JSON Schema Validator.

About this tool

JSON is unforgiving: one stray comma after the last array element or a single-quoted string makes an entire payload unparseable. Runtime parsers tend to report only a character offset, which is useless when you are staring at a 4,000 line file.

This validator translates the offset into a line and column, prints the surrounding text with a caret under the problem, and explains the most probable cause. It also surfaces issues that are technically legal but usually bugs, such as duplicate keys in the same object.

How to use this tool

  1. Paste the JSON you want to check, or upload a file.
  2. Enable "Detect duplicate keys" if you want warnings for repeated keys inside the same object.
  3. Press Validate. Valid documents show a green summary with structure statistics.
  4. For invalid documents, jump to the reported line in the editor and fix the highlighted character.

Key features

  • Line and column resolution for every syntax error
  • Excerpt of the offending text with a caret marker
  • Plain-language explanation of the likely cause
  • Optional duplicate-key detection with the path of each duplicate
  • Structure report: total keys, maximum nesting depth, array and object counts
  • Extensible validation pipeline designed to accept JSON Schema checks

Example

A trailing comma is located precisely

InputJSON

{
  "port": 8080,
  "hosts": ["a", "b",],
}

OutputReport

Invalid JSON
Line 3, column 21 — a value was expected but "]" was found.
Hint: remove the comma after the last array element.

Good to know

  • This page validates syntax and structure. Schema validation against a JSON Schema document is not enabled yet — the pipeline is built for it, but the UI does not expose it.
  • Duplicate-key detection re-scans the raw text, so it is slower than plain validation on very large inputs.
  • JSON5, JSONC (comments) and NDJSON are separate formats and are correctly reported as invalid JSON here.

Frequently asked questions

Are duplicate keys actually invalid JSON?

No. The specification allows them and most parsers keep the last occurrence, silently discarding earlier values. Because that is almost never intentional, this tool reports them as warnings rather than errors.

Why does my config file fail validation?

Configuration files frequently use JSONC, which permits // comments and trailing commas. Those are extensions, not JSON. Strip them before validating, or treat the file as JSONC in your tooling.

Does a valid result mean my data is correct?

Only that it is well-formed. Whether a field is missing, mistyped or out of range is a schema question, not a syntax question.

What is reported as the maximum depth?

The longest chain of nested objects and arrays from the root. Deeply nested documents (over roughly 100 levels) can exhaust the stack in some parsers, so the number is worth watching.

Your data stays on your device

Your data is processed locally in your browser and is not uploaded to our server. This page keeps working after you go offline, because there is nothing to send.

Share this toolXLinkedInHacker News