JSON

40 projects

The standard encoding/json package handles most JSON work by mapping documents to structs with tags. This category collects tools for what it does less well: reading single values without defining types, editing dynamic documents, parsing with fewer allocations, diffing and patching, and generating Go structs from sample JSON. Go 1.25 also added an experimental encoding/json/v2, enabled with GOEXPERIMENT=jsonv2, which is worth watching.

tidwall's GJSON reads values by path, such as name.first or friends.#.age, without decoding the whole document into types, and its companion SJSON sets values the same way. gabs wraps map[string]any for creating and editing unknown JSON. valyala/fastjson parses without reflection or code generation for read-heavy workloads, and OjG is a fast parser with JSONPath support. jsondiff produces RFC 6902 JSON Patch documents. gojson and json2go generate Go struct definitions from example JSON, and gojq is a jq implementation usable as a library. Several older entries, such as gojson, have not changed in years.

Keep encoding/json and typed structs as the default, since they are clear and well tested. Use GJSON when you need a few fields from large or unpredictable payloads, and a faster parser only after profiling shows JSON is a real cost. For drop-in faster encoders, see the Serialization category, and note that the popular jsoniter is now archived.

GJSONby tidwall

Get a JSON value with one line of code.

github.com/tidwall/gjsonGo 1.23+ 2 dependenciesupdated 29d ago

15.6k

gabsby Jeffail

For parsing, creating and editing unknown or dynamic JSON in Go.

github.com/Jeffail/gabs/v2Go 1.16+ No dependencies updated 2y ago

3.5k

SJSONby tidwall

Set a JSON value with one line of code.

github.com/tidwall/sjsonGo 1.14+ 2 dependenciesupdated 5mo ago

2.7k

gojsonby ChimeraCoder

Automatically generate Go (golang) struct definitions from example JSON.

updated 5y ago

2.7k

fastjsonby valyala

Fast JSON parser and validator for Go. No custom structs, no code generation, no reflection.

github.com/valyala/fastjsonGo 1.24+ No dependencies updated 8mo ago

2.5k

OjGby ohler55

Optimized JSON for Go is a high performance parser with a variety of additional JSON tools including JSONPath.

github.com/ohler55/ojgGo 1.18+ No dependencies v1.28.9updated today

956

jsondiffby wI2L

JSON diff library for Go based on RFC6902 (JSON Patch).

github.com/wI2L/jsondiffGo 1.24+ 2 dependenciesv0.7.1updated 3mo ago

633

ajsonby spyzhov

Abstract JSON for golang with JSONPath support.

github.com/spyzhov/ajsonGo 1.16+ No dependencies v0.9.6updated 1y ago

295

kazaamby Qntfy

API for arbitrary transformation of JSON documents.

github.com/qntfy/kazaam/v4Go 1.12+ 2 dependenciesv4.0.1updated 4y ago

295

jsonvalueby Andrew-M-C

A fast and convenient library for unstructured JSON data, replacing encoding/json.

github.com/Andrew-M-C/go.jsonvalueGo 1.13+ 2 dependenciesv1.4.3updated 2mo ago

201

gojqby elgs

JSON query in Golang.

github.com/elgs/gojqGo 1.20+ 1 dependencyupdated 3y ago

190

jettisonby wI2L

Fast and flexible JSON encoder for Go.

github.com/wI2L/jettisonGo 1.18+ 2 dependenciesv0.7.4updated 3y ago

180

json2goby m-zajac

Advanced JSON to Go struct conversion. Provides package that can parse multiple JSON documents and create struct to fit them all.

github.com/m-zajac/json2goGo 1.24+ 4 dependenciesv1.2.3updated 7mo ago

142

gjoby skanehira

Small utility to create JSON objects.

github.com/skanehira/gjoGo 1.12+ No dependencies 1.0.2updated 5y ago

132

JayDiffby yazgazan

JSON diff utility written in Go.

github.com/yazgazan/jaydiffGo 1.10+ 5 dependenciesv0.3.1updated 6mo ago

111

jsongoby ricardolonga

Fluent API to make it easier to create Json objects.

updated 5y ago

108

jscanby romshark

High performance zero-allocation JSON iterator.

github.com/romshark/jscan/v2Go 1.21+ 1 dependencyv2.0.2updated 3mo ago

101

ujsonby olvrng

Fast and minimal JSON parser and transformer that works on unstructured JSON.

github.com/iOliverNguyen/ujsonGo 1.19+ No dependencies v1.2.0updated 1y ago

85

jsonfby miolini

Console tool for highlighted formatting and struct query fetching JSON.

updated 5y ago

64

silentjsonby GenshIv

Zero-allocation JSON boundary scanner and splitter utilizing AVX2 SIMD instructions.

github.com/GenshIv/silentjson/v2Go 1.26+ 10 dependenciesv2.1.3updated 1d ago

63

askby simonnilsson

Easy access to nested values in maps and slices. Works in combination with encoding/json and other packages that "Unmarshal" arbitrary data into Go data-types.

github.com/simonnilsson/askGo 1.17+ No dependencies v0.5.0updated 4mo ago

59

go-respondby nicklaw5

Go package for handling common HTTP JSON responses.

v1.6.0updated 5y ago

55

jsoncolorby neilotoole

Drop-in replacement for encoding/json that outputs colorized JSON.

github.com/neilotoole/jsoncolorGo 1.25+ 7 dependenciesupdated 20d ago

53

mpby sanbornm

Simple cli email parser. It currently takes stdin and outputs JSON.

updated 10y ago

47

vjsonby miladibra10

Go package for validating JSON objects with declaring a JSON schema with fluent API.

github.com/miladibra10/vjsonGo 1.17+ 5 dependenciesv0.4.0updated 1y ago

41

gojmaprby limiu82214

Get simple struct from complex json by json path.

github.com/limiu82214/gojmaprGo 1.19+ 3 dependenciesupdated 3y ago

22

mapslice-jsonby mickep76

Go MapSlice for ordered marshal/ unmarshal of maps in JSON.

github.com/ake-persson/mapslice-jsonGo 1.16+ No dependencies updated 2y ago

20

epochby vtopc

Contains primitives for marshaling/unmarshalling Unix timestamp/epoch to/from build-in time.Time type in JSON.

github.com/vtopc/epochGo 1.21+ 1 dependencyv1.6.0updated 2y ago

17

dynjsonby cocoonspace

Client-customizable JSON formats for dynamic APIs.

github.com/cocoonspace/dynjsonGo 1.16+ No dependencies v1.0.4updated 3y ago

16

go-jsonerrorby ddymko

Go-JsonError is meant to allow us to easily create json response errors that follow the JsonApi spec.

github.com/ddymko/go-jsonerrorGo 1.13+ No dependencies v0.1.2updated 7y ago

16

jsonapi-errorsby AmuzaTkts

Go bindings based on the JSON API errors reference.

updated 9y ago

13

jsonhalby RichardKnop

Simple Go package to make custom structs marshal into HAL compatible JSON responses.

github.com/RichardKnop/jsonhal2 dependenciesupdated 6y ago

13

jsonicby sinhashubham95

Utilities to handle and query JSON without defining structs in a type safe manner.

github.com/sinhashubham95/jsonicGo 1.15+ 1 dependencyv1.1.0updated 5y ago

11

jzonby zerosnake0

JSON library with standard compatible API/behavior.

github.com/zerosnake0/jzonGo 1.15+ 1 dependencyv0.0.7updated 2y ago

11

ejby lucassscaravelli

Write and read JSON from different sources succinctly.

github.com/lucassscaravelli/ejGo 1.12+ 1 dependencyv1.1.1updated 6y ago

10

htmljsonby nikolaydubina

Rich rendering of JSON as HTML in Go.

github.com/nikolaydubina/htmljsonGo 1.20+ No dependencies v1.1.1updated 3mo ago

10

omg.jsonparserby dedalqq

Simple JSON parser with validation by condition via golang struct fields tags.

github.com/dedalqq/omg.jsonparserGo 1.16+ No dependencies v1.1.0updated 5y ago

6

jsonhandlersby abusomani

JSON library to expose simple handlers that lets you easily read and write json from various sources.

github.com/abusomani/jsonhandlersGo 1.20+ 1 dependencyv1.1.0updated 3y ago

2

jseqby bobg

Streaming JSON parser.

github.com/bobg/jseqGo 1.27+ 2 dependenciesv0.5.0updated 2mo ago

0

marshmallowby PerimeterX

Performant JSON unmarshalling for flexible use cases.

archived

0
Esc

Type to search every entry. ↑↓ to move, Enter to open.