Skip to content
uencoder

MessagePack Format

MessagePack is an efficient binary alternative to JSON that represents JSON-compatible structures with type tags plus compact values, producing smaller payloads than JSON with faster parsing.

Purpose

It brings binary efficiency to JSON semantics, fitting structured data transfer in APIs and caches.

Mechanism

Every value starts with a 1-byte type tag: positive/negative fixints, fixmap/fixarray/fixstr and other small values are inlined into the tag; ints use Varint, strings are length-prefixed UTF-8, and arrays/maps recurse with length prefixes.

Use cases

  • Binary API responses
  • Redis cache values
  • Alternative to Thrift/Protobuf

Related tools

References