For a high performance JSON library for Go, the first results are bytedance/sonic (Sonic is a high-performance JSON library for Go that utilizes JIT compilation and SIMD instructions to provide fast serialization, streaming support, and AST-based parsing, making it a comprehensive solution for demanding JSON processing tasks), mailru/easyjson (This library is a high-performance JSON processing tool for Go that uses code generation to provide reflection-free marshaling and unmarshaling, directly addressing the need for optimized serialization and memory efficiency) and json-iterator/go (This library is a high-performance, drop-in replacement for the standard Go JSON package that provides the requested streaming support, custom marshaling, and optimized serialization performance). goccy/go-json and tidwall/gjson round out the shortlist. Compare the match explanations and check the project documentation against your requirements.
We curate open-source GitHub repositories matching “best go json libraries”. Results are ranked by relevance to your query — pick filters below to narrow, or refine with AI.
Sonic is a high-performance Go JSON serialization library that provides tools for encoding and decoding native data structures. It functions as a JIT-accelerated encoder, a JSON AST parser, a stream processor, and a lazy decoder. The project utilizes just-in-time machine code generation to optimize the encoding of large data schemas and employs a JIT assembler to maximize serialization and deserialization speeds. It features a precompiled schema warmup process to prevent latency spikes during initial execution and leverages SIMD hardware instructions for accelerated parsing. The library cove
Sonic is a high-performance JSON library for Go that utilizes JIT compilation and SIMD instructions to provide fast serialization, streaming support, and AST-based parsing, making it a comprehensive solution for demanding JSON processing tasks.
easyjson is a high-performance JSON serializer and memory-optimized parser for Go. It provides a reflectionless code generator that creates static Go methods for marshaling and unmarshaling data, eliminating the need for runtime reflection to improve execution speed. The library reduces CPU and memory overhead through several optimization strategies. It employs a system of reusable memory buffer pools to minimize heap allocations and garbage collection pressure. Additionally, it utilizes string interning to deduplicate repeated values and zero-copy string referencing to point to existing buff
This library is a high-performance JSON processing tool for Go that uses code generation to provide reflection-free marshaling and unmarshaling, directly addressing the need for optimized serialization and memory efficiency.
This project is a high-performance JSON library for Go, serving as a replacement for the standard encoding/json package. It provides a serialization engine for encoding and decoding data structures, alongside a schemaless parser for extracting specific values from JSON blobs using paths. The library distinguishes itself through a focus on reducing CPU and memory overhead. It implements a high-performance encoder that utilizes buffer reuse and reduced float precision to increase data throughput. Broad capability areas include data serialization, high-performance JSON processing, and schema-le
This library is a high-performance, drop-in replacement for the standard Go JSON package that provides the requested streaming support, custom marshaling, and optimized serialization performance.
go-json is a high-performance JSON serialization library for Go that serves as an encoder and decoder replacement for the standard library. It provides tools to convert native data structures to and from JSON format with optimized processing speeds. The library includes a conditional serializer for filtering specific data structure fields during the encoding process and a colorizer to produce color-coded JSON strings for human readability. The project supports context-aware marshaling to trigger specific logic during the serialization of complex data types.
This library is a high-performance, drop-in replacement for the standard Go JSON package that provides the requested streaming support, custom marshaling, and optimized serialization features.
gjson is a Go JSON parser designed for schema-less reading and value extraction. It allows for the retrieval of specific data from JSON documents using dot-notation paths without requiring the definition of predefined Go structs. The library provides tools for path-based querying, including the use of wildcards and index-based queries to locate data within objects and arrays. It also functions as a JSON lines processor, treating multi-line documents as arrays to iterate and query individual entries. Additional capabilities include converting JSON values into native Go types such as strings,
This library provides high-performance, zero-copy JSON parsing and path-based value extraction, making it a powerful tool for Go developers who need to query JSON data without the overhead of full struct unmarshaling.
jsonparser is a Go library for parsing, extracting, and modifying JSON data by key path without requiring predefined structs or type schemas. It uses a deterministic state machine to parse JSON directly from byte slices, enabling zero-copy traversal and lazy typed value extraction. The library provides key-path-based navigation to retrieve raw bytes and typed values from nested JSON structures, supporting extraction of strings, integers, floats, and booleans. It also enables in-place value modification and deletion at specified key paths, as well as iteration over arrays and objects using cal
This library provides high-performance, zero-copy JSON parsing and extraction for Go by operating directly on byte slices without the need for reflection or predefined structs.
go-simplejson is a JSON manipulation library for Go that provides schemaless parsing and modification of arbitrary JSON data. It serves as a wrapper for interacting with JSON structures without requiring the definition of predefined structs or schemas. The library enables dynamic processing of JSON payloads through a recursive tree structure and a mutable node hierarchy. This allows for the extraction and modification of values from complex, nested objects where the data format may be unknown or change dynamically. The project covers arbitrary JSON parsing and the retrieval of data from dyna
This library provides a convenient way to interact with arbitrary or dynamic JSON structures in Go without needing predefined structs, though it prioritizes ease of use over the high-performance, reflection-free parsing required for heavy-duty serialization tasks.
For parsing, creating and editing unknown or dynamic JSON in Go
This library provides a flexible way to parse and manipulate dynamic or unknown JSON structures in Go, making it a useful tool for scenarios where you need to work with JSON without predefined schemas.
faster JSON serialization for Go
This library provides high-performance JSON serialization for Go by generating static code to avoid runtime reflection, directly addressing the need for faster processing.
Fast JSON parser and validator for Go. No custom structs, no code generation, no reflection
This library provides a high-performance, reflection-free approach to parsing and validating JSON in Go, making it a strong choice for performance-critical applications that prefer manual data access over struct-based marshaling.
This project is a Protocol Buffers Go compiler and code generation framework that translates schema definitions into optimized Go structures and reflection-free serialization methods. It includes a gRPC service generator for producing client and server communication code and a serialization performance toolkit for generating automated benchmarks and test suites. The framework features a plugin-based system for transforming data definitions into source code with custom field mapping and struct tag injection. It allows for custom type mapping and struct type overriding to link data fields to sp
This project is a Protocol Buffers compiler and code generation framework for RPC communication, which is a different serialization format than the JSON processing library requested.
This project is a command-line processor designed for the parsing, filtering, and transformation of structured data streams. It functions as a declarative programming environment that treats data as immutable streams, allowing users to perform complex structural modifications through the composition of small, reusable functions. By utilizing a recursive tree traversal engine, the system enables the navigation, inspection, and modification of deeply nested hierarchical data structures. The engine distinguishes itself through a stream-oriented architecture that processes input records one by on
This is a command-line tool written in C for processing JSON data, rather than a Go library that can be integrated into your application for parsing and serialization.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| bytedance/sonic | 9.5K | Go | Apache-2.0 | |
| mailru/easyjson | 4.9K | Go | MIT | |
| json-iterator/go |
| 13.9K |
| Go |
| MIT |
| goccy/go-json | 3.7K | Go | MIT |
| tidwall/gjson | 15.5K | Go | MIT |
| buger/jsonparser | 5.6K | Go | MIT |
| bitly/go-simplejson | 3.7K | Go | MIT |
| jeffail/gabs | 3.5K | Go | MIT |
| pquerna/ffjson | 3K | Go | Apache-2.0 |
| valyala/fastjson | 2.5K | Go | MIT |