JSON to TypeScript. Paste JSON, ship types.
Get clean TypeScript interfaces or type aliases from any JSON, optional-property detection, literal unions, readonly props and full naming control. Runs 100% in your browser; nothing is uploaded.
A free online tool by Digital HeroesYour JSON never leaves your browser, nothing is uploaded.
Codegen without the round-trip
Paste an API response, a config file or any JSON object and the converter infers a full type model on your device: nested objects become their own named interfaces, arrays of objects are merged so a key missing from some items comes out as an optional ? property, and small repeated string sets become literal unions like 'shipped' | 'pending'. Choose interfaces or type aliases, T[] or Array<T>, how nulls are treated, quotes, semicolons and indentation, then copy the result or download a ready-to-import .ts file. No account, nothing uploaded, free forever.
Everything a converter should do.
- Convert JSON to TypeScript interfaces or type aliases the moment you paste, no button to press.
- Auto-detect optional properties by merging shapes across array items, so ragged API data types honestly.
- Generate literal union types for small string sets (up to 4 unique values) like status or role fields.
- Control the output style: export keyword, readonly props, semicolons, quotes, T[] vs Array<T>, null and unknown handling, nested-name prefixes and indent size.
- Copy or download a ready-to-use .ts file named after your root type.
- Load any .json file by dropping it onto the page, read locally, never uploaded.
Four steps, no manual.
- Paste your JSON into the left panel, or drop a .json file onto the load zone (up to 15 MB, read locally).
- Name the root type and pick interface or type alias, the TypeScript regenerates live.
- Tune the options: array syntax, quotes, null handling, optional detection, readonly, literal unions, indentation.
- Copy TypeScript to your clipboard or Download .ts, your data stays on your device throughout.
Frequently asked questions.
Is JSON to TypeScript free?
Is it private? Is my JSON uploaded anywhere?
Does it work offline?
How does optional-property detection work?
When are literal union types generated?
Can I load a .json file instead of pasting?
Published · Last updated .