Skip to main content

JSON Schema generator

Paste example JSON and get a starting JSON Schema with types, properties and required keys. Review optional fields by hand. Runs locally in your browser.

Infers a starting schema from one example (no $schema keyword is added). Runs locally; nothing is uploaded.

Paste one example JSON document and get a starting JSON Schema you can refine. Useful for API contracts, structured-output prompts and validation. It runs locally in your browser.

How to use

  1. Paste an example object or array into Example JSON.
  2. Click Generate schema. Parse errors are shown with the browser’s message.
  3. Copy the schema from the output box and edit it.

How types are inferred

  • Strings, booleans and null map to string, boolean and null.
  • Whole numbers become integer; numbers with decimals become number.
  • Objects list every key under properties, mark all of them required, and set additionalProperties: false.
  • Arrays take their items schema from the first element only.

Limits

One example cannot show which fields are optional, which values are enums, or string formats such as dates and emails, so review those by hand. No $schema keyword is added; add the JSON Schema version (for example 2020-12) your validator expects. If later array elements differ from the first one, widen items yourself.

JSON formatter · JSON to CSV · JSONL validator

How we check

Checked against the tool’s unit tests and a manual run in a desktop browser on 2026-11-13 (Asia/Colombo). Corrections: [email protected].

More free tools