What it does
Paste a JSON sample, such as an API response from your ASP.NET Core backend or a webhook payload, and get TypeScript declarations you can drop into a frontend project. The output updates as you type, and a second tab shows the same model as a Zod schema for runtime validation.
How it infers types
- Every array item is examined, not just the first. A key missing from some items becomes optional (
name?: string). A key that is sometimesnullbecomesstring | null. - Mixed arrays become unions, e.g.
(string | number)[]. An empty array becomesunknown[]. - Identical shapes are declared once.
shippingAddressandbillingAddresswith the same properties share oneAddressinterface. - Objects keyed by IDs (
{"101": {...}, "102": {...}}) becomeRecord<string, T>. - Valid output every time: property names that are not identifiers (
"first-name","2fa") are quoted. Type names are PascalCase and singular for array items. Names that would shadow built-ins likeDateorErrorget a suffix. - ISO date strings stay
stringby default, with a comment saying they are a date or date-time. You can also type them asDateif you revive them after parsing. The Zod schema checks them with.datetime()or.date()(Zod 3.23 or later).
Options
Choose interface or type, toggle export and readonly, pick T[] or Array<T>, and set the root type name. A root array produces an item type plus a ...List alias.
How to use it
Paste JSON or drop a .json file, then copy or download the TypeScript or Zod output.
Privacy
The conversion runs entirely in your browser. Your JSON is never uploaded; the last input is kept in local storage.