JSON to Go
Generate Go struct definitions from JSON data.
Runs entirely in your browser.
Convert JSON to Go Tool
About JSON
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.
Learn more: JSON Tutorial
About Go Structs for JSON
Go's standard library package encoding/json unmarshals JSON into structs. Struct fields must be exported (start with an uppercase letter) to be visible to the JSON package, so JSON keys like user_name become fields like UserName.
The mapping between a field and its JSON key is declared with a struct tag such as `json:"user_name"`. This tool always emits the tag, so the original key is preserved no matter how the field is renamed. Types are inferred from your sample: strings become string, whole numbers int, decimals float64, booleans bool, arrays []X, and nested objects become their own struct. Mixed or unknown types fall back to interface{}.
Learn more: Go Tutorial