JSON to TypeScriptTypes
Paste a JSON sample and get clean TypeScript interface declarations — nested objects, typed arrays, and nullable fields included, all generated locally in your browser.
Paste a JSON sample and get clean TypeScript interface declarations — nested objects, typed arrays, and nullable fields included, all generated locally in your browser.
Drop in a representative JSON value and the tool walks its shape, emitting one interface per nested object and unifying array element types. Tune the root name and toggle export and readonly to match your codebase.
Provide a single representative object, an array of records, or any valid JSON value. The more complete your sample, the more accurate the inferred types — include rows that exercise every optional field.
Choose the root interface name (defaults to Root). Toggle the export keyword on for module-friendly declarations, and turn on readonly if your properties should be immutable.
Each nested object becomes its own PascalCase interface and arrays resolve to typed element arrays. Copy the result or download it as a .ts file and drop it straight into your project.
A focused way to bootstrap accurate TypeScript definitions from real API responses or fixtures without hand-typing every field.
Every object-valued property becomes a separate named interface in PascalCase derived from its key, so deep structures stay readable instead of collapsing into one giant inline type.
Arrays of objects merge into a single element interface, mixed primitive arrays resolve to a union like (string | number)[], and empty arrays fall back to unknown[] so nothing is silently mistyped.
A null value marks a property optional and nullable, and keys absent from some records in an array are flagged optional with a ?, matching how real-world payloads actually vary.
Your JSON never leaves the browser. The inference runs as static JavaScript with no network calls, so even sensitive sample payloads stay on your machine.