Paste any JSON and get ready-to-use Go types in one click. Nested objects, arrays, optional fields and awkward key names are handled for you, and everything runs in your browser, so API responses and sample payloads are never uploaded.
Root.JSON input
{
"id": 1,
"name": "Alice",
"active": true,
"score": 98.5,
"tags": ["admin"],
"address": { "city": "New York" }
}Go output
package main
type Root struct {
ID int64 `json:"id"`
Name string `json:"name"`
Active bool `json:"active"`
Score float64 `json:"score"`
Tags []string `json:"tags"`
Address Address `json:"address"`
}
type Address struct {
City string `json:"city"`
}| JSON | Go |
|---|---|
| string | string |
| whole number | int64 |
| decimal number | float64 |
| boolean | bool |
| array | []T |
| object | a struct |
| null / unknown | interface{} |
Fields are exported (PascalCase) and follow Go initialism rules, so id becomes ID and url becomes URL. Every field carries a json tag with the exact original key.
var root Root
if err := json.Unmarshal([]byte(data), &root); err != nil {
log.Fatal(err)
}Describe the same data with the JSON Schema generator, get TypeScript interfaces, create a SQL table, fix broken input with JSON Repair, or compare payloads with JSON Diff.
Paste your JSON and copy the result. Each nested object becomes a named struct, arrays become slices ([]T), integers become int64 and decimals become float64. Field names are exported and follow Go initialism rules, so id becomes ID and url becomes URL.
A field that is missing from some objects in an array, or null in the sample, is generated as a pointer type with the `omitempty` tag, so you can tell "absent" from the zero value when unmarshalling with encoding/json.
Yes. Every field carries a `json:"key"` tag that matches the original key exactly, so json.Unmarshal and json.Marshal round-trip your data. Everything runs in your browser — your JSON is never uploaded to a server.