JSON → TypeScript
Generate TypeScript interfaces or types from a JSON sample.
Private by design. Your input never leaves this browser. Conversions run locally on your device.
What this tool handles
- Emits an interface or a type alias, named from the root type name you choose.
- Nested objects become their own named interfaces rather than inline literals.
- Unknown and mixed types are written as unknown or any, whichever you select.
- Types describe the sample you paste: a field that is never null in the sample is not optional.
Example
JSON sample
{"id":1,"name":"Ada","address":{"city":"London"},"tags":["a","b"]}
TypeScript
export interface Address {
city: string;
}
export interface Root {
id: number;
name: string;
address: Address;
tags: string[];
}
Related tools
- JSON → Zod — Generate a Zod schema from a JSON sample.
- JSON → Python — Generate Python dataclasses from a JSON sample.
- JSON → Go — Generate Go structs with json tags from a JSON sample.
- JSON → SQL — Generate a CREATE TABLE statement from flat JSON rows.
- JSON → JSON Schema — Infer a JSON Schema from a sample document.
- Convert any format — Pick an input format and an output format and convert between any pair.