JSON to TypeScript Converter

Developer Tools

Generate TypeScript interfaces from JSON

FreePrivateInstant
Add a file · .txt .md .csv .json … · up to 2.00 MB
Root interface name
Use
Embed this tool on your websiteFree
  1. Choose how tall the frame should be.
  2. Press Copy code.
  3. Paste it into your page, blog, WordPress or Notion HTML block.
Height

The tool runs inside your visitor's browser, nothing is uploaded, and a small "Powered by ToolCloak" line stays under it. The second line (script) is optional: it makes the frame fit the tool's height.

Similar tools you may like

History

All history →

JSON to TypeScript Converter — at a glance

Save time by generating TypeScript types straight from a sample JSON response.

Input
{"id":1,"name":"Asha"}
Run
Result
interface Root {
id: number;
name: string;
}

How to use it — step by step

A JSON object or array, such as an API response.

1

Paste your input

Paste or type your content into the big input box.

2

Choose options

Pick the mode and options that fit what you need.

3

Generate Types

Press the button. The result is created instantly on your device.

4

Copy the result

Check the output and press Copy to use it anywhere.

Pro tips

Small things that make the result better.

✦Use a sample with all fields filled in for the best result.
✦Fields missing from some array items are marked optional (?).
✦Rename the root interface to match your data.

Quick facts

Nestedinterfaces created
Optionalauto detected
2 stylesinterface or type
Freeno signup

Frequently Asked Questions

What is JSON to TypeScript Converter?+

Paste a JSON sample and get ready-to-use TypeScript interfaces. Nested objects become their own interfaces, arrays are typed automatically and optional fields are detected across array items.

How do I use JSON to TypeScript Converter?+

Open JSON to TypeScript Converter on this page, then: 1. Paste your input 2. Choose options 3. Generate Types 4. Copy the result. Everything runs in your browser on a phone or computer.

Is JSON to TypeScript Converter free to use?+

Yes. JSON to TypeScript Converter on Toolcloak is free, needs no signup and has no hidden limits.

Is the output always perfect?+

It is inferred from your sample, so check it. A field that was always a number in your sample may be a string in other data.

What about null values?+

A null value becomes the type null. Combine it with the real type if the field can be both.

Is my data safe?+

Yes. Everything runs inside your own browser. Your text, files and images are never uploaded to any server.

Also searched as: json to typescript · json to ts interface · generate typescript types from json · json to interface · json to typescript converter · json to typescript converter for mobile

More Free Tools