CurlyJSON

JSON to Rust

Paste JSON — get Rust structs with Serde as you type. Nothing leaves your browser.

to
JSON
Loading the converter…
Rust options
› More options & type detection

Types that match your real data

Built on the open-source quicktype engine, with quieter defaults and a friendlier editor.

Optional fields detected
Fields that are missing or null in some items become optional automatically.
Merge many samples
Paste JSON Lines or an array — every example contributes to one accurate type.
Paste anything
JavaScript objects, trailing commas, single quotes and comments are repaired for you.
Sensible defaults
No surprise enums or date classes — turn detection on only when you want it.
Every option, every language
All of Rust’s generator settings, from naming style to framework annotations.
Private & instant
Runs in a background thread in your browser. Share links keep data in the URL only.

Frequently asked questions

How do I convert JSON to Rust?+

Paste a JSON example on the left. CurlyJSON infers the structure — nested objects, arrays, optional fields and number types — and generates Rust structs with Serde on the right as you type. Copy or download the result.

What if my samples have different fields?+

Paste several samples as JSON Lines (one JSON value per line) or as an array of objects. They are merged into one type, and fields missing from some samples become optional.

Can I paste a JavaScript object from the console?+

Yes. Unquoted keys, single quotes, trailing commas and comments are repaired automatically before the types are generated.

Is my data uploaded?+

No. The conversion runs entirely in your browser, in a background thread. Nothing is sent to a server.

Why don’t I see enums or date types?+

By default, string fields stay strings so the output matches your JSON exactly. Turn on “Detect enums” or “Detect dates” under Options to generate enum and date types.

Code generation uses quicktype (Apache-2.0 license).