Convert a sample JSON object or API response into paste-ready TypeScript interfaces or type aliases. Nested objects and arrays are processed locally in your browser.
TypeScript interfaces will appear here.
How to use the JSON to TypeScript Interface Generator
Paste a representative JSON response and give the top-level type a clear name. Generate the definitions, then confirm optional fields and null handling against the API documentation before using them in production.
Frequently Asked Questions
How do I generate a TypeScript interface from JSON?
Paste valid JSON, choose a root name, and generate the interface. Review optional and nullable fields against the real API contract.
Can it handle nested JSON?
Yes. Nested objects produce additional named definitions and arrays receive inferred item types.
What happens with empty arrays?
The item type cannot be inferred from an empty sample, so the generator uses unknown[].
Are optional fields detected automatically?
A single JSON sample cannot prove that a field is optional. Use the optional-properties setting when the API may omit fields.
Is my JSON uploaded?
No. Parsing and type generation happen entirely in your browser.
Related Tools