JSON to TypeScript interface converter
Convert any JSON sample to a TypeScript interface in your browser. Strong type inference, Convert helpers for runtime validation, no upload, no signup.
# context
TypeScript interfaces give you structural typing over API responses, config files, and fixtures. Generating one by hand for a 30-field response is the kind of work that compiles but contains typos. Paste the sample and copy the interface; the tool emits both the interface and optional Convert helpers that validate at JSON.parse time.
JSON input
{
"id": 1,
"name": "Ada Lovelace",
"email": "[email protected]",
"active": true,
"roles": ["admin", "engineer"],
"createdAt": "2026-05-14T00:00:00Z"
} Output preview
export interface User {
id: number;
name: string;
email: string;
active: boolean;
roles: string[];
createdAt: Date;
}
// Plus runtime Convert helpers that validate at JSON.parse time
export class Convert {
public static toUser(json: string): User { /* ... */ }
} → Open in JSON to Types generator (pre-filled)
# notes
- Interfaces are emitted alongside runtime Convert helpers that validate at JSON.parse. Delete the helpers if you only want the type.
- ISO 8601 strings are typed as `Date` and parsed automatically by the helpers.
- Single-sample inference treats every field as required. Paste your most-permissive sample.