JSON Validator

Free Online JSON Validator

Check whether your JSON is valid, pinpoint syntax errors with line numbers, and validate against a JSON Schema, all in your browser.

No sign-up to start · Runs in your browser

JSON Validator
Open in full editor
Input
Tree
Valid JSON will appear here as a collapsible tree.

Runs entirely in your browser — nothing is uploaded.

{"service":"api","version":"2.4.0","enabled":true,"endpoints":["/v1/users","/v1/orders"],"limits":{"ratePerMin":600,"maxPayloadKb":512},"maintainer":{"name":"Ada Lovelace","email":"ada@example.com"}}
A JSON validator checks that your data is well-formed according to the JSON specification (RFC 8259) and, optionally, that it matches a JSON Schema. JSON Copilot validates as you type, pinpointing the exact line, column, and reason for any syntax error. Schema validation against a Draft-07 schema is available separately in the editor's schema panel. Everything runs in your browser, so your JSON is never uploaded and there is no sign-up.

From invalid to valid: fixing a trailing comma

Invalid JSON
{
  "user": "ada",
  "roles": ["admin", "editor",],
  "active": true
}
Valid JSON
{
  "user": "ada",
  "roles": ["admin", "editor"],
  "active": true
}

The validator flags the trailing comma after "editor" on line 3 — JSON, unlike JavaScript, does not allow a comma before a closing ] or }. Removing it makes the document valid.

How to validate JSON

  1. 1

    Paste your JSON

    Add the JSON you want to check into the editor. JSON Copilot parses it as you type and flags syntax errors immediately.

  2. 2

    Read the error message

    Each error names the line, column, and cause — for example a trailing comma or an unquoted key — so you can jump straight to it.

  3. 3

    Fix the syntax

    Correct the flagged character: remove the trailing comma, close the missing bracket, or replace single quotes with double quotes, and watch the error clear.

  4. 4

    Validate against a schema (optional)

    Open the Schema panel in the editor and paste a Draft-07 JSON Schema to check required fields, types, enums, and formats.

  5. 5

    Copy or continue

    Once the document is valid, copy it, format it, or explore it in the tree and mind-map views.

Why validate with JSON Copilot

Real-time syntax checks

JSON Copilot parses your input as you type and reports errors instantly.

Precise error locations

Every problem is reported with the exact line, column, and reason.

Draft-07 schema validation

Validate structure against a JSON Schema: required fields, types, enums, patterns, and formats.

Client-side and private

Syntax validation runs entirely in your browser; your JSON is never uploaded.

Handles large documents

The Monaco-based editor stays responsive on big JSON files.

Free, no account

Validate as much as you want without signing up or hitting a paywall.

What JSON validation is

JSON validation is the process of confirming that a string of text is well-formed JSON as defined by RFC 8259 and ECMA-404, the two specifications that describe the format. A validator parses the text the same way a programming language would and either accepts it or reports the first place where it breaks the grammar. If the parser succeeds, the data can be safely deserialized by any conforming JSON library; if it fails, the document would throw an error the moment your code called JSON.parse or an equivalent.

The JSON grammar is deliberately small. A valid document is a single value: an object, array, string, number, true, false, or null. Objects are comma-separated "key": value pairs wrapped in braces, arrays are comma-separated values wrapped in brackets, and every key and every string must use double quotes. There is no allowance for comments, trailing commas, single quotes, or unquoted identifiers, which is exactly what makes JSON portable across languages and platforms.

Validating early saves time. Catching a misplaced bracket or a stray comma in an editor is far faster than discovering it as a 500 error in production or a rejected API request. Because JSON Copilot validates as you type, you see problems the moment they appear rather than after a build, a deploy, or a failed integration test.

The most common JSON errors

Trailing commas are the single most frequent mistake. JavaScript tolerates a comma after the last element of an array or object, but JSON does not, so ["a", "b",] and {"x": 1,} are both invalid. The fix is always to delete the comma that sits immediately before the closing bracket or brace.

Wrong quotes come next. JSON requires double quotes for both keys and string values, so single quotes ('name') or backticks are rejected. Keys must also always be quoted — {name: "Ada"} is a JavaScript object literal, not JSON, and has to be written as {"name": "Ada"}.

Structural errors — a missing closing } or ], or a string that is never terminated — usually surface as an "unexpected end of input" message, because the parser reaches the end of the text while still expecting more. Counting brackets, or using an editor that highlights matching pairs, helps you find the level that was left open.

Finally, JSON has no vocabulary for certain JavaScript values. NaN, Infinity, undefined, function expressions, and comments (// or /* */) are all invalid. Numbers must be finite and written in decimal or exponent notation, so anything that is "not a number" has to be encoded as a string or as null instead.

Syntax validation vs. schema validation

These two checks answer different questions. Syntax validation asks, "Is this valid JSON at all?" — it cares only about the grammar: quotes, commas, brackets, and value types. A document like {"age": "not-a-number"} is perfectly valid JSON syntactically, even though the value is probably wrong for your application.

Schema validation asks the follow-up question: "Is this the right JSON?" You describe the shape you expect in a JSON Schema — which properties are required, what type each should be, allowed enum values, string patterns, numeric ranges — and the validator reports every field that does not conform. In JSON Copilot this happens in the editor's schema panel and targets Draft-07.

In practice you use them in sequence. First make the document parse (syntax), then confirm it carries the correct fields and values (schema). API contracts, configuration files, and message payloads all benefit from schema validation because it turns "it parsed" into "it matches what the consumer actually expects", catching bugs like a missing id or a status set to a value that is not in the allowed set.

How to fix a validation error

Start with the location. JSON Copilot reports the line and column of the first problem, so open that line and look at the character just before the reported position — most syntax errors are triggered by the token that comes right before where the parser gave up. The message names the cause, whether it is an unexpected token, an unterminated string, or a missing property name.

Work top to bottom. Because a parser stops at the first error, fixing the earliest problem often reveals the next one, and a single missing bracket can cascade into several confusing messages that all disappear once the real cause is corrected. Re-validate after each change rather than trying to fix everything at once.

A few habits prevent most errors: format the document so its structure is visible, keep quotes consistent (always double), and let the editor highlight matching brackets. When the source is not under your control — a log line or a third-party API response — pasting it into the validator quickly isolates the exact character that is malformed, which is far faster than scanning by eye.

Frequently asked questions

Is the JSON validator free?

Yes. Syntax validation is completely free, needs no account, and has no usage limits. AI features such as explaining JSON are separate and use credits, with 1,000 free on signup.

Does the validator upload my JSON anywhere?

No. Syntax validation runs entirely in your browser, so the document is parsed on your machine and never uploaded or stored on a server. Only the optional AI features transmit data, and sensitive values are masked on your device before any request is sent.

Can it handle large files and work offline?

Yes. Because validation is client-side, it works on large documents and keeps running even if you lose your connection after the page has loaded.

How do I fix a "trailing comma" error?

Remove the comma that appears right before a closing ] or }. Unlike JavaScript, JSON does not allow a comma after the last array item or object property.

What is the difference between syntax validation and schema validation?

Syntax validation checks that the JSON is well-formed per RFC 8259 (brackets, quotes, commas). Schema validation checks that a well-formed document has the right fields, types, and values according to a JSON Schema you supply.

Which JSON Schema draft is supported?

Schema validation in the editor targets JSON Schema Draft-07, covering keywords like required, type, enum, pattern, minimum/maximum, and format.

Why is my JSON invalid when it works in JavaScript?

JSON is stricter than JavaScript object literals: keys must be double-quoted, strings must use double quotes, and values like NaN, undefined, comments, and trailing commas are not allowed. To fix these automatically instead of by hand, paste the document into the JSON Repair tool at /json-repair.

Does the validator change my data?

No. Validation only reads and checks your JSON; it never edits it. Formatting and minifying are separate actions you trigger yourself.

Related tools

Validate your JSON now

Open the Editor