JSON TO TYPES
JSON to types, five languages, one click.
Paste JSON and pick a target language to generate type definitions: TypeScript interfaces, Go structs (with json tags), Java records, Python dataclasses, Rust structs (with serde). It infers nested objects, merges array elements, marks null fields optional, and splits int/float. All local.
Generated 3 type(s).
Everything runs locally in your browser
How is it inferred?
It walks the JSON recursively: objects become named types (keys → PascalCase); arrays union their elements, and object arrays merge fields across all items (missing keys become optional); integers infer as int, decimals as float; null fields become optional/nullable; multiple types for one field become a union (falling back to a generic type in Go/Java/Rust).
FAQ
Which languages are supported?
TypeScript, Go, Java (records), Python (dataclasses) and Rust (serde) — idiomatic and ready to copy.
Does it handle deep nesting?
Yes. Each nested object becomes its own named type (named from its field), and objects inside arrays are merged into one type.