100% local — your data never leaves your browser

JSON to Rust Struct Converter — Serde, Free Tool

Generate Rust serde structs from JSON instantly in your browser. Free and private: your data never leaves your device.

Instant Private Zero cookies

JSON input

Rust output

Why convert JSON to Rust structs?

Modeling an API payload in Rust means writing structs, serde derives and rename attributes by hand. Paste your JSON above and get compiling code: snake_case fields, #[serde(rename)] where needed, and one struct per nested object.

How it works

The converter infers the structure of your JSON locally and emits serde structs parent-first. Integers map to i64, decimals to f64, nullable array items are wrapped in Option, and Rust keywords like type become raw identifiers.

Frequently asked questions

Is my JSON data uploaded to a server?
No. The conversion runs entirely in your browser with JavaScript. Nothing is sent over the network, which makes the tool safe for sensitive data.
Are serde attributes generated?
Yes. Structs derive Serialize and Deserialize, fields are snake_case, and keys that differ get a #[serde(rename = "...")] attribute so deserialization matches your payload.
How are null values and mixed arrays typed?
Arrays containing null become Vec<Option<T>>, and arrays mixing incompatible types fall back to serde_json::Value so your code always compiles.

Related converters