CodeForge
  1. Developer tools
  2. JSON to Go Struct

JSON to Go struct converter

Convert JSON API responses into idiomatic Go struct definitions complete with PascalCase field names and `json:"..."` tags. Runs locally with zero network calls.

Free in your browser — no sign-up. Install from the Microsoft Store to use it offline on Windows 10 and 11.

How to use it

  1. Open the JSON tool and paste a JSON payload.
  2. Choose Convert to → Go struct.
  3. Copy the generated Go types into your package.

Example

JSON input
{
  "user_id": 42,
  "email": "ada@example.com",
  "active": true
}
Go struct output
type Root struct {
	UserId int `json:"user_id"`
	Email string `json:"email"`
	Active bool `json:"active"`
}

Features

Frequently asked questions

Does it add omitempty tags?

Yes — toggle the Optional fields switch in the code generator panel to append omitempty to every json tag.

Is it safe for private API payloads?

Yes. Code generation runs entirely on your device.

Related tools

JSON to TypeScriptGenerate TypeScript, Zod, Go and more from JSON.JSON to Zod SchemaGenerate Zod schemas and z.infer types from JSON.JSON FormatterFormat, validate and minify JSON.cURL Builder & ParserBuild, parse and inspect HTTP requests.

One workspace for all of it

JSON to Go Struct is one of 18 developer tools in CodeForge — alongside a JSON formatter, JWT decoder, regex tester, UUID and hash generators, and more. Press Ctrl+K to jump to any of them.

Open JSON to Go Struct — free Get the Windows app

Free in your browser — no sign-up. Install from the Microsoft Store to use it offline on Windows 10 and 11.