JSON to Go
Convert JSON to Go structs with json tags. Numbers map to int or float64, nested objects become structs, and arrays become slices. Runs locally.
Paste JSON and click Generate to produce Go structs with json tags.
JSON input
Generated Go
What this tool does
This JSON to Go converter takes a JSON document and generates Go type definitions from its shape. It runs entirely in your browser — your data never leaves the page.
How it works
1. Infer types. Every value is inspected: strings, numbers, booleans, null, arrays and nested objects.
2. Merge shapes. Array items are merged so optional fields stay optional.
3. Name fields. Keys become valid target-language identifiers.
4. Emit code. Go definitions preserve original JSON keys.
Frequently asked questions
Does it generate json tags?
Yes. Every struct field gets a json tag matching the original key.
How are numbers mapped?
Integers become int and decimals become float64.
Does JSON to Go upload my data?
No. JSON to Go runs entirely in your browser — your input never leaves this page.
Is JSON to Go free to use?
Yes. JSON to Go is completely free, with no account and nothing to sign up for.