Paste JSON and generate clean, nested TypeScript interfaces instantly.
🔒 100% client-side — your JSON is parsed in your browser only and never sent to any server.
Manually writing TypeScript types for a large API response is tedious and error-prone. This tool takes any valid JSON and recursively infers the shape, emitting clean, nested interface declarations you can paste straight into your codebase. It handles nested objects, arrays, optional (nullable) fields, and even mixed-type arrays.
string, numbers become number, booleans become boolean.interface, named after its parent key in PascalCase (e.g. address → Address). Nested objects recurse, so deeply structured responses produce a complete type tree.[]. If every element shares a type you get string[]; if they differ, you get a union like (string | number)[].null is typed as null and the property is marked optional (?:), since nullable API fields are usually also absent when empty.This generator uses interface declarations because they are the most extensible convention for object shapes — they support declaration merging and are easier to augment later. If your codebase prefers type aliases, a simple find-and-replace of interface Foo {'{'} → type Foo = { on the output converts them. The inferred member types are identical either way.
The inferred types reflect exactly the JSON you pasted, not the full schema the API might return. If a field is string in your sample but can also be null in production, widen it manually. For APIs you control, prefer generating types from a sample that includes optional and empty states so the union captures reality.
The JSON to TypeScript handles json to typescriptdirectly in your browser. Paste or type your input, and the tool processes it instantly — no upload, no signup, no waiting. It's built for the moments when you need a quick transformation and don't want to leave your workflow.
Because the tool runs client-side, it's fast and private. Your text never touches a server, which makes it safe for sensitive content. The interface is keyboard-friendly and works on any device with a modern browser.
Common uses: people reach for this tool when they need to use a json to typescript interface generator, convert json to ts types online, nested typescript interface from json, or json to typescript type inference.
Browser-based tools like this one have a few real advantages over installed software or manual methods:
More tools you might find useful