json schema validator

runs in your browser, nothing is uploaded

IDLE

stdin

stdout

Made by Maiyarasu S

Check a JSON document against a JSON Schema. Paste the document into tab a and the schema into tab b, and every problem is listed with its path and a plain explanation.

What it checks

Validation covers the keywords most schemas use: types, enum and const, properties, required, additional and pattern properties, items and prefixItems, contains, length and size limits, minimum and maximum, multipleOf, pattern, allOf, anyOf, oneOf, not, if, then and else, and $ref to somewhere inside the same schema. Both draft 2020-12 and draft-07 spellings are accepted.

The formats date-time, date, time, email, uri, uuid, ipv4 and hostname are checked as rules. Each problem shows its path, such as $.roles, and what is wrong.

What is not checked

These keywords are skipped, and the result names any that your schema uses: unevaluatedProperties, unevaluatedItems, dependentSchemas, $dynamicRef, $recursiveRef and contentSchema. A $ref is followed only when it points inside the same schema, such as #/$defs/name. References to other files, URLs and anchors are reported and not followed.

Some limits are not reported. A format outside the list above is accepted unchecked, and a misspelled or unknown keyword is ignored. Minimum, maximum and multipleOf use ordinary floating-point numbers, so integers beyond 2^53 are compared only approximately. The schema itself is not checked for mistakes.

No schema yet? Press “generate a schema from tab a” to start from one that matches your document, then tighten it.

Questions

Which drafts are supported?

Keywords from draft 2020-12 and draft-07 are both understood, including both ways of describing tuples. The tool does not read $schema, so it never switches rules by draft.

Why does it say a keyword was not checked?

That keyword is outside what this validator evaluates. The note names what it skipped; it cannot name what it does not recognise, such as a misspelled keyword.

Does a pass mean my data is fully valid?

It means the checked keywords found no problem. Read the note under the result for skipped keywords and references it did not follow.

How many errors does it show?

Up to 2,000. Click any of them to open that value in the tree.

Is my schema or data uploaded?

No. Validation runs in this page.

Related tools

help

QUERY (the prompt line)

Type a path or a filter after guest@json:~$. JSONPath and a jq-style subset both work, and the output shows only the result. Convert, copy and save then apply to that result.

$.users[0].nameone value by path. .users[0].name is the same thing
$["odd key"] $.ports[-1] $.ports[1:3]quoted keys, counting from the end, slices
$.users[*].name or .users[].nameevery item
$..namethat key at any depth
$.users[?(@.id > 1001 && @.sudo)]filter. Operators: == != < <= > >= && || !
.users[] | select(.sudo) | .namethe same idea in jq style, with pipes
.users | map(.name) | sortbuild a new list
[.users[] | select(.sudo)] | lengthcollect matches into an array, then count

Functions: length, keys, keys_unsorted, values, type, first, last, sort, sort_by(f), unique, reverse, flatten, add, min, max, to_entries, not, select(f), map(f), has(k), test(regex), contains(x), startswith(s), endswith(s).

TABS A AND B

stdin has two tabs. diff compares a with b by structure: key order is ignored, and an item inserted into an array counts once. validate checks tab a against the JSON Schema in tab b. Click any row in either list to open that spot in the tree.

REPAIR

When input is not valid JSON, the error view lists what auto-fix would change, line by line, before you apply it: comments, trailing or missing commas, single or smart quotes, bare keys, NaN and Infinity, hex and other number spellings, markdown code fences, JSONP wrappers, and input that was cut off. undo brings your original back.

VALUE HINTS

Links are clickable. Numbers that look like Unix times show the date. A badge after a string means it holds something: {…} JSON, jwt a token (decoded, never verified), b64 base64 text. Click the badge, or press Enter on the row, to expand it in place. A token pasted on its own, with or without Bearer in front, is offered as decode jwt instead of a parse error. Decoding never checks the signature.

KEYS

Ctrl+F or /search the output: the tree, or the text of minify, yaml, csv and ts. Enter next match, Shift+Enter previous. Write /pattern/ for a regular expression. In text output the keys and values buttons are off, and diff and validate switch to the tree
Alt+Qgo to the query prompt. Esc clears it
↑ ↓ ← →move in the tree. Left and right fold and unfold, with Shift they do the whole branch
Enter / Ctrl+C in the treefold or expand the row / copy the selected value
Ctrl+Enterformat stdin in place
Ctrl+Ssave the output as a file
Alt+C Alt+M Alt+S Alt+Fcopy, pretty or minify, sort keys, fold
Alt+1 Alt+2 Alt+Ttab a, tab b, next theme
Tab / Shift+Tab in stdinindent and outdent. Press Esc first to tab out of the box instead
Ctrl+Z / Ctrl+Shift+Z in stdinalso undo and redo format, auto-fix, load and clear

On a Mac, use Cmd for Ctrl and Option for Alt.

SAVED INPUT AND DISPLAY

Both tabs are kept in this browser between visits, however large. If the browser cannot keep an input, a note says so. The crt button turns scanlines and glow off. The page also drops them, and brightens dim text and borders, when your system asks for more contrast.

PRIVACY

Everything runs in this page, and the fonts are served with it. Nothing you paste is sent anywhere. A share link holds the compressed input inside the link itself, so anyone you send the link to can read it.

What you paste is also saved in this browser, so it is still here on your next visit. On a shared computer, or after pasting a secret, clear it. This removes both tabs and your settings from this browser.