The JSON to Go converter turns a sample JSON payload into ready-to-use Go structs, complete with `json:"..."` struct tags that preserve your original field names. Paste an API response and get exported PascalCase fields, correctly inferred Go types and named structs for every nested object — the exact boilerplate you would otherwise hand-write before unmarshalling.
It runs entirely in your browser. Nothing you paste is uploaded, logged or sent to a server — the struct generation happens in JavaScript on your own machine, so it is safe for production payloads, internal API shapes and customer data. Turn off your network and it still works.
It is built for Go developers wiring up `encoding/json`: model a third-party webhook, scaffold a config type, or bootstrap a client for an undocumented endpoint. Whole numbers become `int64`, decimals `float64`, arrays become slices, and null or empty values fall back to `interface{}`. Free forever, no signup, no file-size gate.
Strings map to `string`, booleans to `bool`, whole numbers to `int64` and decimals to `float64`. Arrays become slices (`[]string`, `[]Item`), and any null value or empty array element becomes `interface{}` so the struct still round-trips. Field names are PascalCased for export while the json tag keeps the exact original key.
Every nested object becomes its own named, reusable struct — a `plan` object turns into a `Plan` struct referenced from the parent. Objects inside arrays are merged into a single element struct, so `[]User` describes all the elements at once. Names are de-duplicated with a numeric suffix when two paths would collide.
With Optional detection on (the default), the generator compares every object in an array. Any key that is missing from some elements is marked optional: the tag gains `,omitempty` and the field type becomes a pointer (`*string`) so it can be nil. This mirrors how real Go code distinguishes an absent field from a zero value.
Leave Inline off for named top-level structs (easier to reuse and reference across your package). Flip it on to embed each nested object as an anonymous `struct { ... }` literal directly inside its parent, matching a single self-contained type. Either way, the name, type and tag columns are aligned with tabs exactly like gofmt output.
Yes. All struct generation happens locally in your browser with JavaScript — the JSON is never uploaded or sent anywhere. You can disconnect from the internet and the tool keeps working.
Whole numbers map to int64 because JSON numbers can exceed the range of a 32-bit int and Go's json package decodes into int64-compatible sizes safely. Change the type to int, int32 or uint in your editor if your domain guarantees a smaller range.
When Optional detection is on and a field is missing from some objects in an array, the generator adds ,omitempty to the json tag and makes the field a pointer (like *string). That lets your code tell an absent field apart from a zero value, and omits it when marshalling back to JSON.
A value that is null, an empty array, or a mix of incompatible types can't be pinned to one concrete Go type, so it falls back to interface{} (equivalent to `any`). Provide a fuller sample with real values and the generator will infer a precise type.
Use named structs (Inline off) when you want to reference or reuse the nested types elsewhere in your package — it's the more common Go style. Use inline structs when you want one self-contained type definition with everything nested in place.