OpenGPT.in

JSON to JSON Schema

Infer a JSON Schema from a sample document.

Runs in your browser Runs entirely in your browser. Nothing you put in it ever leaves your device.

Paste JSON, or drop a .json file here. Converts as you type.

Ready. Everything runs in this page.

Was this useful?


About this tool

Turns an example payload into a draft 2020-12 schema you can use for validation. Types are inferred per key, common string formats such as dates, emails and UUIDs are detected, and keys present in every array item are marked required.

How to use it

  1. Paste a representative JSON document.
  2. Optionally give the schema a title, and decide whether keys should be required.
  3. Copy or download the schema.

Supported input

  • Any valid JSON value

Privacy

Runs entirely in your browser. Nothing you put in it ever leaves your device. Everything happens in JavaScript on this page, so the tool keeps working even if you go offline after it has loaded — which is the simplest way to see for yourself that nothing is being sent. Read the full privacy information.

Questions

Which draft does it target?

Draft 2020-12, declared through the `$schema` keyword. It is the current draft and is understood by most validators.

How are required keys chosen?

For an array of objects, a key is required only if it appears in every item. Turn the option off if you would rather start from a schema with nothing required.

Is an inferred schema good enough to ship?

Treat it as a first draft. It captures structure and types accurately, but only you know which fields should have length limits, enums or patterns.