JSON to TypeScript
Infer a TypeScript type declaration from a JSON example.
Your results
JSON to TypeScript
Create a starting TypeScript type from an example JSON response when building an application. The inferred declaration reflects the sample's observed values and fields. Compare it with the API contract before relying on it in production code.
How to use this tool
- Choose a file, drag it into the upload area, import a public file URL, or paste your text below the upload options.
- Review the settings and create your result.
- Download and check the output before using it.
Supported input formats
JSONTXT
Output and limitations
Infer a TypeScript type declaration from a JSON example.
Creates a Root type from sample values, including optional object fields and array unions. Empty arrays become unknown[]. Review the generated types; a sample is not a schema. Maximum nesting depth: 30.
Where are my files processed?
Selected files are processed in your browser. Importing a URL uses the download service to retrieve the remote file.
What if processing fails?
Check the supported formats and file limits, then try a smaller file. Keep an original copy. A clear error message will explain an unsupported input or an unavailable processing service.