JSON Schema Generator — Free Online

Paste or load JSON to instantly generate a JSON Schema with TypeScript types, Zod schemas, C# classes, and SQL DDL. Everything runs in your browser — your data never leaves your device.

JSON Input
📄 Drop a .json file here, or
⚠ Warnings

    What This Tool Does

    The JSON Schema Generator analyzes any JSON data you provide and produces a complete JSON Schema describing its structure. JSON Schema is the standard way to define the shape, types, and constraints of JSON data — used for API validation, form generation, documentation, and ensuring data quality in ETL pipelines.

    Writing JSON Schema by hand is tedious and error-prone, especially for deeply nested or large JSON structures. This tool infers the schema automatically: it detects types, identifies required fields, recognizes string formats (email, URI, date-time, UUID), handles nullable values, and merges array item schemas intelligently. You can then export the result as TypeScript types, Zod validation schemas, C# POCO classes, or SQL DDL statements.

    All processing happens in a Web Worker inside your browser. Your JSON is never transmitted over the network — making this safe for sensitive data like API responses, configuration files, and production database exports.

    How to Use the JSON Schema Generator

    Inference Settings Explained

    SettingOptionsWhat It Does
    Schema Draft2020-12, 2019-09, 07Sets the $schema URI and adjusts syntax for the selected JSON Schema draft
    Required FieldsAll / None / Heuristic"All" marks every observed key as required. "Heuristic" skips nulls, empty strings, and empty collections
    Null HandlingNullable / Ignore"Nullable" adds null to the type union. "Ignore" drops null if another type is observed
    Array ModeUnion / First / Strict"Union" merges all item schemas. "First" uses only item[0]. "Strict" warns on mismatches
    Integer DetectionOn / OffWhen on, whole numbers become "integer" instead of "number"
    Format DetectionOn / OffDetects email, URI, date-time, and UUID patterns in strings
    Additional Propertiestrue / falseControls whether unknown properties are allowed in the schema

    💡 Working with JSON data? Use the JSON Formatter to beautify raw JSON first, or the JSON Validator to check for syntax errors. Need to convert formats? Try JSON to CSV or JSON to YAML.

    Related Guides & Tutorials

    Frequently Asked Questions

    Which JSON Schema draft do you generate?
    By default, the tool generates JSON Schema Draft 2020-12, the latest version. You can also select Draft 2019-09 or Draft 07 from the options bar. The main differences are in the $schema URI and certain keywords like prefixItems (2020-12) vs items as array (07).
    Does my data get uploaded to a server?
    No. All processing runs entirely in your browser using a JavaScript Web Worker. Your JSON data never leaves your device. No network requests are made during inference.
    How do you handle null values?
    You can choose between two modes. "Treat null as nullable" adds null to the type union (e.g., type: ["string", "null"]). "Ignore nulls" drops null from the inferred type if a non-null type is also observed for that field.
    Can I generate TypeScript types from my JSON?
    Yes. The TypeScript tab generates type definitions directly from the inferred schema. Required fields are typed normally; optional fields use ?:. Union types use |. Arrays become T[]. You can also export Zod schemas for runtime validation, C# classes, or SQL DDL.
    How does the tool handle large JSON files?
    Inference runs in a Web Worker to avoid freezing the UI. For arrays, the tool samples up to 200 items by default. Max recursion depth is 30 levels. A warning banner is shown if either limit is reached.
    What is JSON Schema used for?
    JSON Schema is a standard for describing JSON data structures. It is used for validating API request and response bodies, generating forms from data models, auto-generating documentation, creating type-safe code in multiple languages, and enforcing data quality in ETL/data pipelines.

    Related Tools