# A new Go API for JSON

DevFeed: [A new Go API for JSON](<https://devfeed.tech/articles/a-new-go-api-for-json-119073.md>)

Original publisher: [Read original article](<https://go.dev/blog/jsonv2>)

Author: Michael Pratt, Joe Tsai, Daniel Martí, Johan Brandhorst-Satzkorn, Roger Peppe, Chris Hines, and Damien Neil

Published: 2026-11-04T00:00:00Z

Content type: article

Language: en

Sources: [Go](<https://devfeed.tech/sources/the-go-blog.md>)

Topics: [encoding/json](<https://devfeed.tech/topics/encoding-json.md>), [JSON](<https://devfeed.tech/topics/json.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [encoding](<https://devfeed.tech/tags/encoding.md>), [encoding-json](<https://devfeed.tech/tags/encoding-json.md>), [go](<https://devfeed.tech/tags/go.md>), [json](<https://devfeed.tech/tags/json.md>), [json-v2](<https://devfeed.tech/tags/json-v2.md>), [jsontext](<https://devfeed.tech/tags/jsontext.md>), [packages](<https://devfeed.tech/tags/packages.md>)

## AI overview

Go 1.27 makes `encoding/json/v2` and `encoding/json/jsontext` stable and generally available. `jsontext` handles JSON syntax with streaming value and token encoders and decoders; `v2` builds on it for Go value marshaling, adds options across its APIs, and supports streaming custom methods. Compared with v1, v2 rejects invalid UTF-8 and duplicate object names, matches struct fields case-sensitively, and encodes nil slices and maps as empty arrays and objects. Marshal performance is roughly at parity with v1, while unmarshal can be significantly faster, with reported benchmark gains up to 10x; custom types can benefit further by implementing the streaming interfaces. Existing v1 applications remain supported, and its behavior can be retained or adjusted through compatibility options for gradual migration.

## Source excerpt

Go 1.27 introduces new encoding/json/v2 and encoding/json/jsontext packages.