JSON to Go Struct
Convert a JSON sample into Go struct definitions with json tags.
Paste any JSON object and get matching Go struct definitions, complete with json tags and nested structs for inner objects. Conversion happens entirely client-side.
How to use
- Paste a JSON object into the input box.
- Set a name for the root struct.
- Copy the generated Go struct definitions, including any nested structs.
Frequently asked questions
- How are field names generated?
- Each JSON key is converted to an exported PascalCase Go field name, with the original key preserved in the json tag.
- How are nested objects handled?
- Every nested object becomes its own named struct, referenced by type from the parent struct.
- How are numbers typed?
- Whole numbers are inferred as int64 and decimal numbers as float64; you can adjust types manually afterward if needed.