JSON to Go Struct

Convert JSON into Go structs with correct types and json tags

JSON Input

Paste a JSON object or array

Go

Generated structs (run gofmt to re-align)

type Root struct {
	ID      int64    `json:"id"`
	Name    string   `json:"name"`
	Active  bool     `json:"active"`
	Score   float64  `json:"score"`
	Tags    []string `json:"tags"`
	Profile Profile  `json:"profile"`
}

type Profile struct {
	Age  int64  `json:"age"`
	City string `json:"city"`
}