MessagePack
MessagePack is an efficient binary serialization format, similar to JSON but more compact, with multilingual support, used for RPC and caching.
Purpose
To provide serialization that is smaller and faster than JSON for high-performance RPC and caching.
Mechanism
A single-byte type marker distinguishes nil, bool, integers, floats, strings, byte arrays, arrays, and maps. Small positive/negative integers use one-byte fixint; short strings use fixstr. It is not self-describing (a schema or convention is needed) but more compact than JSON.
Use cases
- Redis serialized values
- Thrift/MsgPack RPC
- Game server communication
- Embedded data exchange
Examples
- Input
{"a":1}Output81 a1 61 01A map with one pair
Common errors
- The lack of a schema causes cross-language type mismatches
- Use an IDL or explicit type conventions
Related terms
CBOR
CBOR (Concise Binary Object Representation) is a binary form of JSON, standardized in RFC 8949, more compact and supporting more data types. GLOSSARY
JSON
JSON (JavaScript Object Notation) is a lightweight data interchange format based on JavaScript object literals, using key-value pairs and arrays. GLOSSARY
Protocol Buffers
Protocol Buffers is Google's language-neutral binary serialization format; it requires a .proto schema definition and is more compact and type-safe than JSON/XML. GLOSSARY
Related tools
MessagePack Decode
MessagePack Decode — pure client-side tool. Decodes real MessagePack binary (hex or base64 input, auto-detected) to pretty JSON. Full official spec: fixints, str/bin/array/map (fix + 8/16/32), ext (fixext1-16, ext8/16/32), float32/64, uint/int 8-64. Privacy-first, no server round-trip. TOOL
MessagePack Encode
MessagePack Encode — pure client-side tool. Encodes JSON to real MessagePack binary, wire-compatible (aligned with msgpack-python defaults): shortest integer forms, str/bin/array/map families, extension types via $ext. Map keys keep insertion order. Output hex (default) or base64. Privacy-first, no server round-trip. TOOL