JSON Validator
Paste any JSON and instantly check if it's valid. Invalid JSON shows the exact error location and surrounding context. Valid JSON displays type, depth, key count, and size stats. Nothing leaves your browser.
Developer Tools Cluster
What This Tool Does
Validates JSON syntax in your browser and shows exact error locations — line number, character position, and a clear description of the problem. Nothing is uploaded.
Who This Is For
- Developers debugging API responses that are silently failing due to malformed JSON
- Anyone editing JSON config files by hand who wants instant error feedback
- Backend engineers validating JSON payloads before writing them to a database
- Learners who are new to JSON syntax and need clear error explanations
Example: Input: A JSON string that may have trailing commas, single quotes, or missing brackets → Output: A pass/fail result with the exact line and character of any syntax error, plus a plain-English description of what went wrong
How to Validate JSON
- Paste your JSON into the input field.
- The validator checks syntax in real time — errors are highlighted with the line number and character position.
- If the JSON is valid, a green confirmation message appears.
- Fix any errors flagged and re-check.
The validator checks for JSON syntax errors only — it does not validate against a schema (that is, it does not check whether the data has the right fields and types for your specific use case).
The 10 Most Common JSON Syntax Errors
- Trailing comma —
{"a": 1,}is invalid. JSON does not allow a comma after the last item in an object or array. - Single quotes — JSON requires double quotes.
{'key': 'value'}is invalid; use{"key": "value"}. - Unquoted keys —
{key: "value"}is invalid. Keys must be quoted strings. - Undefined — JavaScript's
undefinedis not a valid JSON value. Usenullinstead. - Comments — JSON does not support comments.
// commentor/* comment */will cause parse errors. - Missing quotes around strings —
{"name": Alice}is invalid; string values need quotes. - Unescaped special characters — backslashes, newlines, and certain Unicode characters in strings must be escaped.
- NaN and Infinity — JavaScript's
NaNandInfinityare not valid JSON values. - Unclosed brackets — every
{needs a}and every[needs a]. - Extra data after root — a valid JSON document has exactly one root value. Extra content after it is a syntax error.
JSON Schema Validation
Basic JSON syntax validation (what this tool does) confirms the document can be parsed. Schema validation goes further — it checks that the parsed data matches a defined structure: required fields exist, values have the right types, numbers are in range, strings match patterns.
JSON Schema is the standard for describing JSON structure. Popular validators:
- Ajv (JavaScript) — the fastest JSON Schema validator, used by many frameworks
- Zod (TypeScript) — schema-first with excellent TypeScript inference
- jsonschema (Python) — full JSON Schema support
- Newtonsoft.Json (.NET) — includes schema validation
For simple API testing, use this tool for quick syntax checks. For production code, implement schema validation with Ajv or Zod to catch structural problems early.
JSON Syntax Rules Reference
- An object is
{}containing zero or more"key": valuepairs separated by commas. - An array is
[]containing zero or more values separated by commas. - A string must be in double quotes and can contain any Unicode character except unescaped
"and\. - Numbers can be integers or floats. Scientific notation (
1e10) is supported. - Booleans are lowercase:
trueandfalse. - Null is lowercase:
null. - Whitespace (spaces, tabs, newlines) is allowed anywhere between tokens.
- No trailing commas after the last element in objects or arrays.
- No comments of any kind.
JSON Processing Tools
Validation is the first step — here is the full JSON workflow:
- Format and prettify JSON once it passes validation
- Convert JSON to CSV for spreadsheet analysis
- Convert JSON to XML for legacy system integration
- Convert CSV to JSON to validate imported data
- Decode JWT tokens — the payload is JSON that can be validated here
Related Tools
- Writing API docs in Markdown? Convert Markdown to HTML to publish your documentation. → convert API documentation from Markdown to HTML
- Passing JSON as a query parameter? URL-encode it first to prevent malformed requests. → URL-encode JSON strings for query parameters
- Need to verify payload integrity? Run the JSON through the Hash Generator to produce a SHA-256 checksum. → generate a checksum for your JSON payload
- Building a scheduled API? Use the Cron Parser to verify your cron expressions are correct. → parse scheduled job cron expressions
Related Guides & Tutorials
How to Format and Validate JSON Before Sending an API Request
Common JSON syntax errors that break API calls, and how to catch them before they reach production.
GuideJSON vs XML vs CSV: Which Data Format Should You Use?
A practical breakdown of when to reach for JSON, XML, or CSV — with real-world API and data pipeline examples.
Frequently Asked Questions
undefined. JSON is a strict subset — it requires double-quoted keys and values, no trailing commas, and no comments. Valid JSON is valid JavaScript, but not vice versa.JSON.parse() in JavaScript also rejects these.settings.json and tsconfig.json. It allows // and /* */ comments. JSONC is not standard JSON and will fail regular JSON parsers.