JSON to TypeScript
Generate TypeScript interface definitions from JSON.
Paste a JSON sample (typically an API response) and get a fully-typed TypeScript interface tree — one interface per nested object, arrays inferred from their elements. Drop the output straight into your codebase and your fetched data is type-safe.
Common use cases: writing types for a third-party API you're consuming, scaffolding domain models from sample data, generating shapes for OpenAPI responses, and getting a quick starting point before refining types by hand for optionality and unions.
JSON
TypeScript
Frequently asked questions
How are nested objects typed?
Array<T> with T as the interface for the array's element type.What if my JSON has fields that are sometimes null or missing?
? manually, or paste multiple sample objects so the inferer can union the differences.How are numbers typed — int vs float?
number) so the distinction disappears. If you need bigint for very large IDs, mark the field manually.Can I generate Zod schemas instead of interfaces?
Other Converters
View all tools →Image to Base64
Convert images to Base64 encoded strings
Roman Numeral Converter
Convert between numbers and Roman numerals
Temperature Converter
Convert between Celsius, Fahrenheit, and Kelvin
Base Converter
Convert numbers between different bases (binary, octal, hex, etc.)
Color Converter
Convert colors between HEX, RGB, HSL, and more formats
JSON to Rust
Convert JSON to Rust struct definitions
CSS Unit Converter
Convert between CSS units (px, em, rem, %, pt)
Text Case Converter
Convert text between different cases (camelCase, snake_case, etc.)
Unix Time Converter
Convert between Unix timestamps and readable dates
Timezone Converter
Convert times between timezones worldwide for meetings and global coordination
JSON to CSV
Convert JSON arrays to CSV format for spreadsheets and data export
CSV to JSON
Convert CSV data to JSON format for APIs and applications