JSON to Go Struct
Generate Go struct definitions from JSON. Includes proper type inference, JSON tags, and nested struct support.
About this tool
Create Go structs with JSON tags from sample payloads. Helps you unmarshal API responses without manual field mapping.
Example use case: Paste webhook JSON and generate a Go struct for your handler.
Root struct:
Package:
Frequently Asked Questions
How are JSON field names handled in Go?▾
Go convention is PascalCase for exported fields. JSON tags (`json:"fieldName"`) map the Go field name to the original JSON key, which may be camelCase or snake_case.
What Go types are used for numbers?▾
Integers map to int64, floating-point numbers to float64. Date strings (ISO 8601) are mapped to time.Time.
Does the tool handle arrays?▾
Yes. JSON arrays become slices in Go. The element type is inferred from the first array item.