json2go alternatives and similar packages
Based on the "JSON" category.
Alternatively, view json2go alternatives based on common mentions on social networks and blogs.
-
jsonparser
One of the fastest alternative JSON parser for Go that does not require schema -
fastjson
Fast JSON parser and validator for Go. No custom structs, no code generation, no reflection -
marshmallow
Marshmallow provides a flexible and performant JSON unmarshalling in Go. It specializes in dealing with unstructured struct - when some fields are known and some aren't, with zero performance overhead nor extra coding needed. -
jsondiff
Compute the diff between two JSON documents as a series of RFC6902 (JSON Patch) operations -
JSON-to-Proto
convert JSON to Protocol Buffers online in your browser instantly -
ujson
µjson - A fast and minimal JSON parser and transformer that works on unstructured JSON -
mapslice-json
Go MapSlice for ordered marshal/ unmarshal of maps in JSON -
ask
A Go package that provides a simple way of accessing nested properties in maps and slices. -
Better Parsing of Unstructured JSON in Go
An error propagating JSON parsing library for Go -
epoch
Contains primitives for marshaling/unmarshaling Unix timestamp/epoch to/from built-in time.Time type in JSON -
go-jsonerror
Small package which wraps error responses to follow jsonapi.org -
omg.jsonparser
The simple JSON parser with validation by condition -
go-parameters
:blue_book: Easily parse incoming parameters and values from an HTTP request -
jsonhandlers
JSON library to expose simple handlers that lets you easily read and write json from various sources.
Access the most powerful time series database as a service
Do you think we are missing an alternative of json2go or a related project?
Popular Comparisons
README
json2go

Package json2go provides utilities for creating well formatted go type representation from json inputs.
Demo page
Simple web page with webassembly json2go parser
https://m-zajac.github.io/json2go
Installation
go get github.com/m-zajac/json2go/...
Usage
Json2go can be used as cli tool or as package.
CLI tools can be used directly to create go type from stdin data (see examples).
Package provides Parser, which can consume multiple jsons and outputs go type fitting all inputs (see examples and documentation). Example usage: read documents from document-oriented database and feed them too parser for go struct.
CLI usage examples
echo '{"x":1,"y":2}' | json2go
curl -s https://api.punkapi.com/v2/beers?page=1&per_page=5 | json2go
Check this one :)
cat data.json | json2go
Package usage examples
inputs := []string{
`{"x": 123, "y": "test", "z": false}`,
`{"a": 123, "x": 12.3, "y": true}`,
}
parser := json2go.NewJSONParser("Document")
for _, in := range inputs {
parser.FeedBytes([]byte(in))
}
res := parser.String()
fmt.Println(res)
Example outputs
{
"line": {
"point1": {
"x": 12.1,
"y": 2
},
"point2": {
"x": 12.1,
"y": 2
}
}
}
type Document struct {
Line struct {
Point1 Point `json:"point1"`
Point2 Point `json:"point2"`
} `json:"line"`
}
type Point struct {
X float64 `json:"x"`
Y int `json:"y"`
}
[
{
"name": "water",
"type": "liquid",
"boiling_point": {
"units": "C",
"value": 100
}
},
{
"name": "oxygen",
"type": "gas",
"density": {
"units": "g/L",
"value": 1.429
}
},
{
"name": "carbon monoxide",
"type": "gas",
"dangerous": true,
"boiling_point": {
"units": "C",
"value": -191.5
},
"density": {
"units": "kg/m3",
"value": 789
}
}
]
type Document []struct {
BoilingPoint *UnitsValue `json:"boiling_point,omitempty"`
Dangerous *bool `json:"dangerous,omitempty"`
Density *UnitsValue `json:"density,omitempty"`
Name string `json:"name"`
Type string `json:"type"`
}
type UnitsValue struct {
Units string `json:"units"`
Value float64 `json:"value"`
}