Data to Class

JSON Schema Generator

Paste a sample JSON document and get a JSON Schema describing it — types, required properties, nested objects and string formats.

Loading JSON Schema Generator…

How it works

How to use the JSON Schema Generator

  1. Paste sample JSON

    The more representative the sample, the better the schema. Arrays of objects are merged to find optional fields.

  2. Tune the options

    Pick the draft, how "required" is decided, whether to detect formats, and whether to forbid extra properties.

  3. Refine and use

    Copy the schema into your validator, OpenAPI spec or form library and add constraints like minimum or pattern.

How the schema is inferred

Every value in the sample is analysed. Objects in the same array are merged, so a property missing from some items is not marked as required. Numbers that are always whole become integer. Mixed types become type unions (e.g. ["string", "null"]). Strings that look like dates, emails, URLs, UUIDs or IPv4 addresses get a format.

Built for developers

Why developers use it

  • Private by design

    Runs 100% in your browser. Nothing you paste is uploaded, logged or stored on a server.

  • Instant results

    Output updates as you type, with precise error locations when something is wrong.

  • Works offline

    Once loaded, the tool keeps working without a connection. Install it as an app if you like.

  • Free, no sign-up

    No accounts, no limits, no watermarks.

FAQ

Frequently asked questions

Which JSON Schema draft should I choose?

Draft 2020-12 is the current version and is supported by modern validators like Ajv 8. Choose draft-07 for older tooling and many OpenAPI 3.0 setups.

Can I validate JSON against the generated schema?

The generated schema works with any standard JSON Schema validator. Review it first: a sample cannot reveal every constraint your data should obey.

Is my data uploaded anywhere?

No. This tool runs entirely in your browser. Your input never leaves your device, is not logged, and works offline once the page has loaded.

Keep going

Related tools

Private by design

Your data never leaves your browser.

498 free tools that run locally — no uploads, no sign-up, no tracking of what you paste. They even work offline.

  • 498free tools
  • 0bytes uploaded
  • 23categories