About this tool
Paste a JSON sample and this tool generates ready-to-use Go structs, complete with `json:"field"` tags for every key. Everything runs locally in your browser, so your JSON is never uploaded anywhere.
The generator calls JSON.parse and walks the result recursively: strings become string, booleans become bool, whole numbers become int64 and numbers with a decimal become float64, null becomes interface{}, arrays become a slice of the first element's type ([]interface{} when empty), and each object becomes its own named nested struct. Field names are converted to exported PascalCase (with common initialisms like ID and URL upper-cased) while the original key is preserved in the json tag.
Use it to bootstrap Go models from an API response or config file, then tidy the types by hand where needed. Because JSON has no separate integer type, a value like 1.0 is read as an integer; add a decimal (1.5) if you want float64.