How to use JSON to TypeScript Interface Generator
- Paste a representative JSON sample.
- Set the name of the root interface.
- Copy the generated interfaces or download types.ts.
Supported features and limitations
Types are inferred from your sample only: numbers become number, null stays null, keys missing from some array items become optional and mixed values become unions. Dates arrive as strings. Always review the output.
Privacy
Everything you type is processed locally in your browser and is not sent to our servers. No account is needed and there is no watermark.
Frequently asked questions
Does it detect dates?
No, ISO date strings are typed as string.
Can it handle arrays of objects?
Yes, items are merged into one interface with optional keys where they differ.
Related tools
- JSON Formatter & Validator - Format, minify and validate JSON with clear errors.
- JSON Key Sorter - Sort the keys of a JSON object alphabetically at every level, ascending or descending, with your choice of indentation.
- JSON Diff Checker - Compare two JSON documents and list every added, removed and changed value with its exact path.
- URL Encoder / Decoder - Encode or decode URLs and query strings.
- Color Converter - Convert between HEX, RGB and HSL colours.
- Password Generator - Create strong random passwords in your browser.