JSON to Rust
Generate Rust serde structs from any JSON sample.
Three steps, no reading required.
Paste your input
Drop text, code, or data into the input pane — from an API response, a file, anywhere.
See it process
The result updates instantly as you type.
Copy the result
Grab the output with Copy or Download, or fix the error shown if the input is invalid.
Try it with a sample.
{"id":1,"name":"Ada","active":true,"roles":["admin","user"],"address":{"city":"London"}}Hand-write serde structs
- Leaves you to add derives and renames
- Treats every field as required
- Uploads your sample
serde-ready structs
- Every struct derives Serialize and Deserialize
- snake_case fields with #[serde(rename)] where keys differ
- Fields missing from some array items become Option<T>
Questions worth answering upfront.
No. Structs are generated entirely in your browser. Your JSON is never uploaded, stored, or logged.
Yes. Every struct derives Serialize and Deserialize, so it works directly with serde_json and the wider serde ecosystem.
Keys become snake_case fields following Rust convention. When the field name differs from the JSON key, a #[serde(rename = "...")] attribute is added so it round-trips exactly.
When an array of objects has a key missing from some elements, the field becomes Option<T> so it can be None.
Yes. Every tool on DevUtilsNow is free to use with no account required.
People who use this also reach for
Guides that pair with this tool
How to Generate Rust Structs from JSON
Turn a JSON sample into Rust serde structs — snake_case fields, serde rename, Option for nullable fields, and Vec for arrays.
Need another tool?
36+ browser-based utilities — all free, all private, nothing to install.