JSON Validator

Validate JSON syntax and check against JSON Schema

What is JSON Validation?

JSON validation is the process of checking whether a string is well-formed JSON according to the ECMA-404 and RFC 8259 specifications. A valid JSON document must have correct syntax — properly quoted strings, matched brackets, no trailing commas, and no comments. Beyond syntax, schema validation checks whether the data structure matches a defined shape: required fields exist, values have the right types, numbers are within bounds, and strings match expected patterns.

Developers validate JSON daily — checking API responses, debugging config files, verifying data exports before import, and testing webhook payloads. A syntax error in a JSON config can crash an application at startup, and a missing required field in an API payload silently drops data.

How to Use the JSON Validator

  1. Paste your JSON into the input area.
  2. Click “Validate” or press Ctrl+Enter.
  3. Read the result: valid JSON shows a green confirmation with structure stats (type, depth, key count); invalid JSON shows the exact error with line and column numbers.
  4. Optionally expand Settings and paste a JSON Schema to validate structure, types, and constraints beyond syntax.

The validator runs entirely in your browser. Nothing is uploaded, nothing is logged.

Common JSON Syntax Errors

Trailing Commas

JSON does not allow a comma after the last element in an array or object. This is the most common error when pasting data from JavaScript code, where trailing commas are legal:

// Invalid — trailing comma
{"name": "Alice", "age": 30,}

// Valid
{"name": "Alice", "age": 30}

Single Quotes

JSON requires double quotes for all strings. Single quotes are a syntax error:

// Invalid
{'name': 'Alice'}

// Valid
{"name": "Alice"}

Unquoted Keys

Every object key must be a double-quoted string. Bare identifiers are not allowed:

// Invalid
{name: "Alice"}

// Valid
{"name": "Alice"}

Comments

JSON has no comment syntax. Lines starting with // or blocks wrapped in /* */ are syntax errors. If you need comments in configuration files, consider JSONC (JSON with Comments, supported by VS Code and TypeScript) or YAML — but standard JSON parsers will reject them.

Missing Commas

Every element in an array and every key-value pair in an object must be separated by a comma:

// Invalid — missing comma between pairs
{"name": "Alice" "age": 30}

// Valid
{"name": "Alice", "age": 30}

JSON Schema Validation

JSON Schema lets you define the structure your data must follow. Paste a schema into the Settings panel and the validator checks every constraint:

{
  "type": "object",
  "required": ["name", "email"],
  "properties": {
    "name": { "type": "string", "minLength": 1 },
    "email": { "type": "string", "pattern": "^[^@]+@[^@]+$" },
    "age": { "type": "integer", "minimum": 0, "maximum": 150 }
  },
  "additionalProperties": false
}

This schema requires name and email to be present, enforces types and constraints, and rejects any extra fields. The validator reports every violation — not just the first one — so you can fix all issues in one pass.

Supported Schema Keywords

CategoryKeywords
Typetype, enum, const
Objectproperties, required, additionalProperties, minProperties, maxProperties, patternProperties
Arrayitems, minItems, maxItems, uniqueItems
StringminLength, maxLength, pattern
Numberminimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf
CompositionallOf, anyOf, oneOf, not
References$ref (local #/definitions/... and #/$defs/...)

JSON Validator vs JSONLint

JSONLint is a popular online JSON validator that has been around since 2011. Both tools check JSON syntax, but there are key differences:

FeatureThis ValidatorJSONLint
Syntax checkingYesYes
JSON Schema validationYesNo
Structure statsYes (type, depth, keys)No
PrivacyRuns in your browserSends data to a server
AdsMinimalHeavy
Open sourceYesPartially

If you need syntax-only checking, either tool works. If you need schema validation or care about keeping your data local, this validator does both without sending anything over the network.

Validating API Responses

When debugging REST APIs, paste the response body here to check both syntax and schema compliance. Common scenarios:

  • Webhook payloads — verify the payload matches the documented schema before writing handler code.
  • Third-party API responses — confirm the structure hasn’t changed after an API version update.
  • Mock data — validate test fixtures match the real schema so tests don’t pass on malformed data.
  • Database exports — check NDJSON (newline-delimited JSON) line by line, or validate a full JSON array export.

Pair this tool with the JSON Formatter to first beautify a minified response, then validate it against your schema.

JSON Validation in Code

For programmatic validation in your codebase:

  • JavaScript/TypeScriptJSON.parse() for syntax; ajv for schema validation.
  • Pythonjson.loads() for syntax; jsonschema library for schema validation.
  • Gojson.Unmarshal() for syntax; gojsonschema for schema validation.
  • Java — Jackson or Gson for syntax; everit-org/json-schema for schema validation.

This online tool is for quick, ad-hoc checks. For production pipelines, integrate a schema validator into your CI — ajv-cli for Node.js projects or check-jsonschema for Python-based CI.

Frequently Asked Questions

How do I validate JSON online?

Paste your JSON into the input area and click Validate or press Ctrl+Enter. The validator checks syntax instantly in your browser — no data is sent to any server. If the JSON is invalid, you get the exact error with line and column numbers so you can fix it immediately.

What is JSON Schema validation?

JSON Schema is a vocabulary that lets you describe the structure your JSON data must follow — required fields, data types, value ranges, string patterns, and more. Paste a JSON Schema into the Schema field (under Settings) and the validator checks your data against it, reporting every violation. This is useful for validating API payloads, config files, and data pipelines.

What is the difference between JSON validation and JSON formatting?

Validation checks whether JSON is syntactically correct and optionally conforms to a schema. Formatting (beautifying) takes valid JSON and re-indents it for readability. Use a JSON validator to catch errors; use a JSON formatter to make valid JSON easier to read. This site offers both tools.

Why does my JSON fail validation?

The most common JSON errors are trailing commas after the last element, single quotes instead of double quotes, unquoted object keys, comments (JSON does not support them), and missing commas between elements. The validator reports the exact line and column of the first syntax error so you can jump straight to the problem.

Can I validate JSON against a JSON Schema?

Yes. Expand the Settings panel below the tool and paste your JSON Schema. The validator supports Draft-04 and Draft-07 keywords including type, required, properties, items, enum, pattern, minimum, maximum, minLength, maxLength, anyOf, oneOf, allOf, not, and local $ref references.

Is my JSON data safe?

Yes. All validation happens entirely in your browser using JavaScript. Your JSON and schema data are never sent to any server, never logged, and never leave your machine.

What is the difference between JSON and JSON5?

JSON is a strict subset of JavaScript with mandatory double quotes, no comments, and no trailing commas. JSON5 extends JSON to allow single quotes, unquoted keys, comments, trailing commas, and more. This validator checks strict JSON — if your data uses JSON5 features, those will be flagged as errors because most APIs and parsers expect standard JSON.