JSON to TypeScript Converter
Paste a JSON sample and get a TypeScript interface or
type back instantly. Conversion runs entirely in your
browser — your JSON never leaves your machine. Handles nested objects, arrays, mixed
unions, and optional properties.
How JSON to TypeScript conversion works
The converter walks your JSON tree, infers a TypeScript type for every node, and names nested objects after their property paths. Arrays produce union element types when items differ; primitive arrays produce a single element type.
- • Objects become
interfaceortypedeclarations - • Mixed-shape arrays produce union element types
- • Missing keys across sibling objects are marked optional (
?:) - •
nullvalues become| null(or optional, if enabled) - • PascalCase names are derived from the property path
Privacy
Conversion runs entirely in your browser via client-side JavaScript. The JSON you paste is never uploaded, never logged, never seen by our server. Disconnect from the internet after the page loads and this tool still works.
For batch JS-to-TypeScript conversion that also stays on your machine, see the free Windows desktop app.