JSON to Go Structs

Paste JSON and get Go structs with json tags. More data tools

Generate Go structs from JSON

Each object becomes a struct with exported field names (id becomes ID, url becomes URL) and a json:"..." tag that keeps the original key. Optional keys get omitempty and nullable values become pointers.

Features

  • Live: the result updates while you type.
  • Clear errors: the line, the reason and, where possible, a one-click fix.
  • Open and drop files, copy or download the result, and share your input as a link.
  • Send to another tool: pass the result straight to a related tool.
  • Private: Everything runs in your browser. Your data is not uploaded to any server.

Related data tools

Frequently asked questions

How are numbers typed?

Whole numbers become int (int64 when large) and decimals become float64.

Can I change the package name?

Yes, use the Package box.

Is my data private?

Everything runs in your browser. Your data is not uploaded to any server. You can even use the tool offline once the page has loaded.