What are packed repeated fields in Protocol Buffers and why do they improve efficiency?

Last updated 8 July 2026

  • Packed encoding stores a repeated scalar field as one tag plus one length, followed by all values back-to-back, instead of a tag before every element.

  • It only applies to repeated numeric scalars (ints, floats, bools, enums). It is the default in proto3 and enabled via [packed=true] in proto2.

  • Parsers accept both packed and unpacked forms, so switching is wire-compatible.

  • https://protobuf.dev/programming-guides/proto3/
  • https://www.baeldung.com/java-protobuf-packed-repeated-fields
  • https://victoriametrics.com/blog/go-protobuf/
  • https://victoriametrics.com/tags/go/page/2/
  • https://clement-jean.github.io/packed_vs_unpacked_repeated_fields/
All gRPC interview questions