~/json-to-types

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

# other targets