Nested StructsJSON Tags100% Private
type Root struct {
	Id int `json:"id"`
	Name string `json:"name"`
	Email string `json:"email"`
	Active bool `json:"active"`
	Score float64 `json:"score"`
	Address Address `json:"address"`
	Tags []string `json:"tags"`
	Orders []OrdersItem `json:"orders"`
}

type OrdersItem struct {
	Id int `json:"id"`
	Total float64 `json:"total"`
}

type Address struct {
	Street string `json:"street"`
	City string `json:"city"`
	Zip string `json:"zip"`
}

FAQ

Does it handle nested objects?
Yes. Nested objects generate separate named structs with proper Go naming.
Are JSON tags included?
Yes. Each field includes a json:"..." struct tag matching the original JSON key.
What Go types are generated?
string, int, float64, bool, []type for arrays, and nested struct types for objects.
Share:

About JSON to Go

What this tool does

Data converter tools transform structured data between JSON, CSV, YAML, XML, TOML, SQL, TypeScript interfaces, Go structs, and more. They handle nested objects, arrays, and type inference automatically.

Why use this tool

APIs return JSON, spreadsheets export CSV, infrastructure config uses YAML, and legacy systems speak XML. Being able to convert between these formats without writing a custom script saves hours of tedious data wrangling.

How it works

The tool parses your input format into an in-memory object tree, then serializes that tree into the target format. Type information (string, number, boolean) is inferred from values and mapped to the closest equivalent in the output format.

Pro tip

When converting CSV to JSON, the first row is treated as column headers by default. If your CSV has no headers, toggle that option off to get array-of-arrays output instead.

Love this tool? Explore 12467+ more

Free online tools for images, PDFs, text, code, and more. All running in your browser.

Explore All Tools