Formatters & Converters

JSON to Go

Generate Go structs with json tags from any JSON sample.

No upload, ever No account needed Works offline
Input (Paste JSON)
0 characters
Output
Auto-updated
// how to use it

Three steps, no reading required.

Paste your input

Drop text, code, or data into the input pane — from an API response, a file, anywhere.

See it process

The result updates instantly as you type.

Copy the result

Grab the output with Copy or Download, or fix the error shown if the input is invalid.

// examples

Try it with a sample.

Sample 1
{"id":1,"name":"Ada","active":true,"roles":["admin","user"],"address":{"city":"London"}}
TYPICAL ONLINE TOOL

Structs that don't round-trip

  • Omits json tags, so marshalling renames fields
  • Mishandles initialisms like id and url
  • Uploads your sample
DEVUTILSNOW

Idiomatic structs with tags

  • Each field carries a json tag with the original key
  • id becomes ID, url becomes URL, per Go convention
  • Missing keys become pointers with ,omitempty
// faq

Questions worth answering upfront.

No. Structs are generated entirely in your browser. Your JSON is never uploaded, stored, or logged.

Yes. Each field gets a json struct tag with the original key, so the struct marshals and unmarshals back to your JSON exactly.

Keys become exported (capitalized) Go field names, with common initialisms uppercased — id becomes ID, url becomes URL — following Go naming conventions.

When an array of objects has a key missing from some elements, the field becomes a pointer with ,omitempty so it can be nil and is omitted when empty.

Yes. Every tool on DevUtilsNow is free to use with no account required.

Paste the structs into your package, then call json.Unmarshal(data, &v) with v of the root type. For streams such as HTTP response bodies, use json.NewDecoder(resp.Body).Decode(&v).

// related guides

Guides that pair with this tool

All guides →

How to Generate Go Structs from JSON

Turn a JSON sample into Go structs with json tags — field naming, initialisms, pointers for optional fields, and omitempty.

Read guide →

Need another tool?

36+ browser-based utilities — all free, all private, nothing to install.

Browse all tools →
Last updated: Oct 10, 2026