JSON Validator
Validate JSON syntax instantly — detailed error messages, 100% in browser
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.
Validate JSON in Seconds
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.
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.
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.
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.
| Draft | Key additions | Common use |
|---|---|---|
| Draft 4 | Core vocabulary, $ref, allOf/anyOf/oneOf | Legacy Swagger 2.0 / OpenAPI 2.0 |
| Draft 6 | const, contains, propertyNames | Transitional; rarely targeted directly |
| Draft 7 | if/then/else, readOnly/writeOnly, $comment | Most common — OpenAPI 3.0, AJV default, most production APIs |
| 2019-09 | $recursiveRef, unevaluatedProperties, anchors | OpenAPI 3.1 subset, AJV 8+ |
| 2020-12 | $dynamicRef, prefixItems, separated $defs | OpenAPI 3.1 full, AJV 8+ with flag — growing adoption |
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.
Frequently Asked Questions
1What is the difference between syntax and schema validation?
2What JSON Schema versions does this validator support?
3What is AJV and should I use it?
4How do I mark fields as required in JSON Schema?
"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?
"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?
7What are the most common JSON syntax errors?
8Can I validate JSON in real time as I type?
9How do I validate a JSON API response against a schema in JavaScript?
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?
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.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.
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.
- Product updates & new tools
- JSON, API & developer tips
- Unsubscribe anytime — no hassle