JSON to Go Struct
Generate Go structs with JSON tags from a sample JSON object.
Go structs
Generating Go structs from JSON
Paste a representative JSON object and this tool generates matching Go structs, complete with json:"..." field tags so encoding/json marshals and unmarshals correctly. Field names are exported in PascalCase, nested objects become their own named structs, and numbers map to int or float64 based on the sample value. If you pass an array, the first element defines the shape.
Prefer TypeScript? Use JSON to TypeScript. You can also format the JSON first or turn it into SQL inserts. Everything runs in your browser.
Related Converters tools
JSON to YAML
Convert JSON into clean, readable YAML instantly.
YAML to JSON
Convert YAML configuration into valid JSON.
JSON to CSV
Flatten a JSON array of objects into CSV rows.
CSV to JSON
Parse CSV with headers into a JSON array of objects.
JSON to XML
Convert JSON structures into nested XML markup.
JSON Minifier
Strip whitespace to produce compact JSON.
JSON to TypeScript
Generate TypeScript interfaces from a JSON sample.
JSON to SQL
Turn a JSON array of objects into SQL INSERT statements.