Paste any JSON, get clean TypeScript interfaces or types — with nested objects, optional fields, array union inference, and sensible naming. No signup. Runs entirely in your browser.
// Output will appear here as you type
Generates TypeScript interfaces (or type aliases) from any valid JSON input. It walks the entire JSON tree, infers the type of every field, and produces a set of named interfaces that you can paste straight into your codebase. Designed for the common case: you've got an API response, an example payload, or a config file, and you want types that match.
user.address becomes interface Address.users: User[] instead of inlined tuples.(string | number)[].null, or treated as optional fields if you enable the toggle.unknown[] because the actual type can't be inferred from no samples.Root; use something meaningful like UserResponse or WebhookPayload.type Foo = {...} instead of interface Foo {...}. Use this if you intend to add unions or intersections later.export. On by default.?. Useful when your JSON is a single sample and other responses may omit fields.null values to optional any instead of null. Use when your JSON is "field unknown" rather than "field intentionally null."readonly. Useful for immutable response types in Redux/Zustand stores."pending" | "active" | "closed", that's a manual edit (or paste multiple samples and the union will appear automatically).z.input<typeof MySchema> in the opposite direction.The typical workflow: you get an API response from a third-party (Stripe, GitHub, your own backend), you want to type it in your client code, and you don't want to hand-write 40 nested interfaces. Paste the JSON, get the types, paste them into a .ts file, rename the root, and ship.
It's also useful for working with config files, webhook payloads, scraped data, and Mongo documents — anywhere you need quick type safety from sample data. For long-term schema management, consider deriving types from a single source of truth (Zod schema, OpenAPI spec, GraphQL types) instead.
The generated types match what your sample JSON contains, not what the API actually returns. If a field is sometimes a number and sometimes a string across responses, you need to paste both samples for the converter to produce the union. If a field is sometimes missing entirely, enable "All optional" or paste a sample where it's absent.
For mission-critical typing — payment APIs, auth flows, anything where a wrong type costs money — consider deriving types from the official OpenAPI spec or from a validation library like Zod. This tool is for the 80% case where you need types right now and don't have a spec to lean on.
Browse 100+ AI / ML and engineering jobs profiled with real culture data — Glassdoor scores, work-life-balance ratings, and what employees actually say about working there.
Browse Engineering Jobs → Portfolio project ideas →(string | number)[].interface is the more common choice for object types because it supports declaration merging and is the convention in most React/Node codebases. type is required for unions, intersections, and conditional types. For pure JSON-derived schemas, interface is usually what you want.? to every key.null in the type. If a field could be null OR a value (based on the array samples), it becomes a union like string | null. If you want to treat null as "field unknown," enable "Null = optional" to convert null fields to optional any.