JSON to Rust
Generate Rust struct definitions with serde derives from JSON.
Paste a JSON sample and get Rust structs with #[derive(Serialize, Deserialize)] ready to drop into a serde_json project. Nested objects become their own structs; arrays become Vec; field names that aren't valid Rust identifiers get a #[serde(rename)] attribute.
Common use cases: writing a typed client for a JSON API, modelling configuration files in Rust, generating fixtures for tests, and getting a starting point that's faster than writing structs by hand for a deeply nested response.
JSON
Rust
Frequently asked questions
Does the output include serde annotations?
#[derive(Serialize, Deserialize)] so the type can round-trip with serde_json. Field names that aren't valid Rust identifiers get a #[serde(rename = "…")] attribute mapping back to the JSON name.How are numbers typed?
i64 (or u64 if always positive); numbers with a decimal point become f64. For very large IDs you may want to swap i64 for String manually to avoid precision loss across systems.What about optional fields?
Option<…> and add #[serde(default, skip_serializing_if = "Option::is_none")].How are nested objects and arrays modelled?
Vec<T>. Heterogeneous arrays (mixed types) fall back to serde_json::Value — refine those manually if you know the variants.Other Converters
View all tools →Image to Base64
Convert images to Base64 encoded strings
Roman Numeral Converter
Convert between numbers and Roman numerals
Temperature Converter
Convert between Celsius, Fahrenheit, and Kelvin
Base Converter
Convert numbers between different bases (binary, octal, hex, etc.)
Color Converter
Convert colors between HEX, RGB, HSL, and more formats
JSON to TypeScript
Convert JSON to TypeScript type definitions
CSS Unit Converter
Convert between CSS units (px, em, rem, %, pt)
Text Case Converter
Convert text between different cases (camelCase, snake_case, etc.)
Unix Time Converter
Convert between Unix timestamps and readable dates
Timezone Converter
Convert times between timezones worldwide for meetings and global coordination
JSON to CSV
Convert JSON arrays to CSV format for spreadsheets and data export
CSV to JSON
Convert CSV data to JSON format for APIs and applications