What is a JSON to Rust converter?
A JSON to Rust converter turns a raw JSON sample into serde-annotated Rust structs. Paste an API payload and get types you can drop straight into a Rust project next to serde_json. Everything runs in your browser.
How to generate Rust structs from JSON
Paste your JSON and the structs appear live. Press Copy and add them to your project — pair the output with serde and serde_json derives already included in the code.
Type mapping
Whole numbers map to i64, fractional numbers to f64, arrays to Vec<T>, and objects with non-identifier keys to HashMap<String, T>. Values of unknown or mixed shape become serde_json::Value so nothing breaks at runtime.
Naming and serde attributes
Fields are named in snake_case per Rust style. When every key is already camelCase, a single #[serde(rename_all = "camelCase")] is emitted; otherwise individual fields get #[serde(rename)]. Optional and null fields use Option<T>.