JSON Validator, Lint & Syntax Checker Online
Free online JSON validator and lint tool. Catch trailing commas, single quotes and unquoted keys with the exact line and column of every error. No upload.
JSON InputInput
Validation ReportOutput
Paste JSON on the left — the verdict, error position and structure metrics appear here.
A JSON validator checks text against the RFC 8259 grammar and reports the exact line and column of any syntax error, so invalid JSON can be fixed in seconds. Paste JSON on the left; the right pane shows valid or invalid status, the failing line, and stats such as key count, nesting depth, and byte size.
JSON2X validates documents against RFC 8259, the specification that defines JSON, and reports the line and column of the first token that violates it. Validation runs in the browser, so a payload containing bearer tokens or personal data never leaves the machine. Structural validation against a JSON Schema is a separate step — this tool answers the narrower question of whether the bytes are legal JSON at all.
What makes JSON invalid?
RFC 8259 is deliberately small, and almost all real failures come from a handful of habits carried over from JavaScript. Trailing commas after the last array element or object member are illegal. Strings must use double quotes — 'a' is not a JSON string. Object keys must be quoted, so {name: 1} fails while {"name": 1} passes. Comments do not exist in JSON. NaN, Infinity, and undefined are not JSON values. Literal control characters, including raw newlines and tabs, must be escaped inside strings.
Is valid JSON the same as correct data?
No, and conflating the two causes real outages. Syntax validation proves a parser will accept the bytes. It says nothing about whether email is present, whether age is a number rather than a string, or whether status is one of your allowed values. Those are schema concerns. Validate syntax first to rule out transport and encoding problems, then generate a JSON Schema or a Zod schema to assert the shape.
Why does the error position matter more than the message?
Parser messages are notoriously vague — “Unexpected token } in JSON at position 4471” tells you nothing on a single-line file. Reporting line and column lets you jump straight to the fault, and because the input pane is the same pane you edit in, the fix and the re-check happen in one place. For deeply nested documents it is often faster to format first, so the reported line number corresponds to something you can see.
How to use the JSON Validator
Takes under a minute. Nothing is uploaded — every step runs in this browser tab.
- Paste the document
Put the suspect JSON into the left-hand input pane. Validation is live: results update as you type, debounced so large documents stay responsive.
- Read the verdict
The right-hand report pane shows either a pass, with node and key counts and byte size, or a fail with the exact line, column, and offending token.
- Fix and re-check
Correct the reported position and the report updates immediately. Only the first error is reported, because a parser cannot reliably continue past a structural fault.
When to use it
- Confirming a config file is parseable before a deployment reads it
- Locating the line a CI job meant when it logged “Unexpected token”
- Checking a hand-written fixture before committing it to a test suite
- Verifying a third-party webhook body is legal JSON and not, say, JSON5
- Teaching the difference between valid JSON and valid JavaScript object literals
Step-by-step guides for this tool
Task-specific walkthroughs covering the most common ways this tool gets used.
Searches this page answers
- free json validator online
- online json validator tool
- json validator and formatter
- json validator with schema
- json lint online
- json checker online
- fix json online
- json repair tool
- json fixer online
- validate json file online
- find json error line number
- is my json valid
- rfc 8259 json validator
Frequently Asked Questions
How do I validate JSON syntax online?
Paste your JSON into the editor. The validator instantly checks the payload against official IETF RFC 8259 syntax specifications and highlights any syntax errors with exact line and column numbers.
What is JSONLint and how does this validator compare?
JSONLint is a classic JSON syntax validator. JSON2X provides identical strict RFC 8259 validation, plus modern dark mode, instant keystroke validation, structural statistics (depth, keys, arrays), and zero server uploads.
What are the most common JSON syntax errors?
The most frequent errors include: trailing commas after the last array/object item, using single quotes ('str') instead of double quotes ("str"), unquoted property keys, JavaScript comments (// or /* */), and missing closing brackets.
Does standard JSON support comments (// or /* */)?
No. Standard JSON (RFC 8259) does not support comments of any kind. If you need comments in configuration files, consider formats like JSONC, JSON5, YAML, or TOML.
Why are single quotes invalid in JSON?
The JSON specification strictly mandates double quotation marks (") for all string literals and property names. Single quotes are valid in JavaScript object literals, but invalid in JSON strings.
What does "Unexpected token" or "Unexpected end of JSON input" mean?
"Unexpected token" means the parser encountered a character where it was not expected (e.g. a misplaced comma or colon). "Unexpected end of input" means brackets or quotation marks were opened but never closed before the end of the file.
Can JSON keys be numbers or unquoted identifiers?
No. In valid JSON, every key must be a double-quoted string (e.g. {"123": "value"}). Unquoted keys like {name: "Alice"} or numeric keys like {1: "val"} will fail validation.
How do I fix or repair invalid JSON?
Work from the reported line and column outward. The four faults behind most failures are a trailing comma before a closing bracket, single quotes instead of double quotes, an unquoted key, and an unclosed bracket or quote. Correct the flagged character, and validation re-runs on the next keystroke — then send the result through the JSON Formatter to re-indent it.
Can I validate JSON against a schema as well as its syntax?
This page enforces RFC 8259 syntax. For contract checks — required fields, types, enums, string formats — use the JSON Schema Generator to derive a Draft-07 or 2020-12 schema from a known-good payload, then validate future payloads against that schema in your own test suite or CI pipeline.
What RFC specification does this JSON validator enforce?
It strictly enforces IETF RFC 8259 (and ECMA-404), which defines the universal grammar for JavaScript Object Notation data exchange.
Related Developer Tools
- Standards & references:
- JSON
- RFC 8259
- JSON Schema
Last reviewed by the JSON2X Engineering Team.