JSON to TypeScript
Turn any JSON payload into clean TypeScript interfaces or type aliases, generated in your browser.
100% private — everything runs in your browser
How to Use
- 1
Paste a JSON object or array — an API response works well.
- 2
Set the root type name and pick the options you need.
- 3
Click Generate types, then copy the TypeScript output.
Examples
API response
Input
{ "id": 1, "user": { "name": "Ada" } }Output
interface Root { id: number; user: { name: string }; }Array of objects
Input
[{ "sku": "A1", "price": 9.5 }]Output
type Root = { sku: string; price: number }[];FAQ
How are optional fields handled?
Keys that are missing in some array items become optional with a ? marker.
Can it generate more than one type?
Yes. Nested objects get their own named types, so the output stays readable.
Is my data uploaded?
No. The generator runs entirely in your browser.
Related Tools
JSON FormatterFormat, beautify, minify and validate JSON instantly — right in your browser.JSON ValidatorValidate JSON instantly and find syntax errors with the exact line, column and position — right in your browser.JSON to CSV ConverterTurn a JSON array of objects into clean CSV, ready for Excel, Google Sheets or a database import.Base64 Encoder/DecoderEncode text to Base64 and decode Base64 back to text with full Unicode and emoji support — 100% in your browser.URL Encoder / DecoderEncode text for URLs with encodeURIComponent or encodeURI, and decode percent-encoded strings.Unix Timestamp ConverterConvert Unix timestamps to readable dates and back, with seconds and milliseconds support.