JSON to Go Struct

Write Go structs with JSON tags from a JSON sample.

JSON to Go Struct

.json

Paste text or open a file to see the result.

What it does

Writes Go struct types with json tags from a JSON sample. Useful when you need to decode an API response in Go. You get structs you can paste into your code and adjust.

About the .json format

.JSON file extension
File Type
JavaScript Object Notation File
Developer
Specified by Douglas Crockford
Category
Web Files
MIME
application/json

JSON is a lightweight data-interchange format.

Also works with

Related tools

More in JSON & Data

JSON to Go Struct questions

How do I use the JSON to Go Struct?

Paste the text into the Input box or open a file, set the options, then copy or download the result.

Does renaming a file to .json change its format?

No. The extension only tells programs what to expect, and the content of the file stays the same. To change the format, convert the file. The .json page lists programs and converters for it.