WebTool

JSON to Go Struct

Free online JSON to Go converter: generate structs with json tags, PascalCase fields and int64 mapping — go build ready.

Privacy: all processing happens locally in your browser. Your input never leaves your device.

What is JSON to Go Struct?

Defining API models in Go means writing structs with json tags. This tool generates Go structs from a sample JSON: field names are converted to PascalCase, original keys are kept in json tags, integers map to int64, floats to float64, and nested objects become separate structs. The generated code compiles with go build out of the box.

How to Use

  1. Paste a sample JSON
  2. Go structs are generated automatically
  3. Copy into your project

FAQ

What does null map to?
interface{}. Replace it with a concrete pointer type such as *string according to the API documentation.
Why do field names start with an uppercase letter?
Only exported (uppercase) fields can be serialized by encoding/json; the original key names are preserved via json tags.

Related Tools

Last updated 2026-09-04