Paste JSON and instantly generate Go struct definitions with proper type inference, json tags, nested structs, and omitempty support. All processing happens in your browser.
Automatically maps JSON types to Go types: string, int, int64, float64, bool, and interface{} for null values. Distinguishes integers from floats.
Handles deeply nested JSON objects by creating separate named structs or inline anonymous structs based on your preference.
Every field includes proper json struct tags matching the original JSON key names. Toggle omitempty for optional fields in API responses.
Converts snake_case and kebab-case keys to PascalCase. Recognizes common Go acronyms like ID, URL, API, HTTP, and JSON.
When building Go applications that consume JSON APIs, you need struct definitions that match the JSON structure. Manually writing these structs is tedious and error-prone, especially for large or deeply nested responses. This tool automates the process by parsing your JSON and generating idiomatic Go code.
stringint (or int64 for large values)float64boolinterface{}[]string or []MyStructencoding/json.Convert between formats, generate code, and validate data with our free developer tools. No sign-up required.