Go encoding/json/v2 is stable in Go 1.27: what changes

Go encoding/json/v2 is stable in Go 1.27: what changes

The Go team says encoding/json/v2 and encoding/json/jsontext “are stable and generally available in Go 1.27”. The announcement is a Go Blog post dated 4 Nov 2026, and Go 1.27.0 itself was released on 19 Aug 2026. If you write Go that reads or writes JSON, this is the biggest change to the standard library’s JSON in years. Last checked: 5 Nov 2026.

How much faster is json/v2?

The post says Unmarshal is “significantly faster than v1”, with benchmarks showing improvements of up to 10x, while Marshal is roughly at parity. That’s the Go team’s own claim, and “up to” matters. It doesn’t say every program will see 10x. A service that spends most of its time decoding large request bodies might notice; a command-line tool that parses one small config file won’t.

What breaks when you move from v1?

v2 is stricter, and the post lists the differences from v1:

  • It returns an error on invalid UTF-8.
  • It returns an error on duplicate names in an object.
  • A nil slice or map marshals as an empty array or object.
  • Field names are matched case-sensitively.
  • The omitempty option is redefined.
  • time.Duration now returns an error.

Each of these can change behaviour quietly. Take the nil slice: an API that used to send null would now send [], and a client that checks for null would notice. A JSON file with a field spelled “Name” and a struct tag “name” used to match; now it won’t.

How do you keep the old behaviour?

The post gives a migration example that asks v2 to behave like v1 and allows duplicate names:

json.Marshal(..., json.DefaultOptionsV2(), jsontext.AllowDuplicateName(true))

That lets you move over one call at a time instead of in one risky change. We haven’t run it ourselves, so read the post’s full example before you copy it.

Should you switch now?

If JSON decoding shows up in your profiler, try it on a branch and measure with your own data. If it doesn’t, there’s no hurry. Whichever you pick, run your tests with real JSON samples, because the strictness changes mean input that used to pass can now fail. The post is the place to check the details before you plan a wider migration.

Which Go version do you need?

Go 1.27. The release history lists 1.27.0 on 19 Aug 2026 and 1.27.3 on 19 Oct 2026, so the current patch release is the safe place to start.

For other developer updates, see the Node.js Brotli flaw and OmniDiff, a git diff tool that also compares images and PDFs.

Source and verification

Checked against the Go Blog post on json/v2 and the Go release history on 5 Nov 2026.

Get one useful update every day

Verified, short, free. Join our Telegram channel: t.me/asn_daily · Instagram: @asn_daily