</>YZIF

JSON to Rust Struct Generator

Generate Rust struct definitions with Serde derives from JSON. Free online JSON to Rust struct converter with serde attributes.

Click Generate to see output

About This Tool

Generate Rust struct definitions with Serialize and Deserialize derives from your JSON data. Essential for Rust developers building web services with actix-web, axum, or rocket.

The generator includes proper serde rename attributes for camelCase field mapping, handles nested structs, Vec<T> for arrays, Option<T> for nullable fields, and all Rust primitive types.

Each field gets the correct serde attribute — #[serde(rename = "fieldName")] — ensuring seamless deserialization from standard JSON APIs. The code compiles out of the box.

Perfect for prototyping REST API clients, parsing configuration files, or quickly scaffolding data models in new Rust projects. All processing stays in your browser.

Ideal for Rust developers who frequently work with JSON and want to eliminate the boilerplate of manually writing struct definitions matching JSON schemas.