Objects in the same array are merged: keys missing from some items become optional, and differing value types become unions. Identical shapes share one type.
Paste a JSON sample and get TypeScript interfaces, a Zod schema, or a JSON Schema. Objects in arrays are merged, so keys missing from some items become optional and mixed types become unions. Everything runs locally in your browser.
Paste a JSON sample into the JSON box, drop a file, or click Sample.
Pick an Output: TypeScript, Zod, or JSON Schema, and set the Root name.
Choose how Null values are typed, and for TypeScript whether to Declare as interface or type.
Toggle Detect date strings, Readonly properties, or Disallow extra properties as needed, then copy or download the result.
No. Type generation runs in your browser, so API responses with real data stay on your device.
They are merged into one type. Keys that some items lack become optional, and keys with different value types become unions. Identical shapes share one type.
T | null keeps the key required but allows null. Optional + null also lets the key be left out, which suits APIs that drop null fields.
With Detect date strings on, ISO 8601 strings get a comment in TypeScript, a datetime validator in Zod, and a format in JSON Schema.
Yes. Input is parsed leniently, so comments, trailing commas, and JSON5 syntax are accepted, and a note tells you when that happened.