Toolmanor

JSON to Go struct

Paste a JSON sample to get Go structs with json tags: named nested structs, pointers for fields that may be null, omitempty for fields not always there.

How to generate a Go struct from JSON

  1. Paste a JSON sample on the left or open a .json file; the Go structs appear on the right.
  2. Rename the root type if you like, for example User or APIResponse.
  3. Copy it or download the .go file and paste it into your package.

Frequently asked questions

Related tools