What the TypeScript generator writes
A JSON object becomes an exported interface. Nested objects become more interfaces. An array of objects becomes one interface: a key that is missing on some rows is optional. Empty arrays become unknown[]. Null becomes null, and a mix of types becomes a union.
The Zod checkbox adds z.object schemas and import { z } from "zod". The generator does not install packages and does not upload the JSON. Format the JSON first on the formatter if JSON.parse rejects it. Repair trailing commas on Fix trailing comma in JSON.
Frequently Asked Questions
Does JSON to TypeScript upload my JSON?
No. The interface, type alias, and optional Zod schema are generated in your browser.
What does the generator write?
It writes a TypeScript interface for each object, a type alias when the root value is not that interface, and a Zod schema when the checkbox is on.
How are optional fields chosen?
If the JSON is an array of objects, a key that is missing from some objects becomes an optional property. A single object marks every present key as required.
Can I name the root type?
Yes. The Root name field becomes the exported type name. Nested objects get their own interface names.
Will numbers or dates stay exact?
JSON numbers become number, and date-like strings stay string. The generator does not invent Date types. Very large integers can already change when the browser parses JSON.