{"@context":"https://schema.org","@type":"SoftwareApplication","name":"JSON to Go Struct","description":"Convert JSON into Go structs with correct types and JSON struct tags. Handles nested structures and slices for fast Go model scaffolding.","url":"https://www.devtools.tools/json-to-go","applicationCategory":"Development Utilities","operatingSystem":"All","browserRequirements":"Modern web browser","permissions":"none","isAccessibleForFree":true,"screenshot":"https://www.devtools.tools/og?title=JSON%20to%20Go%20Struct&category=Development%20Utilities","author":{"@type":"Person","name":"Göksel Yeşiller","url":"https://github.com/mryesiller"},"publisher":{"@type":"Organization","name":"DevTools","url":"https://www.devtools.tools","logo":{"@type":"ImageObject","url":"https://www.devtools.tools/assets/logo-light-v11.svg"}},"offers":{"@type":"Offer","price":"0","priceCurrency":"USD","availability":"https://schema.org/InStock"},"keywords":"json to go, json to struct, golang struct generator, go json tags, json to golang","mainEntity":{"@type":"WebApplication","name":"JSON to Go Struct","applicationCategory":"DeveloperApplication"}}{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://www.devtools.tools"},{"@type":"ListItem","position":2,"name":"JSON to Go Struct","item":"https://www.devtools.tools/json-to-go"}]}{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What does it generate from JSON?","acceptedAnswer":{"@type":"Answer","text":"Go struct definitions with correctly typed fields, json struct tags, and recursive types for nested objects and arrays. The output is ready to paste into a model file in a Go service."}},{"@type":"Question","name":"How are field names translated to Go?","acceptedAnswer":{"@type":"Answer","text":"snake_case JSON keys become CamelCase Go field names (first_name → FirstName) by default, and each field carries a json:\"first_name\" tag so the decoder still maps the original key back. You can change the casing rule if you prefer a different convention."}},{"@type":"Question","name":"What types are chosen for unusual or mixed values?","acceptedAnswer":{"@type":"Answer","text":"Numbers become float64 unless they all look like integers, booleans become bool, and strings become string. Nested objects get their own named struct, and arrays use the inferred element type or []interface{} when the contents are mixed."}},{"@type":"Question","name":"Is my JSON uploaded?","acceptedAnswer":{"@type":"Answer","text":"No. The converter runs entirely in your browser; nothing is sent to a server."}}]}
JSON to Go Struct
Convert JSON into Go structs with correct types and json tags
JSON Input
Paste a JSON object or array
Go
Generated structs (run gofmt to re-align)
type Root struct {
ID int64 `json:"id"`
Name string `json:"name"`
Active bool `json:"active"`
Score float64 `json:"score"`
Tags []string `json:"tags"`
Profile Profile `json:"profile"`
}
type Profile struct {
Age int64 `json:"age"`
City string `json:"city"`
}Frequently asked questions
Related guides
Related tools
CHANGELOG Generator
Write a clean, consistent CHANGELOG entry in the Keep a Changelog format from grouped Added, Changed, Deprecated, Removed, Fixed, and Security notes
Chmod Calculator
Calculate Linux file permissions (777, 755 etc) easily.
Credit Card Validator
Validate credit card numbers with the Luhn algorithm and detect the issuing network
Cron Expression Builder
Build and validate cron expressions with visual interface and presets
CSS/JS Minifier
Minify your CSS and JavaScript code to reduce file size.
Database Connection String Builder
Build and URL-encode connection strings for PostgreSQL, MySQL, MongoDB, Redis and SQLite from a simple form — with JDBC and key/value variants