JSON to TypeScript — Generate TypeScript interfaces Online
Paste a JSON sample and instantly generate TypeScript interfaces code in your browser. Free, private, and powered by smart type inference — your data never leaves your device.
Your data never leaves your browser
Generate typesClient-sideCopy & Download
Paste JSON to generate TypeScript code
Optional off keeps shared keys required (e.g. id: number when every array item has id). Null-only fields guesses types from key names — objects use real samples from your JSON when available (Profile | null, not string | null).
JSON input
TypeScript output
About this tool
Generate typesNested objectsOptional fieldsCopy & DownloadPrivacy-first
How to use
- Paste or upload a JSON sample in the input panel.
- Wait for validation — generation runs automatically when JSON is valid.
- Adjust the root type name and language-specific options if needed.
- Copy the generated code or download it with the correct file extension.
- Switch to another JSON→Code tool from the language dropdown for a different target.
Examples
Simple object
{"id":1,"name":"Ada","active":true}export interface Root { ... }Nested API response
{"user":{"id":1,"email":"dev@example.com"},"items":[1,2,3]}Nested TypeScript interfaces with sub-types inferred from structure