Converter Web ToolsConverter WebTools

JSON to Go Struct

Create a JSON to Go in your browser, free and instantly.

Paste JSON to generate a Go struct with json tags. Nested objects become inline structs and arrays become slices; numbers are typed as int or float64, and null/empty values fall back to interface{}. Everything runs in your browser.

About JSON to Go

This tool converts JSON into a Go struct with json tags. Paste JSON and it infers the types — nested objects become inline structs, arrays become slices, and numbers become int or float64 — giving you a struct you can paste straight into Go code.

How JSON to Go works

How to use it

  1. Paste your JSON.
  2. Copy the generated Go struct.

How it works

It walks the JSON and builds matching Go types: field names are exported (capitalised) with a json tag preserving the original key, objects become nested structs, arrays infer their element type from the first item, and null or empty values fall back to interface{}.

Common uses

  • Generate a Go struct from JSON
  • Map an API response to Go types
  • Save time writing structs
  • Add json tags automatically
  • Model nested JSON in Go
  • Prototype Go data types
  • Learn Go struct syntax
  • Convert config JSON to Go

Frequently asked questions

How do I convert JSON to a Go struct?
Paste JSON and copy the generated struct.
Does it add json tags?
Yes — each field keeps its original key as a json tag.
How are numbers typed?
Whole numbers become int; decimals become float64.
What about nested objects?
They become nested inline structs.
What if a value is null?
It falls back to interface{}.
Is my JSON uploaded?
No — conversion runs in your browser.
Are arrays supported?
Yes — they become Go slices typed from the first element.
Is it free?
Yes — completely free with no sign-up.