Paste JSON. Get TypeScript types.
Paste any JSON — an API response, a config file, something copied out of a log — and get
clean TypeScript interface definitions back, ready to paste into your code.
Nested objects become their own interfaces, arrays of objects are merged into one type,
and a field that only shows up in some items becomes optional (?). Unlike the
JSON Formatter (Tool 5), which only formats and validates, this one generates types.
It converts live as you type.
Your TypeScript types will appear here.
JSON → TypeScript in 30 seconds
string, number, booleanJSON values map straight across: "Ada" → string, 36 → number, true → boolean.nullA null value becomes the null type. If a field is sometimes a string and sometimes null, it becomes string | null.interface, named after its key — "address" becomes Address, "users" becomes User. The top level is Root.Type[]["a", "b"] becomes string[], an array of objects becomes User[], an empty array becomes unknown[], and mixed values become a union like (string | number)[].? — email?: string — so the type stays honest about your data."user-name", are kept in quotes so the output always compiles.
The types are inferred from the values you paste, so they describe your sample — if a
field can be a string in the real API but your sample only shows numbers, the type will
say number. Paste a representative sample for the most accurate result.