JSON to TypeScript

Paste a JSON payload to get ready-to-use TypeScript interfaces. Nested objects and arrays become named types, and keys that are not valid identifiers are quoted automatically.

Free Runs locally No signup
JSON input
TypeScript output
TypeScript interfaces will appear here.
Nested objects and arrays are converted automatically.

How to use it

1

Paste your JSON

Drop a JSON object or array into the input panel.

2

Name the root type

Set the root interface name and choose interface or type.

3

Copy or download

The TypeScript output updates as you type.

Why use this tool

Nested types get names

Nested objects and arrays produce readable, reusable interfaces.

Handles awkward keys

Keys with dashes, spaces or leading digits are quoted correctly.

Runs locally

Your payload never leaves the browser.

Frequently asked questions

Does it infer optional properties?
No. JSON cannot describe optional fields, so every property is marked required. Remove or mark fields manually when an API can omit them.
How are arrays typed?
Arrays use the first item to infer the element type. Empty arrays become unknown[], and mixed primitive arrays become unions.
Can I use type instead of interface?
Yes. Switch the declaration control to type and the generator uses type aliases.
What about null?
Null values become null. If a field can also be a string, use a union such as string | null after generating.
Are my payloads uploaded?
No. Parsing and generation happen in your browser.

Related tools

Last updated: