JSON validator: check JSON syntax and schema, free and private
A JSON validator checks that text follows the JSON standard (RFC 8259) and, if it does not, tells you where it breaks. To validate JSON free and privately, paste it into JSON Input or click Upload JSON File. A badge above the box turns green with Valid JSON, or red with Invalid JSON and a Validation error panel that gives the line, the column and a fix. The check runs in your browser, so nothing is uploaded, and you can confirm that in the Network tab of DevTools.
The check is strict: comments, trailing commas, single quotes, unquoted keys, NaN, undefined and numbers such as 02134 are rejected, because standard JSON does not allow them. Valid JSON gets a structure summary and warnings for duplicate keys and numbers that JavaScript would round.
To go beyond syntax, tick Validate against a JSON Schema and the document is also checked against your schema, with every failure listed by path. Once the JSON is valid, use the JSON formatter to explore it or the JSON minifier to shrink it.
Table of Use: what the validator reports
| You paste | Verdict | What you see |
|---|---|---|
| {"name":"Ada","email":"ada@example.com","age":36,"roles":["admin","editor"]} | Valid JSON | Objects 1, Arrays 1, Keys 4, Strings 4, Numbers 1, Max depth 2, plus a Pretty Printed JSON view |
| {"name": "John",} | Invalid JSON | Trailing comma before '}', line 1, column 16 |
| {'name': 'John'} | Invalid JSON | Property names must use double quotes, not single quotes, line 1, column 2 |
| {name: "John"} | Invalid JSON | Property name 'name' must be wrapped in double quotes, line 1, column 2 |
| {"name": "John" "age": 30} | Invalid JSON | Missing comma between properties, line 1, column 17 |
| {"zip": 02134} | Invalid JSON | Leading zeros are not allowed, line 1, column 9, with advice to quote ZIP codes |
| {"a": NaN} | Invalid JSON | Unexpected word 'NaN', with advice to use null or a string |
| {"a":1}{"b":2} | Invalid JSON | Unexpected '{' after the end of the JSON value: wrap several values in an array |
| "hello" | Valid JSON | A bare string is a complete JSON document. So is a bare number such as 42, and so are true, null, [] and {} |
| {"a":1,"a":2} | Valid JSON, with a warning | Duplicate keys listed with line and column, because most parsers keep only the last |
| {"id": 12345678901234567890} | Valid JSON, with a warning | Says the number becomes 12345678901234567000 in JSON.parse; send large IDs as strings |
| {"name":"","email":"not-an-email","age":-1.5,"roles":["admin","admin","owner"]} | Valid JSON, but does not match the schema (6 errors), with Validate against a JSON Schema ticked and Load example schema clicked | Six errors, each with a message and its line and column: /name minLength, /email format, /age type, /age minimum, /roles/1 uniqueItems and /roles/2 enum |
Working in another format? The XML validator checks XML the same way, and the YAML to JSON converter turns YAML into JSON you can then validate here.
Features
- Checks as you type. There is no Validate button. The badge reads Valid JSON, Invalid JSON or Checkingโฆ
- Readable errors. A Validation error panel shows the message, line and column, the offending line with a caret, a How to fix hint and a Show in input button.
- Warnings on valid JSON. Duplicate keys are listed with a show link for each, and numbers JavaScript cannot represent exactly are named with what JSON.parse would turn them into.
- Structure summary. Counts of Objects, Arrays, Keys, Strings, Numbers, true/false/null and Max depth.
- Validate against a JSON Schema. Drafts 4, 6, 7, 2019-09 and 2020-12, with Load example schema, Upload schema and a Check format values option. Failures show the path, message, line and column. Anything the tool cannot check is listed under Not checked.
- Pretty Printed JSON. Valid input is shown indented by two spaces. Copy Valid JSON copies it and Download saves validated.json.
- Upload JSON File, Load example, Show line numbers, Clear. Files up to 25 MB are read on your device.
- Common JSON Errors. A reference box pairs six typical mistakes with their corrected form.
It reports the first syntax error only, does not repair JSON and cannot fetch a $ref to another file. A schema pattern is a regular expression, which you can try in the regex tester. Valid JSON can then be converted with the JSON to YAML converter.
How to validate JSON, step by step
- Paste your JSON into JSON Input, click Upload JSON File, or click Load example to try a sample.
- Watch the badge above the box. Valid JSON means the syntax is correct; Invalid JSON means there is an error to fix.
- If it is invalid, read the Validation error panel, then click Show in input to jump to the exact character. Fix it and the badge updates at once.
- Check any amber warnings about duplicate keys or numbers JavaScript cannot hold exactly.
- To check structure as well, tick Validate against a JSON Schema, paste or upload a schema, and read the list of errors or the message that the JSON matches.
- Click Copy Valid JSON for the indented text, Download to save validated.json, or Clear to start over.
Who can use it
- API developers confirming that a request body or response parses, and that it matches the agreed schema.
- QA engineers checking test fixtures and mock data, including values made with the UUID generator against a uuid format.
- DevOps engineers finding the stray comma in a config file before a deploy fails.
- Data engineers checking exports from tools such as the CSV to JSON converter and comparing versions in the text diff tool.
- Students learning why JSON is stricter than JavaScript, using the error hints.
FAQs
How do I validate JSON online?
Paste your JSON into JSON Input, or click Upload JSON File. It is checked as you type: a green Valid JSON badge appears above the box, or a red Invalid JSON badge with a Validation error panel giving the line, column and a fix. There is no Validate button to press.
Why is my JSON invalid?
The usual causes are a trailing comma, single quotes instead of double quotes, keys without quotes, a missing comma between items, comments, a number with a leading zero such as 02134, and NaN, undefined or True instead of null or true. JSON is stricter than JavaScript. The Common JSON Errors box under the tool shows six of these mistakes beside their fixes.
How do I find the exact error in my JSON?
Read the Validation error panel. It gives the line and column, repeats the offending line with a caret under the problem, and adds a How to fix hint. Click Show in input and the text box jumps to that spot with the character selected. The check stops at the first error, so with several mistakes, fix them one at a time.
Can I validate JSON against a JSON Schema?
Yes. Tick Validate against a JSON Schema, then paste a schema, click Upload schema, or click Load example schema. Drafts 4, 6, 7, 2019-09 and 2020-12 are supported, including type, required, enum, pattern, minimum, items, allOf, anyOf, oneOf, if/then/else and local $ref. Each failure lists a JSON Pointer path, a message, and the line and column.
Which JSON Schema formats and keywords are not checked?
Format checks cover date-time, date, time, email, hostname, ipv4, ipv6, uri, uri-reference, uuid, regex and json-pointer; other formats are ignored, and you can switch the check off with Check format values. Keywords the tool cannot evaluate, such as unevaluatedProperties, unevaluatedItems, $dynamicRef and a $ref to another file, are listed under Not checked instead of being silently skipped.
Is a plain string or number valid JSON?
Yes. The JSON standard, RFC 8259, allows any value at the top level, so 42, "hello", true, null, [] and {} are all valid documents. Parsers written to the older RFC 4627 accepted only an object or an array at the top, which is why a few tools still reject a bare value. This validator accepts all of them.
Are duplicate keys invalid JSON?
The grammar allows them, so {"a":1,"a":2} is reported as Valid JSON, but with a warning. The standard says names should be unique and most parsers keep only the last value, so the repeated keys (up to 10) are listed with their line and column. Remove or rename duplicates so that values are not lost without notice.
Is it safe to paste JSON with private data?
Yes. Validation is plain JavaScript running in your browser, so your JSON and schema are never uploaded or stored by ZipConvert. You can confirm this in the Network tab of your browser DevTools: no request carrying your text is sent while you type. Files you choose are read on your device, up to 25 MB.