JSON to TypeScript
Generate TypeScript interfaces from a JSON sample.
How it works
- 1Paste a JSON sample.
- 2Name the root type.
- 3Copy or download the interfaces.
Features
- Nested objects become named interfaces.
- Keys missing from some array items become optional.
- Mixed arrays become union types.
- Private: runs in your browser; nothing is uploaded.
Frequently asked questions
Why is a field typed as null?
The sample only has null there. Paste a sample with a real value to get its type.
Related tools
JSON Formatter & ValidatorFormat, validate and minify JSON with clear error messages.JSON ValidatorCheck whether JSON is valid and see exactly where it breaks.CSV to JSONConvert CSV data into a JSON array, with automatic delimiter detection.Base64 DecoderDecode Base64 (standard or URL-safe) back to text.