JSON to Go Struct
Convert JSON into Go struct definitions with json tags, omitempty for optional fields, idiomatic names like ID and URL, and nested structs. Free and private.
Runs in your browser. Nothing is uploaded.
About JSON to Go Struct
JSON to Go writes the struct types you need to json.Unmarshal a payload: exported field names in Go style (user_id becomes UserID), `json:"..."` tags with the original keys, int64 or float64 for numbers, slices for arrays and a separate struct for each nested object.
Fields that are optional or nullable get omitempty and pointer types, so a missing value can be told apart from a zero value.
How to use JSON to Go Struct
- Type or paste your text into the input box. Press Sample to see an example.
- Adjust the options. The result updates as you type.
- Copy the result, or press Use as input to chain another transformation.
Frequently asked questions
Why int64 and not int?
int64 is explicit about size and safe for large IDs on every platform. Change it to int if you prefer.
What happens with mixed-type arrays?
They become []any, since Go slices hold a single type.
Is JSON to Go Struct free and private?
Yes. JSON to Go Struct is completely free with no sign-up. Everything runs in your browser, so whatever you type or paste never leaves your device.