Generate & Mock Data

JSON to TypeScript

Infer TypeScript declarations from sample JSON and inspect optional or mixed fields.

Browser private
JSON Input
Loading editor…
1 line 0 characters0.0 KB UTF-8
Loading editor…
Preview your result here
Ready when you are| Local processing
|

How to use JSON to TypeScript

  1. Paste representative JSON, including varied array records.
  2. Generate TypeScript declarations.
  3. Review inferred unions and extend the contract for cases absent from the sample.

Input: JSON sample. Output: TypeScript.

Try a small example

Use the workspace's Sample action to load example data, or paste this input and run the tool. Loading an example is an explicit action.

{"name":"Ada","active":true,"scores":[9,12],"address":{"city":"Pune"}}

What to keep in mind

Inference describes observed data, not every possible future response. Empty arrays and null-only samples cannot reveal element types.

Your source and result are separate. Review transformations before applying them, and download an original copy when preserving exact input matters.

Continue your workflow

Read practical JSON guides or learn how local processing works.