Generate types from JSON samples
Generate TypeScript, Java 17+ or C# 10+ declarations from one value or up to 100 sample values.
- Runs in your browser
- No upload
- Check before download
Inputs stay in this tab and are not uploaded or saved automatically. Optional aggregate usage counts and coarse processing diagnostics are sent only after consent, without input content or filenames. Clearing or closing loses inputs; save needed outputs first.
Formats and limits
Generate TypeScript, Java 17+ or C# 10+ declarations from one value or up to 100 sample values. A missing field and an explicit null are treated differently in the inferred model. TypeScript uses optional and union types; in Java and C#, your code has to set the presence flags. No deserializer is generated. The root name is ASCII, up to 64 characters; field names are up to 256 characters; empty arrays stay unknown. Root names must not use reserved identifiers of the language or framework, and C# also rejects System to avoid its framework namespace. Member aliases reserve their enclosing type and presence-flag names, and the original JSON names stay in the attributes and the model report.
UTF-8 only. Input up to 1 MiB; XML up to 100,000 UTF-16 units and depth 64; JSON up to 20,000 nodes. JSON Lines up to 16 MiB, 100,000 records and 1 MiB per value. Output up to 32 MiB. Queries run for up to 3 seconds and other jobs for up to 10 seconds in a worker you can cancel. XSD native memory is limited to 64 MiB; this is not the whole worker or DOM heap.
How to use it
- Choose the source and mode
Choose TypeScript, Java or C#, name the root type, and select one sample or an array of samples. Use varied, representative records so that missing, nullable and mixed-type fields show up.
- Configure the domain parameters
The loaded two-record example produces interface Example: id:number and name:string are required, while nickname?:null and active?:boolean are optional because each is missing from one record.
- Inspect diagnostics and download
Download the source declaration and inferred-model.json. Before you use them, check optional fields versus explicit null and how field names were mapped. The tool generates declarations only; it doesn't validate future data or generate a deserializer.
Formats and limits
Why is this input rejected or empty?
Array-samples mode needs 1–100 sample values. Root names must start with an ASCII letter and contain only letters, digits or underscores, up to 64 characters. An empty array gives no evidence of what type its items have.
Which parser profile and limits apply?
This is inference from samples, not a schema guarantee. Java 17+ and C#10+ output may need presence flags that you manage yourself, so read their comments. If the numeric parser rejects a larger identifier because of its precision, write it as a quoted JSON string.
Are inputs or referenced files sent to a server?
Parsing runs locally in a browser worker. URLs inside the input are not used to fetch remote documents. Supply any schema dependencies the tool supports as local files, keep your source file separately, and download the results before you close the page.