Generate TypeScript interfaces from any JSON object.
Types are inferred from this sample. All array elements are included; missing object properties become optional. Empty arrays use unknown[]. A sample cannot prove your full API schema.
Runs in your browser. Your input is processed on this device.
This JSON to TypeScript converter generates strongly-typed interfaces from a sample JSON object. Paste an API response or config, and it infers the shape — turning nested objects into their own named interfaces and inferring array element types — so you can drop the result straight into your codebase.
It saves you from hand-writing types for large payloads and helps catch shape mismatches at compile time. Everything runs locally in your browser.
Nested objects become their own named interfaces, referenced from the parent. Arrays infer their element type from the first item, so provide a representative example with populated arrays for the best result.
Empty arrays give the tool nothing to infer from, so their element type falls back to unknown[]. Fill in at least one element, or adjust the generated type manually afterward.
It types exactly what is present in the sample. If a field is optional in your real data, add the ? modifier yourself, or paste a sample that represents the fullest possible object.