JSON Schema Validator and Sample Generator

Validate a supported schema subset, generate a sample or infer type rules from one JSON sample.

On-device No sign-up Free to use

Inspect input controls

Showing an example. Edit to see your own.

Drop your file here

or choose one from your device

Optional UTF-8 text up to 1,000,000 bytes. A chosen file replaces pasted text.

    ?

    Up to 100,000 UTF-8 bytes, 500 schema nodes and 12 schema levels. Only the listed keyword subset is accepted.

    ?

    Used to validate a document or infer a schema; up to 1,000,000 UTF-8 bytes.

    Processed in your browser. Your inputs stay on this device.

    Result

    Showing an example.

    Check a required name and an optional nonnegative integer age against the supported schema rules.

    The document passes the supported keyword subset.

    Loading the tool. Your result will appear here.

    https://usefreetools.net/json-schema-validator-sample-generator · 20 November 2026

    Was this helpful?

    How to use JSON Schema Validator and Sample Generator

    1. Choose Validate document, Generate a validated sample, or Generate schema from JSON sample.
    2. For validation, enter a supported schema and a JSON document, or choose a UTF-8 document file. A selected file replaces the document text. For sample generation, enter the schema.
    3. For schema inference, enter your sample in JSON document to validate, or choose its file. This mode observes the sample and does not use the schema input.
    4. Read validation findings, the rechecked generated example or the inferred rules. Download the JSON result if needed, then review it against the intended consumer’s requirements.

    Example: JSON Schema Validator and Sample Generator

    Check a required name and an optional nonnegative integer age against the supported schema rules.

    You add
    JSON Schema subset: {"type":"object","properties":{"name":{"type":"string","minLength":1},"age":{"type":"integer","minimum":0}},"required":["name"],"additionalProperties":false}; JSON document to validate: {"name":"Ada","age":25}; Operation: validate
    You get
    The document passes the supported keyword subset.

    Options

    Validation and sample generation
    Validation checks the entered document against the supported constraints. Sample generation searches a bounded set of candidates and validates the chosen one with the same checks. Failure to generate does not prove that every possible document is invalid.
    Schema inference
    The inference mode records observed types and properties. It does not infer required keys, permitted values or business constraints from one example. Review mixed arrays and unusual structures before reusing the generated rules.
    Supported keywords
    The subset accepts $schema for the stated 2020-12 dialect, title, description, default, examples, type, enum, const, properties, required, additionalProperties, items, minItems, maxItems, minLength, maxLength, minimum, maximum, exclusiveMinimum, exclusiveMaximum, allOf, anyOf and oneOf. Boolean schemas are also supported. References, patterns, format and other keywords are refused.

    Supported inputs and limits

    • A bounded 2020-12-compatible subset, not full draft conformance.
    • Schema input is limited to 100,000 UTF-8 bytes, 500 schema nodes and 12 schema levels.
    • Document input is limited to 1,000,000 UTF-8 bytes, 20,000 nodes and 32 levels; repeated object keys are refused.
    • Schema inference has a tighter 1,000-value and 12-level limit.
    • Validation caps findings at 200 and work at 50,000 operations.
    More details

    Sample generation uses at most 256 candidate steps and 200,000 cumulative validation operations; contradictory or difficult combinations can fail.

    JSON numbers use JavaScript finite-number comparisons.

    No reference URL is fetched and no API schema connection occurs.

    Where your input is processed

    This tool does not upload your inputs. See the limits for anything saved on your device.

    A passing sample is only one allowed case

    A generated example does not show every valid document or establish that a complete JSON Schema implementation would accept the schema. Check required fields, additional properties and numeric/string limits against the consumer’s needs. Contradictory constraints can prevent sample generation even when the input text is valid JSON.

    Questions about JSON Schema Validator and Sample Generator

    Does a result certify full JSON Schema compliance?

    No. Only the supported keywords are checked. Unknown keywords are refused.

    Are remote references downloaded?

    No. References are unsupported and no schema URL is fetched.

    Can every valid schema produce a sample?

    No. Generation has a bounded search and can refuse contradictory or difficult supported combinations.

    Page updated · Project managed by Tony Hines · Report a problem with JSON Schema Validator and Sample Generator