Paste a JSON sample and get TypeScript interfaces, type aliases or a Zod schema as you type. Arrays of objects merge into one type, and repeated strings can become enums. Nothing is uploaded.
Free · No sign-up · Browser-only processing
JSON to TypeScript and Zod
interface · type · Zod schema from any JSON
Never uploaded
Your JSON
Valid
Comments, trailing commas, single quotes and unquoted keys are fine.
Generated on your device. Review the result before using it: a sample describes the values you supplied, not every value your API might return.
Start with a useful sample
Paste an API response, import a small JSON file, or try the merged array example. Comments, single quotes, unquoted keys and trailing commas are accepted using JSON5 parsing. Format converts your input to strict JSON. Executable JavaScript is never evaluated.
Model the whole array
Objects in an array share one inferred shape. Fields missing from some records become optional; mixed values form unions, and null stays explicit. Empty arrays produce unknown items. Enable All fields optional to make every object property optional, including nested properties.
Review, copy and use
Choose interfaces, type aliases or Zod, name your root, then copy or download the TypeScript file. Zod output requires the zod package in your own project. Inferred schemas describe your sample: dates remain strings, and unique strings stay broad. Review assumptions before validating production data.
Frequently asked questions
Does Types Studio send my JSON to a server?
No. Parsing and conversion happen in this browser. Upload reads a local file; Copy and Download are explicit actions. Your sample is not automatically saved or uploaded.
How are string enums detected?
At the same field, 2 to 12 distinct strings become a union or z.enum only if at least one value repeats. This is a sample-based guess; turn it off when the API may return other values.
Can I use arrays and primitive JSON values?
Yes. Root arrays and primitive values use a type alias even in interface mode. Nested objects receive named declarations. A sample is limited to 100,000 characters, 20,000 values and 40 nesting levels.