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
type Root = {
id: number;
name: string;
tags: 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 sample.
- Dates and UUIDs arrive as strings unless you refine them manually.
- Mixed or empty arrays may require explicit union or element types.
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