JSON to Go

Generate Go structs and JSON tags from sample JSON.

Input

Output

About

Create nested Go structs with exported field names and preserved JSON property tags.

Key Features

  • Nested objects and arrays
  • Downloadable output

How to use

  1. 1Paste a representative JSON sample.
  2. 2Set the root name and generate the definition.

Example

Input

{"id":1,"name":"Ada","tags":["admin"]}

Output

type Root struct {
    ID int `json:"id"`
    Name string `json:"name"`
}

Limitations

  • Input is limited to 2,000,000 characters to keep the browser responsive.
  • Downloads use the .go extension.
  • Numbers are inferred as int or float64 from the sample; review domain-specific numeric types.
  • All input is processed locally in your browser and is never uploaded to ToolHub.

Last reviewed:

Related Tools