JSON → types and schemas

Turns a JSON sample into code that describes it: TypeScript interfaces, Go structs, a Zod schema or a JSON Schema. Arrays of objects are merged: keys missing in some become optional, values that are sometimes null become nullable.

In
JSON
Out
TS · GO · ZOD · schema
Options
Input · JSON
Output · TS · GO · ZOD · schema

Waiting for input

Runs in this tab. The text is not sent anywhere.

Related

Questions

How are optional fields found?

From arrays: if a key is in some objects of an array and not in others, it is optional. Paste a few real records, not one, and the types come out closer to the truth.

Does it tell integers from decimals?

Yes — for Go (int64 or float64) and Zod (.int()). TypeScript has one number type.

Is my JSON sent anywhere?

No. The types are generated in this tab.

↑ ↓ move · Enter open · Esc close