⚡
usefultools.dev
{S}

JSON Schema Generator from JSON Sample

NOUVEAU

JSON Schema generator that infers draft-07 or 2020-12 schemas from a JSON sample: types, required keys, nested objects and string formats. Free, in-browser.

Fonctionne à 100 % dans votre navigateur — vos données ne sont jamais envoyées ni stockées sur nos serveurs.

Cet outil n'est pas encore entièrement traduit : une partie du texte est encore en anglais. L'outil lui-même fonctionne de la même façon dans toutes les langues.

A key is required only when it appears in every object of the sample. Mixed values become a type list or anyOf.

⚡

Exemples rapides

Des entrées typiques et les résultats produits par cet outil.

Format
{"email":"[email protected]"}
"type":"string","format":"email"
Integer
{"age":31}
"type":"integer", required
Format
{"at":"2026-11-18T09:30:00Z"}
"format":"date-time"
Array
[1, 2.5]
"items":{"type":"number"}
Null
{"n":null}
"type":"null"
📖

Présentation

A JSON Schema generator saves you from writing validation schemas by hand. Paste a representative JSON document and get a schema that describes its types, nested objects, array items and required keys, ready for Ajv, OpenAPI components or form generators.

Array items are merged into one item schema, so a key that is missing from some items is left out of "required", and mixed values become a type list such as ["string", "null"] or an anyOf. Whole numbers are typed as integer. Optional format detection adds email, date-time, date, uri and uuid when every sample value matches. You can target draft-07 or 2020-12 and forbid additional properties.

Everything runs in your browser, so sample data is never uploaded.

Pourquoi utiliser cet outil ?

  • Bootstrap a schema in seconds
  • Required keys inferred from real samples
  • Detects email, date-time, uri and uuid
  • Draft-07 or 2020-12 output
  • Private: runs locally
⭐

Fonctionnalités

🏗️

Nested schemas

Objects and arrays are described recursively with properties and items.

✅

Required keys

Keys present in every sample object go into "required".

🏷️

Format detection

Adds format for email, date-time, date, uri and uuid strings.

🔒

Strict mode

Untick "Allow additional properties" to add additionalProperties: false.

📐

Two drafts

Switch the $schema URI between draft-07 and 2020-12.

⬇️

Copy or download

Copy the schema or save it as schema.json.

🛠️

Mode d'emploi

1

Paste a JSON sample

Use a realistic document; arrays with several items give better results.

2

Pick the draft

Choose draft-07 or 2020-12 and optionally set a Title.

3

Tune options

Toggle Detect formats, Allow additional properties and Require every key.

4

Copy the schema

Click Copy or Download and review it before using it in production.

🤔

Questions fréquentes