Skip to Content

Code generator tool

JSON to Rust, TypeScript & C++

Paste any JSON object or array to generate strongly typed Rust serde structs, TypeScript interfaces, or C++ structs locally in your browser.

INPUT JSON100% local in browser
models.rs
// Paste JSON on the left (or click 'Load Sample') to generate Rust serde structs.

What This Converter Handles Automatically

Objects in the same array are merged into one type, so a key that only some items have becomes optional instead of creating a second type. Each language then gets its own conventions: