All tools

JSON Validator

Validate JSON syntax instantly — detailed error messages, 100% in browser

100% in-browserSyntax validationError locationNo signupFree forever
Samples:

Paste JSON below. All validation runs in your browser.

JSON Validator — Syntax & Schema Validation Online

A JSON validator checks whether a string conforms to the JSON specification (RFC 8259). Syntax validation uses JSON.parse() to confirm the document is well-formed: properly double-quoted keys, no trailing commas, balanced brackets, and valid escape sequences. A syntax error means the document cannot be parsed at all.

Schema validation goes further: it checks that the parsed data matches a declared structure — required properties are present, string fields match patterns, numbers fall within ranges, and arrays contain the correct types. JSON Schema (Draft 7, 2019-09, 2020-12) provides the vocabulary for these constraints and is the standard used by OpenAPI, Fastify, and most modern API tooling.

Both levels of validation are essential: syntax errors break parsers; schema errors break application logic. This tool handles both, with exact line and column numbers for every error — and runs 100% in your browser with no data upload.

💡

Press ⌘+Enter (Mac) or Ctrl+Enter (Windows) to validate instantly. Errors are highlighted with exact line and column numbers.

How it works

Validate JSON in Seconds

01

Paste your JSON

Copy and paste any JSON string — API response, config file, fixture, or log entry. Validation runs in real time as you type.

02

Review syntax errors

The tool parses the JSON and instantly reports any syntax errors with the exact line and column number and a plain-English description.

03

Optionally validate against a schema

Paste a JSON Schema (Draft 7 or 2020-12) to validate structure, required fields, types, and patterns against your data.

04

Fix and confirm valid

Use the error messages to fix your JSON. A green checkmark confirms valid, parseable JSON. Nothing was sent to any server.

JSON Schema Draft Versions — Which Should You Use?

JSON Schema has evolved through several draft versions. Understanding the differences helps when choosing which draft to target for API contracts, form validation, or code generation.

DraftKey additionsCommon use
Draft 4Core vocabulary, $ref, allOf/anyOf/oneOfLegacy Swagger 2.0 / OpenAPI 2.0
Draft 6const, contains, propertyNamesTransitional; rarely targeted directly
Draft 7if/then/else, readOnly/writeOnly, $commentMost common — OpenAPI 3.0, AJV default, most production APIs
2019-09$recursiveRef, unevaluatedProperties, anchorsOpenAPI 3.1 subset, AJV 8+
2020-12$dynamicRef, prefixItems, separated $defsOpenAPI 3.1 full, AJV 8+ with flag — growing adoption
Use cases

When Developers Validate JSON

🔌

API Response Testing

Validate that your API returns the expected structure before writing integration tests — catch breaking changes early.

⚙️

Config File Validation

Check package.json, tsconfig.json, ESLint, or custom app configs for schema compliance before deploying.

🔄

CI/CD Pipeline Checks

Fail builds early if generated JSON artefacts violate the declared schema contract.

📝

Form Input Validation

Validate user-submitted JSON payloads before storing to a database or passing to a downstream service.

📦

Data Ingestion

Validate batch data files or event streams against a schema before loading into a data warehouse or data lake.

📃

Contract Testing

Use JSON Schema as a formal contract between microservices — validate both producer and consumer against the same schema.

Most Common JSON Validation Errors

Trailing comma{"a": 1,} is valid JavaScript but invalid JSON. Remove the comma after the last property or array element.

Single quotes{'key': 'value'} is JavaScript object syntax, not JSON. JSON requires double quotes: {"key": "value"}.

Unquoted keys{key: "value"} is invalid. JSON requires all keys to be double-quoted strings: {"key": "value"}.

Comments// comments and /* comments */ are not valid in JSON (only in JSONC). Strip them before parsing.

Undefined / NaN / Infinity — JavaScript values like undefined, NaN, and Infinity are not valid JSON values. JSON.stringify() replaces them with null or omits them.

FAQ

Frequently Asked Questions

1What is the difference between syntax and schema validation?
Syntax validation checks that the JSON string is parseable — balanced braces, double-quoted keys, no trailing commas. Schema validation checks that the parsed data matches a declared structure: required fields are present, types are correct, values meet constraints. You can have syntactically valid JSON that fails schema validation (e.g. a required field is missing).
2What JSON Schema versions does this validator support?
Draft 4, Draft 6, Draft 7, 2019-09, and 2020-12. Most production APIs use Draft 7; OpenAPI 3.1 uses 2020-12.
3What is AJV and should I use it?
AJV (Another JSON Validator) is the de facto standard JSON Schema validation library for JavaScript and Node.js. It compiles schemas to fast validation functions and supports Draft 7 and 2020-12. Fastify, OpenAPI tools, and many testing frameworks use AJV internally. This validator uses AJV-compatible logic.
4How do I mark fields as required in JSON Schema?
Add a "required" array at the same level as "properties" listing the required field names: "required": ["id", "name"]. Fields not listed are optional by default. Applies to all draft versions.
5What does additionalProperties: false do?
Setting "additionalProperties": false disallows any object keys not listed in "properties". Useful for strict API contracts but can cause issues when composing schemas with allOf. Consider "unevaluatedProperties": false instead (Draft 2019-09+) for composed schemas.
6Is my JSON safe to paste here?
Yes. All validation runs entirely in your browser. Your JSON is never uploaded or sent to any server — there is no backend, no logging, and no analytics on your data.
7What are the most common JSON syntax errors?
Trailing commas after the last element, single quotes instead of double quotes, unquoted object keys, missing colons or commas, unclosed brackets or braces, and comments (which JSON does not support). Each is reported with the exact line and column number.
8Can I validate JSON in real time as I type?
Yes. The validator checks your JSON as you type and updates error indicators in real time, so you see immediately when a fix resolves an error without pressing any button.
9How do I validate a JSON API response against a schema in JavaScript?
Install AJV: npm install ajv. Then: const ajv = new Ajv(); const validate = ajv.compile(schema); const valid = validate(data); if (!valid) console.log(validate.errors). For Draft 2020-12, use the ajv/dist/2020 import.
10How do I validate JSON in Python?
For syntax: json.loads(json_string) raises JSONDecodeError if invalid. For schema validation: pip install jsonschema, then from jsonschema import validate; validate(instance=data, schema=schema). It raises ValidationError with a detailed message when data fails schema.
Learn more

Developer Guides

Feedback for json_validator

Tell us what's working, what's broken, or what you wish we built next — it directly shapes our roadmap.

You make the difference

Good feedback is gold — a rough edge you hit today could be smoother for everyone tomorrow.

  • Feature ideas often jump the queue when lots of you ask.
  • Bug reports with steps get fixed faster — paste URLs or examples if you can.
  • Name and email are optional; we won't use them for anything except replying if needed.

Stay Updated

Get the latest tool updates, new features, and developer tips delivered to your inbox.

What you'll get
  • Product updates & new tools
  • JSON, API & developer tips
  • Unsubscribe anytime — no hassle

Get in touch

Feature ideas, bugs, or a quick thanks — we read every message.