JSON to Go Structure

JSON to Go Structure

JSON to Go Structure is an easy-to-use tool that converts JSON into Go structures. Copy, paste, and convert.

It provides the following tools:

  1. Generate Go structures online from JSON strings.
  2. Generate Go models online from JSON strings.
  3. Generate Go mappings online from JSON strings.

How to use JSON to Go Structure online?

  1. Enter or paste your JSON string in the text area above.
  2. Click the "JSON to Go" button to generate your Golang structure code.
  3. Click the "Copy" button to paste it into your clipboard; you can also download the result file.

JSON to Go Structure Example

Input JSON string:

{
  "id":1,
  "name":"John",
  "age":24
}

Output Go structure result:

type Autogenerated struct {
	ID int `json:"id"`
	Name string `json:"name"`
	Age int `json:"age"`
}