One document, or several samples as JSON Lines.
Options for Go

Convert JSON to Go structs

Turn a JSON sample into Go structs complete with json: field tags, gofmt-aligned and named the Go way (ID, URL, HTTP). Types are inferred from every record: int64 and float64, bool, string, slices, nested structs, pointers where null appears, and a note when a number is too big for int64 (switch to float64 or json.Number under Options). The generated code is built and run against the sample in the tests.

Choose omitempty and pointers for optional fields. The whole conversion happens client-side — no upload, no queue, no account.

Need a different language? See all JSON-to-code converters.

JSON to Go Struct Converter — frequently asked questions

How do I convert JSON to a Go struct?
Paste your JSON on the left and the Go structs appear on the right with the correct field types and json tags. Copy them straight into your Go file; they are already gofmt-formatted.
Does it add json tags and export fields?
Yes. Each field gets a json:"..." tag matching the original key (escaped when it has to be), and field names are exported Go identifiers with the usual initialisms, so the structs marshal and unmarshal correctly. Keys that would clash (first_name and first-name) get numbered names.
Is my JSON uploaded anywhere?
No. Parsing and code generation run entirely in your browser with JavaScript — your JSON never leaves your device, so it's safe to paste API responses and other sensitive payloads. It's free with no sign-up.

Spotted a bug or have a suggestion?

Found something broken, have an idea, or just want to say thanks about any of our tools? Every message reaches a real person.