IQ
PayloadIQ
PayloadIQ Utilities

JSON to Go

Paste a JSON sample and get idiomatic Go structs back — exported fields with json tags, nested structs, merged array elements and int64/float64 typing. It all runs in your browser.

Go structs appear here.

Runs in your browser. Your input is not uploaded to PayloadIQ.

JSON to Go turns a JSON sample into idiomatic Go structs you can paste straight into a package. Each field is exported in PascalCase and carries a json:"originalKey" tag, so encoding/json marshals back to exactly the keys in your payload. Nested objects become their own structs, arrays of objects are merged into one []Item struct, and Go's numeric types (int64, float64) are inferred. Everything runs locally in your browser, so a real API response never leaves your machine.

Exported fields, real json tags

Go only marshals exported (capitalized) fields, so every field is PascalCased — and because the original key is kept in the struct tag, round-tripping is lossless even for keys like is_active or user-idthat aren't valid Go identifiers. You can rename the top-level struct with the Root-name field.

Inference is sample-driven

The generator can only see what you give it, so paste the richest payload you have — for lists of objects it merges the keys across elements so a field present in only some of them still appears. Want types in another language (TypeScript, Zod, Python, Rust) or a full typed client and schema report from the same payload? Open it in the PayloadIQ playground.

FAQ

Is my JSON uploaded?
No. The JSON is parsed and converted entirely in your browser with JavaScript — it never leaves your device. That makes it safe for real API responses, auth payloads, and anything internal.
Are the json tags preserved?
Yes. Each field is exported in PascalCase (so encoding/json can see it) and carries a json:"originalKey" tag, so marshalling round-trips to exactly the keys in your sample — even when the key isn't a valid Go identifier.
How are types and nested data handled?
Whole numbers become int64 and decimals float64; booleans bool; strings string. Nested objects become their own structs, and an array of objects is merged into a single struct ([]Item) so a field present in only some elements still appears.
How complete is the inference?
It is only as complete as the sample you paste, so use the richest, most representative payload you have. Inference can't know that an integer field is sometimes fractional, for instance, unless the sample shows it — so review numeric types for fields that may vary.

Related utilities

JSON to TypeScriptJSON to ZodJSON to PythonJSON Formatter / ValidatorJSON VisualizerJSON MinifierJSON DiffJSON to CSV
Open PayloadIQ Playground