Developer · DEV-04Submit an issue

JSON to Go struct

Infer JSON field types and generate a tagged Go struct.

Go structs · JSON field tags
Input
Output
Usage guide and examples

Convert formats and organize data

Enter a JSON object to generate a Go struct named Root with JSON tags. Types are inferred from the sample; arrays use their first item and integers become int64. Review empty arrays, nulls and optional fields across records.

Check the input format and options with this example before using your own data. Random values, file sizes and presentation vary with the input and settings.

Example input and settings

{"name":"Ada","age":18}

What to check in the result

Name string `json:"name"`
Age int64 `json:"age"`