JSON to TypeScript Converter
Paste JSON and get TypeScript interfaces or types: nested interfaces, optional keys, unions and quoted keys. Updates as you type.
Paste JSON and get TypeScript interfaces or types: nested interfaces, optional keys, unions and quoted keys. Updates as you type.
Used JSON to TypeScript Converter? Share how it went to help others.
About this tool
JSON to TypeScript Converter writes TypeScript types from a sample of JSON, such as the response of an API. Paste the JSON and the declarations appear at once and change as you edit. Every nested object becomes an interface of its own, named after its key, so a key called profile gives an interface called Profile. Arrays of objects are named in the singular, so users gives User. When the items of an array differ, they are merged into one interface, and a key that is missing from some of them becomes optional with a question mark. This is the case that hand-written types most often get wrong. A key that holds different kinds of values becomes a union, for example number or string. An empty array becomes unknown, because there is nothing to learn from it. A key that is null becomes null in a union with the other types seen for it, and with one option every null key becomes optional instead. Keys that are not valid names in TypeScript, such as first-name or keys that start with a digit, are written in quotes. Two objects with the same shape share one interface, and different shapes that would get the same name are numbered, such as Item and Item2. You can name the root type, choose interface or type, and add export to every declaration. A JSON array at the top level gives a type for its items and an array type for the whole. Errors in the JSON are shown with the line and column, so a missing comma is quickly found. Copy the result or download it as a .ts file. Everything runs in your browser, so API responses with private data are not sent anywhere. Remember that types are only as good as the sample. Include every field and a few array items, and check the result against the documentation of the API.

An object or an array.
For example User.
interface or type, export.
As a .ts file.
One per object, well named.
Found by merging array items.
For keys with mixed values.
For names with dashes.
Less typing, fewer mistakes
Types for a fetch call.
ExamplePaste a real response.
Props from sample data.
ExampleChoose type and export.
Type a settings.json.
ExampleRoot name Config.
Payloads from other services.
ExampleInclude a few events.
Types for old JavaScript data.
ExampleStart with the largest object.
See how JSON maps to types.
ExampleCompare both panes.
Better types from better samples
Optional keys are only found when some items lack them.
A key that is null in the sample may hold a string elsewhere. Adjust it by hand.
JSON has no date type, so dates come out as string.
Senior Software Engineer · Developer of Toolyconvert
Hemant developed JSON to TypeScript Converter and tests it on desktop and mobile with real files. He is a senior software engineer from Dehradun, India, building websites since 2014, and designed and developed Toolyconvert end to end.
Last updated 26 November 2026
Featured on
Toolyconvert is listed on these product directories and launch platforms.