JSON to TypeScript
Turn a JSON sample into TypeScript interfaces or type aliases, with nested types, unions and optional fields.
Result
- Types
- —
- Size
- —
How it works
- Nested objects become their own named interfaces; arrays of objects become typed arrays (
Tag[]). - Mixed values in an array produce a union type, and
nullis always added as an option. - Field names that are not valid identifiers are quoted automatically, and numbers become
number.