Paste a sample JSON payload and get TypeScript types for it. Nested objects get their own interfaces, arrays are merged into one element type, and keys that don't appear in every item become optional.
Types are inferred from the sample you give: keys missing from some array items become optional, mixed values become unions. A single sample can't show every shape the API returns — review the result.
Pyalm builds custom software, APIs and integrations for businesses in India and the UAE. We made these developer tools for our own team — use them free, and talk to us when you need something built.
Typing a large API response by hand is slow and error-prone. The converter reads your sample, names an interface for every nested object, and merges array elements: if some items have a discount field and others don't, the field becomes optional; if a value is sometimes a string and sometimes null, you get a union.
A type inferred from one sample can only describe what that sample shows. A field that is always a number in your example might be null in production, or a string enum might have more values than you saw. Use the generated types to get going, then tighten them against the API's schema or documentation.
📖 Read the full guide: JSON to TypeScript Types: Inference and Validation
Format, validate, minify and syntax-highlight JSON — with exact error line and column.
Convert CSV to JSON and JSON to CSV with delimiter detection, type inference and flattening.
Compare two JSON documents and see every added, removed and changed value by path.
Send GET, POST, PUT, PATCH and DELETE requests from your browser and inspect the response.
Both work for object shapes. Interfaces can be extended and merged, and give clearer error messages; type aliases are required for unions and mapped types. Pick whichever your codebase already uses.
Names that aren't valid identifiers are quoted: "issued-at": string;. Type names are converted to PascalCase from the property name.
An empty array has no element to infer from, so its type is never[]. Add a representative item to the sample.