How to use this tool
- Paste JSON, upload a local file, or load a CORS-enabled public URL.
- Choose indentation and run Generate TypeScript.
- Review the result, then copy it or download it with the correct file type.
Turn representative API payloads and fixtures into a readable JsonSample type without sending data to a server.
Generate a deterministic TypeScript type alias from any valid JSON sample, including nested objects and mixed arrays.
Turn representative API payloads and fixtures into a readable JsonSample type without sending data to a server.
{
"user": {
"id": 101,
"display-name": "Ada",
"active": true
},
"roles": ["admin", "editor"],
"metadata": null
}export type JsonSample = {
metadata: null;
roles: Array<string>;
user: {
active: boolean;
"display-name": string;
id: number;
};
};
No. The transformation runs in your browser. URL import contacts only the address you explicitly enter.
The editor marks the likely location and keeps stale output out of the result pane.
It emits an exported JsonSample type with quoted unsafe property names, recursively inferred fields, and deterministic key ordering.
A sample cannot reveal optional fields or domain rules. Empty arrays become unknown[] and all JSON numbers become TypeScript number.