JSON to Go Struct

developer

Auto-generate Go struct definitions from JSON. Supports nested objects, arrays, json tags, and proper PascalCase naming.

#json#go#golang#struct#types#code generation#developer
Loading tool...

How to use

  1. 1Paste a JSON object into the input
  2. 2Set the root struct name (default: Root)
  3. 3Choose whether to add json tags and use pointers for nested structs
  4. 4Click "Process" to get ready-to-use Go struct definitions

Frequently Asked Questions — JSON to Go Struct

Are nested objects supported?+

Yes. Each nested object becomes a separate named struct, automatically named after its key in PascalCase.

How are json tags generated?+

The tool adds `json:"fieldName"` tags using camelCase as the JSON tag name.

What happens with null values?+

Null values become `interface{}`. Enable pointer mode to get `*interface{}` instead.

What about arrays of objects?+

Arrays of objects generate a separate struct named after the field + "Item" suffix (e.g. ItemsItem).

Related Tools