Generate Rust structs from JSON
JSON to Rust Struct generates a single Root struct annotated with #[derive(Debug, Serialize, Deserialize)] and one field per top-level JSON key, entirely in your browser — nothing is uploaded to a server. Strings, numbers, and booleans map to String, f64, and bool; arrays become Vec of serde_json::Value and nested objects become serde_json::Value, since nested values aren't recursively converted into their own structs. The Serialize/Deserialize derives assume your project already depends on the serde and serde_json crates.
Is JSON to Rust Struct free to use?
Yes, it's completely free with no signup required.
Does it generate nested structs for nested JSON?
No — only top-level keys become typed fields. Nested objects are typed as serde_json::Value and arrays as Vec<serde_json::Value>, rather than generating separate nested struct types.
Do I need any dependencies to use the generated code?
Yes — the derive(Serialize, Deserialize) attribute requires the serde crate (with the derive feature) and serde_json in your Cargo.toml.
Is my data uploaded to a server?
No, generation happens entirely in your browser.