Skip to content

Free tool - no signup

JSON to TypeScript

Paste JSON, get clean interfaces. Nested objects, arrays, optional fields, and unions handled. Nothing is uploaded - it runs in your browser.

TypeScript

Frequently asked questions

How does JSON to TypeScript conversion work here?

You paste a JSON value and the tool walks it, inferring a TypeScript interface for every object and a typed array for every list. Nested objects become their own named interfaces, primitives map to string, number, boolean, or null, and mixed arrays become a union. It all runs locally in your browser, so your JSON is never uploaded.

Does it detect optional and nullable fields?

When you paste an array of objects, the tool compares the objects: a key that is missing from some of them is marked optional with a question mark, and a key that is sometimes null gets null added to its type. A single object cannot reveal what is optional, so for the best result paste a representative array of records rather than one example.

Can I use the output for API response types?

Yes, that is the main use. Paste a real API response, rename the root interface to something like ApiResponse, and drop the generated interfaces into your codebase. Because it infers from actual data, it catches fields the API docs forget to mention. Treat the result as a strong first draft and tighten literal unions or branded types by hand where it matters.

Is my data sent anywhere?

No. The entire tool is client-side JavaScript. Nothing you paste leaves your browser, there is no network request, no logging, and no sign-up. You can open the page, disconnect from the internet, and it still works.