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.
More tools you might find useful
Craft signed JWTs locally — pairs with our decoder for testing.
Press any key — see key, code, keyCode, and modifiers live.
LED, supply, and target current in - ideal and E12 resistor out.
Grep-style filtering for logs — keyword, level, or regex.