JSON to Rust Struct (serde)

Turn JSON into serde-ready Rust structs.

Support
Works Offline
Privacy First
No Login
No API

JSON input

Generate serde-ready Rust structs from a JSON sample

Safer when fields can be missing or null

Rust structs

About the JSON to Rust Struct (serde)

Generate Rust structs from a JSON sample with Serialize and Deserialize derives, snake_case field names, automatic #[serde(rename)] when the JSON key differs, nested structs, typed Vec fields and optional Option<T> wrapping. Runs entirely in your browser.

Examples

Renamed key

{ "userName": "ada" }

Output

#[serde(rename = "userName")] pub user_name: String,

Keyboard shortcuts

  • Copy the main outputCtrl / ⌘ + Shift + C
  • Download the resultCtrl / ⌘ + S
  • Share this toolCtrl / ⌘ + Shift + S
  • Reset the inputsAlt + R
  • Open the tool search paletteCtrl / ⌘ + K

Related tools

Frequently asked questions

Version 1.0.0 · Updated 2026-08-24 · Runs entirely in your browser