JSON to TypeScript
Infer a TypeScript type declaration from sample JSON.
Processing stays in your browser. Types reflect the sample rather than your API contract. Empty arrays become unknown[] and object keys are quoted safely.
How to use the json to typescript
Infer a TypeScript type declaration from sample JSON. Complete the sample json, root type name fields above, or upload a UTF-8 text file for the first field. Choose Run tool, review the output, then copy or download the result.
Example
A numeric age property produces "age": number.
Good to know
Types reflect the sample rather than your API contract. Empty arrays become unknown[] and object keys are quoted safely.