JSON to TypeScript
Generate TypeScript interfaces from JSON.
This free JSON to TypeScript converter turns a JSON sample into clean TypeScript definitions, inferring types for strings, numbers, booleans, arrays and nested objects. Unlike a naive converter, it merges the shapes of every object in an array into one interface, marking fields that are missing from some elements as optional, and itreuses identical interfaces instead of emitting duplicates. Paste a real API response and get typed models in seconds.
Tune the output to match your codebase: choose between interfaceand type, add export declarations, prefix names (e.g. I for IUser), pick your indent, mark every field optional, prefer | null over the optional ?, or emit readonly properties. Turn on ISO date detection to type timestamp strings as Date, andstring-enum inference to collapse a small, repeating set of string values (like a status field) into a literal union such as "active" | "archived".
Both panes are syntax-highlighted as you type, invalid JSON is flagged inline with the parser's own message, and you can open or drag in a.json file, then copy or download the generated.ts definitions.
Related tools
JSON Formatter
Format, beautify & validate JSON data.
Base64 Encoder / Decoder
Encode and decode Base64 text instantly.
URL Encoder / Decoder
Percent-encode and decode URLs safely.
Regex Tester
Test regular expressions with live match highlighting.
JWT Decoder
Decode JWT header and payload claims.
Timestamp Converter
Convert Unix timestamps to dates and back.