JSON to TypeScript
Nested objects become their own interface, and arrays become typed arrays.
How JSON to TypeScript works
Turn a JSON sample into TypeScript interfaces automatically. Nested objects become their own interface, and arrays become typed arrays. Everything happens inside this page: the tool reads your input, runs the calculation or conversion locally, and hands the result back to you. Nothing is transmitted, because there is no backend to transmit it to.
That design choice is deliberate. Most free tool sites upload your files to a server, process them there, and quietly keep a copy. Toolcin cannot do that — the site is a set of static files. If your connection dropped the moment the page finished loading, every tool would still work.
Interfaces from a sample
Paste a JSON sample and the tool writes TypeScript interfaces. Top-level keys become properties, nested objects become their own named interface, and an array of objects becomes an array of that interface type.
The root interface name is configurable, which matters because the name ends up in every import that uses it.
The inference is only as good as the sample
Every type is inferred from one value. If the sample has age: 30, the type is number — and a later response with age: null or a string will not compile. Union types and optionals cannot be discovered from a single example.
The practical habit: take the largest, most varied response you have, convert that, then hand-edit the optional fields. Generated interfaces are a starting point that saves typing, not a contract.
| JSON | TypeScript |
|---|---|
| 1 | number |
| "a" | string |
| true | boolean |
| [{"id":1}] | { id: number }[] |
| null | any |
Naming and structure
Nested objects are named from their key, capitalised — a user object becomes User. Arrays of primitives become string[] or number[] rather than a named type.
Keys that are not valid identifiers, such as kebab-case or names with spaces, need quoting in the output; check those before trusting the file to compile.
Good to know
- Works offline once loaded, including on flights and in locked-down networks.
- No file size limit beyond your device's own memory.
- Free to use, with no account and no usage counter.
- Results are produced locally, so they are not logged or shared with anyone.
Questions
Does this send anything to a server?
No — it runs entirely in your browser, so whatever you type stays on your device.
Can I use the output commercially?
Yes, output you generate is yours to use without attribution.
Can it generate a Zod or runtime schema?
No, TypeScript types only — and types vanish at runtime.
Does it handle deeply nested data?
Yes, one interface per object level.
Keep going
More files tools
Merge PDF
Combine several PDFs into one document in the order you choose. Pages, bookmarks and text stay intact.
Open toolSplit PDF
Extract any page range from a PDF into a new file. Enter a range like 1-3 or 2,5,7 and get exactly those pages as a new PDF.
Open toolRotate PDF
Rotate all pages or just a few, by 90°, 180° or 270°. Scanned documents often arrive sideways; rotate the pages you need and download a fixed copy.
Open toolCSV to Excel
Turn CSV data into a real Excel .xlsx workbook. Paste CSV and download an .xlsx file built by SheetJS in your browser — numbers stay numbers.
Open toolExcel to CSV
Convert the first sheet of an Excel file into clean CSV. Reads .xlsx, .xls and .csv locally and exports the first sheet as CSV you can paste anywhere.
Open toolPDF to Text
Pull the text out of any PDF, page by page. Reads every page with pdf.js and gives you copyable text with page markers.
Open tool