JSON to TypeScript

Convert any JSON into clean TypeScript interfaces instantly in your browser.

Private & SecureRuns in your browser — nothing is uploaded
Easy to UseJust paste or type — instant results
Free ForeverUnlimited use, no sign-up
Fast & ReliableAdvanced tech, fast and stable

Hand-writing TypeScript interfaces to match a JSON payload is tedious and easy to get subtly wrong. Paste a sample of JSON and this infers the types for you, turning the object into ready-to-use interface definitions you can drop straight into your code.

JSONinterface
JSON → TypeScript types

How to use: JSON to TypeScript

  1. 1Enter inputPaste your JSON on the left.
  2. 2Set optionsSet the root interface name.
  3. 3ProcessToggle export / nullable options.
  4. 4Get resultCopy the generated interfaces.

Common use cases

Type an API responseGenerate interfaces from a real response so your code knows the shape it is dealing with.
Onboard a payload fastTurn an unfamiliar JSON blob into named types you can explore in your editor.
Keep types in syncRe-generate when a response changes so your interfaces match what the server actually sends.
Skip the boilerplateAvoid writing nested interfaces by hand for a deeply structured object.

Good to know

It infers from your sampleThe types are only as complete as the JSON you paste. A field that is missing or empty in the sample cannot be guessed, so paste a representative example.
Nulls and mixed types widenA field that is null in the sample, or that varies across items, may come out broader than you want; tighten those by hand afterwards.
Names come from keysInterface and property names follow your JSON keys, so clear key names give you clean types.
A starting point, not gospelTreat the output as a fast first draft. Optional fields, unions and precise number formats are yours to refine.

Frequently Asked Questions