API Reference

json-iterator/go

A high-performance JSON parser and serializer for Go that is a drop-in replacement for encoding/json.

Official Documentation ↗
CompatibilityThis documentation covers version v1.1. Check the official docs for the latest API surface.

Installation

gogo get github.com/json-iterator/go

Methods

jsoniter generates optimized code paths and offers a config compatible with the standard library.

Key Features

  • Drop-in replacement for encoding/json
  • Streaming and iterator-style decoding
  • Configurable behavior and extra extensions

Usage Notes

Pin a version and check the official docs for the API surface you depend on before upgrading.

API reference evidence

Fetched from official sources on 2026-11-08T17:28:00+08:00 via WebFetch https://raw.githubusercontent.com/json-iterator/go/v1.1.12/config.go(pkg.go.dev 页抓取截断后改用官方仓库源码).

FAQ

How do I keep standard behavior?
Use ConfigCompatibleWithStandardLibrary; other configs trade compatibility for speed or features.
Is it always faster?
Usually for hot paths with many small objects, but measure; the standard library has improved and may suffice.
Does it handle streaming?
Yes. jsoniter.NewDecoder and jsoniter.NewEncoder provide streaming equivalents to the standard API.