Generate TypeScript types from representative JSON
Paste a representative JSON value to infer nested TypeScript declarations. Review the result before using it as an API contract: inference can describe only the values present in the sample.
Example input
{"id":7,"name":"Ada","tags":["admin"],"profile":null}Expected output
export interface Root {
id: number;
name: string;
tags: Array<string>;
profile: null;
}Behavior
- Infers primitives, objects, arrays, and nested structures.
- Repeated array members are used to infer a compatible element shape.
- Generated declarations can be copied and refined in your editor.
Limits and edge cases
- A missing property cannot be inferred as optional from one object sample.
- Dates and UUIDs arrive as strings unless you refine them manually.
- Empty arrays are emitted as unknown[] until you supply representative items.
Processing note: tool input stays in the browser. Readme.now analytics records page usage, not the payload you paste or the generated output.
Authoritative reference: TypeScript object types