JSON to Rust
Convert JSON to Rust online for free — generate serde structs from example JSON with rename attributes. No upload.
Rust output
// Generated by blackdroid.dev
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
pub struct Root {
pub id: i64,
pub name: String,
pub email: String,
pub active: bool,
pub balance: f64,
pub address: Address,
pub roles: Vec<String>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Address {
pub street: String,
pub city: String,
pub zip: String,
}About JSON to Rust
Paste JSON and get Rust structs with serde derive — nested objects become their own structs, arrays become Vec<T>, optional fields become Option<T> and non-snake keys get #[serde(rename)].
Built for modeling API responses in reqwest-based services. Generation runs entirely in your browser — your JSON is never uploaded.