JSON to types, in every language
Paste an API response, pick a language and get the types ready: TypeScript, Go, Python, Rust and more. No data sent.
Genuinely free. No sign-up, no email, no limits, no cookies. We don't store the URL you analyse.
Paste some JSON to generate types in the language you prefer.
What it's for
Hand-writing the types that mirror an API response is the tedious job every developer knows: fields to copy, types to guess, nested objects to keep in sync. This tool does it in an instant and without mistakes, in whatever language you happen to be working in.
JSON to TypeScript
Generate TypeScript interface or type, or a Zod schema to validate data at runtime. Handy when you type the result of a fetch.
JSON to Go, Rust and Python
Get Go struct with json tags, Rust structs with serde, Python classes as dataclass or Pydantic models. Same JSON, the right model for your backend.
The same set includes the JSON ⇄ CSV converter and the code formatter.
Frequently asked questions
›Which languages does it support?
TypeScript (interface or type), Zod, Python (dataclass or Pydantic), Go, Rust, Java, Kotlin, C#, Swift, Dart, PHP, Ruby, C++, Elixir, Haskell and JSON Schema. Pick a target with one click and the output updates in real time.
›How are fields that can be null or missing handled?
The tool analyses the JSON and infers the most precise type it can: a null value becomes an optional or nullable field following the conventions of the chosen language. If you paste an array of objects, it merges the fields of every element so properties present in only some of them aren't lost.
›Is my JSON sent to a server?
No. Generation happens entirely in your browser via quicktype: no data is sent or stored. You can paste a real API response here, with sensitive data, without it leaving your device.
›Can I paste an array instead of a single object?
Yes. Paste a JSON array: the tool builds the element type by merging the fields it observes and derives the structure. It works with both a single object and a list of objects.