JSON to TypeScript
Generate a TypeScript type from JSON.
How to use JSON to TypeScript
JSON to TypeScript — Build a TypeScript type from a JSON sample so a client can name the response. Free to use in D2i DevTools — no account required.
Steps
- Fill in JSON. This field is required.
- Click Run and copy the result under the form.
Frequently asked questions
What is JSON to TypeScript used for?
Use it when you have an example payload and want an interface or type alias.
How do I use the free online JSON to TypeScript tool?
Fill in JSON. This field is required. Click Run and copy the result under the form.
What can I paste or upload into JSON to TypeScript?
Paste one JSON value. A top-level object becomes export interface Root. Anything else becomes export type Root.
What output does JSON to TypeScript give me?
TypeScript source. Strings, numbers, booleans, null, objects, and arrays are mapped from the sample.
Is JSON to TypeScript free, and is my input private?
Yes — Your input is processed in memory for this request only. It is not saved to disk or the database, and it is cleared after the tool finishes.
Does this include optional fields?
Every key in the sample is required. A field that is missing from this sample will not appear.
Inputs are processed in memory only and are not saved to disk or the database. Data exists only for the duration of your request.