Paste representative JSON
Include nested objects and realistic array values so generated types reflect actual data.
Developer tools
Generate TypeScript interfaces from JSON
The result will appear here after you run the tool.
Press Ctrl or Command and Enter to run the tool.
About this tool
JSON to TypeScript creates readable interface definitions by inspecting a representative JSON sample for objects, nested properties, and array shapes. Generation occurs inside your browser, with options for root name and optional properties.
Paste representative JSON to create readable TypeScript interfaces for objects, nested properties, and arrays. Configure the root type name and optional property behavior.
Built for daily work
How to use this tool
Include nested objects and realistic array values so generated types reflect actual data.
Choose the root type name and whether properties should be optional.
Sample based generation cannot discover absent values or every possible union type.
Key features
Nested objects become named TypeScript definitions.
Arrays generate primitive, object, or union item types based on observed values.
Invalid property identifiers are quoted and generated type names are converted to PascalCase.
Practical use cases
For local tools, input is processed in your browser and is not sent to application analytics.
Data processing noticeTechnical details
Limitations and important notes
Frequently asked questions
No. They reflect only the supplied sample. Test additional responses and adjust optional or union types.
A null sample produces the null type. Use additional samples or edit the output when a property can also hold another type.
Keys that are not valid identifiers are emitted as quoted property names.
Related guides and solutions
A guide to generating TypeScript types from JSON: interfaces, unions, nullability, and keeping types in sync with APIs.
Learn moreTyping API responses by hand wastes time and drifts from the real shape. The [JSON to TypeScript tool](tool:json-to-typescript) generates interfaces from a JSON sample instantly, locally.
Learn moreA practical guide to indentation, syntax validation, key order, parser errors, and safe output review.
Learn moreRelated tools
JSON tools
Infer a JSON Schema from sample data with nested properties, required fields, arrays, and detected types.
Open toolJSON tools
Format, validate, inspect, search, and analyze JSON in code, tree, table, schema, and statistics views.
Open toolJSON tools
Explore nested JSON, search keys and values, and copy exact paths or selected values.
Open tool