JSON Validator & Syntax Checker
Paste JSON to check whether it parses. If it’s valid, you see the root type. If it isn’t, you see the parser’s error message. Everything runs in your browser and your input stays on this device.
What this tool does
Parse one JSON value and report its root type or the parser’s syntax error.
What does a JSON validator check?
It checks syntax only: one complete value, double quotes around keys and strings, no trailing commas, and no comments. It does not check your data against a schema, so an API can still reject a payload that passes here if it needs different properties or types. When the root type comes back as string for a document you expected to be an object, the payload was probably serialized twice.
When to use it
Check the exact body before debugging a service’s schema or application logic. A valid string root where an object was expected can expose double serialization.
How to use it
- Paste the body without HTTP headers.
- Select Validate JSON.
- Check the root type or fix the reported syntax and run it again.
Worked example
Paste {"status":"ok","items":[1,2,3]} and run Validate JSON. The result identifies the top-level value as an object. Change the end of the array to [1,2,3,] and run it again to see a parsing error. Remove the trailing comma and validate once more. When debugging an HTTP request, validate the exact body you sent so that any characters introduced by serialization or template rendering appear in the input. If an error points near a closing bracket, also inspect the token immediately before it for missing quotes or an extra comma.
{"jobs":["sync"],"dryRun":true}Valid JSON
Root type: objectSupported features and limitations
Validation checks syntax. Application-specific rules require a separate schema. For trailing commas, use Correct JSON in the JSON Formatter.
Common mistakes and edge cases
A browser may accept a JavaScript object literal with single quotes, comments or bare property names. JSON follows a stricter grammar. Each input must contain one complete value, so two valid objects pasted consecutively will still fail. When copying from an HTTP log, remove status lines and header fields first. Some logs wrap the payload in a quoted string and escape the quotes. A result of string can reveal that an object was serialized twice. For a batch of failing fixtures, validate one at a time and keep the first error with the file name. Once that error is fixed, rerun validation because the parser may only report the earliest syntax problem.
Frequently asked questions
- Can an API reject a payload that passes?
- Yes. The validator checks JSON syntax. The receiving API may still require specific properties, reject extra fields or expect a different type for a value such as items. Check its schema or error response for those details.
- Is null valid JSON?
- Yes. JSON allows null, booleans, numbers and strings at the top level as well as objects and arrays. An API can still restrict the top-level type to an object or array.
- Why do I get "Unexpected token" when I validate JSON?
- The parser found a character the JSON grammar doesn’t allow at that point. Common causes are a trailing comma, single quotes, unquoted property names, a comment, or two values pasted together. Look at the token just before where the error points, because the mistake is often one character earlier.
- What does "Root type: string" mean?
- The whole input is a single JSON string, not an object or array. This often means the data was serialized twice, so the quotes and backslashes you see are part of the string. If the string contains an encoded JSON object, parse its contents once more to get the object.
- Is a JSON validator the same as a JSON Schema validator?
- No. This tool checks syntax. A schema validator checks structure, required fields and value types against a schema you provide.
- Is my JSON uploaded anywhere?
- No. The text is processed in your browser and stays on your device.