JSON to TypeScript Interface Converter
NOUVEAUConvert JSON to TypeScript interfaces or types instantly: nested PascalCase interfaces, optional props from mixed arrays and null unions. Free, in-browser.
Fonctionne à 100 % dans votre navigateur — vos données ne sont jamais envoyées ni stockées sur nos serveurs.
Cet outil n'est pas encore entièrement traduit : une partie du texte est encore en anglais. L'outil lui-même fonctionne de la même façon dans toutes les langues.
Exemples rapides
Des entrées typiques et les résultats produits par cet outil.
Présentation
This JSON to TypeScript converter turns a sample API response or config file into ready-to-paste TypeScript interfaces. Nested objects get their own PascalCase interface named after the key, array item types are named in the singular (orders → Order), and identical shapes are reused instead of duplicated.
When an array holds objects with different keys, they are merged into one interface and keys missing from some items become optional. Values that are sometimes null become a "| null" union. You can switch between interface and type aliases, toggle export, mark every property optional, and set the root name.
Conversion happens locally in your browser, so private payloads stay on your machine.
Pourquoi utiliser cet outil ?
- Type an API response in seconds
- Optional props inferred from real samples
- Nested interfaces with clean names
- No upload: JSON stays in your browser
Fonctionnalités
Nested interfaces
Each nested object becomes its own PascalCase interface.
Optional detection
Keys missing from some array items are marked with ?.
Null unions
Fields that are null in some samples become T | null.
Interface or type
Output interface declarations or type aliases, with or without export.
Shape reuse
Objects with the same shape share one interface.
Copy or download
Copy the code or save it as types.ts.
Mode d'emploi
Paste JSON
Paste a sample object or array into "JSON sample".
Set the root name
Type a name such as User or ApiResponse in "Root name".
Choose options
Pick interface or type, and toggle export and "All properties optional".
Copy the types
Click Copy or "Download .ts" and add the file to your project.