JSON to Go / Rust Struct
Convert JSON to Go struct (with json tags) or Rust struct (with serde). Handles nested types. Free, no signup.
Preparing private browser tool…
Frequently asked questions
- Does this support nested JSON objects?
- Yes. Each nested object becomes a separate named struct in both Go and Rust output.
- How are JSON number types mapped?
- Integers map to int64 (Go) or i64 (Rust). Floats map to float64 (Go) or f64 (Rust). Detection is based on whether the value has a decimal point.
- Is my data sent to a server?
- No. All conversion runs entirely in your browser using JavaScript. Your JSON never leaves your device.
- How are field names and tags generated?
- Go fields are PascalCase with a json tag carrying the original key. Rust fields are snake_case, and a serde rename attribute is added whenever the Rust name differs from the JSON key.
- What do null and empty arrays become?
- A null becomes *string in Go and Option<String> in Rust, which is a guess you should correct by hand. An empty array becomes []interface{} or Vec<serde_json::Value>, since there is no element to infer a type from.