Every API integration starts the same way: a JSON response in the Network tab, and a developer typing out the interface by hand. It works until the response has a nested object three levels deep, a field that is sometimes null, and an array where one item is missing a key the others have. Then the hand-written types lie, and the runtime finds out first.
The fasttools.me converter takes the other route: paste the raw JSON, get TypeScript interfaces, type aliases, and a Zod schema from the same payload — https://fasttools.me/json-to-typescript — free, and the parsing runs in your browser. Nothing you paste leaves the machine.
What it actually does
Paste a response and the engine walks the object tree, depth-first, and pulls each nested object out into its own PascalCase interface. billing_address becomes BillingAddress. No anonymous nested types buried inside a parent.
Three behaviours matter more than the output format:
- Dates, UUIDs, emails and URLs are detected, not left as plain strings. An ISO timestamp becomes
z.string().datetime()in the Zod schema; an email becomesz.string().email(). - Missing keys become optional. If one item in an array has a key the others lack, the merged interface marks it with
?—price?: number— instead of pretending the key is always there. - Mixed arrays become unions.
["a", 10, true]becomes(string | number | boolean)[], and the Zod side becomesz.array(z.union([...])). A null field becomesstring | null, not a silentstring.
Keys that break JavaScript naming — x-api-key, user.id — come out quoted so the generated code compiles as-is.
The workflow that holds up
- Capture a complete sample payload from the Network tab or your API tool — a whole object, not a trimmed one. A partial sample produces types that miss the fields you did not show it.
- Paste it in and name the root clearly, like
StripeInvoiceResponse. The root name is the type name your codebase will read for months. - Pick the output: interfaces for contracts and declaration merging, type aliases for unions and root arrays, or the Zod tab for runtime validation with
z.infergiving you the type back. - Copy or export the
.types.tsfile into your project —types/api.tsis the usual home — and let the compiler, not a runtime error, catch the next shape change.
The Zod tab is the part worth keeping. TypeScript types vanish at compile time; a Zod schema still checks the payload at runtime, when the API you do not control ships a field as a string that used to be a number.
What worked
It is genuinely in-browser. Payloads are parsed in browser memory with native Web APIs — no server storage, no payload telemetry. Paste a response with a customer record in it and it never leaves your machine.
One payload, three outputs. Interfaces, aliases and Zod from the same paste, with the tabs in sync. Other converters split those across pages or make Zod a second step.
The inference is specific, not generic. Dates, emails and UUIDs get real checks in the schema instead of every string staying a bare z.string().
What broke — or rather, what is hard
A converter can only type what you show it. Paste one sample and the types describe that sample. If the API sometimes returns a field you did not include, the generated type will not know about it — same as hand-writing, only faster. Capture two or three different responses for an endpoint with variable shapes, and merge the results.
TypeScript 5.x and Zod 3.x output. That is current today; if your project is pinned to an older Zod major, check the generated schema calls against your version before pasting it in.
No affiliate angle here, and none is claimed. This is a free fasttools.me tool, $0, no signup. It earns nothing from a click — it is in the sprint because developers who type API responses by hand are the same people who run n8n workflows, and the tool is genuinely useful to them.
Who it is for
This fits if you consume JSON APIs in TypeScript and you want the contract written from the real payload instead of from memory. It fits less if your API already ships an OpenAPI spec — generate from the spec then, and use this converter for the undocumented endpoints, the webhooks, and the third-party responses that arrive with no schema at all.
Try it with your messiest real response, not the clean example: https://fasttools.me/json-to-typescript
Alfaz Mahmud Rizve — GTM & RevOps Architect. I build autonomous revenue systems for scaling agencies and SaaS: SEO & organic growth, high-speed Next.js apps, and self-healing n8n workflows. whoisalfaz.me