JSON to TypeScript Converter
Turn a JSON sample into TypeScript type definitions automatically.
Types from real data
Writing TypeScript interfaces by hand to match an API response is tedious and error-prone, especially for deeply nested data. This reads a JSON sample and infers the TypeScript types — the interfaces, the field types, the nesting — so you get a solid starting point in seconds instead of transcribing structure field by field.
Paste a representative JSON response and the TypeScript types are generated.
A starting point to refine
The generated types are inferred from one sample, so they are a draft to review rather than the final word. The tool cannot know that a field is optional if your sample always includes it, or that a string is really a union of specific values, or that an empty array holds a particular type. Take the generated interfaces and tighten them with that knowledge — mark optional fields, narrow loose types — and you get accurate types for a fraction of the effort of writing them from scratch.
Frequently asked questions
How accurate are the generated types?
They are a strong starting point inferred from your sample, but review them — the tool cannot know which fields are optional or which strings are really fixed unions.
What should I give it?
A representative JSON response that includes the fields you expect, so the inferred types cover the real shape.
Is my JSON uploaded?
No. The types are generated in your browser.