File Formats
  • Audio
  • Video
  • Images
  • 3D & CAD
  • Documents
  • Data
  • Code
  • System
Data
  • Structured text
  • Binary serialisation
  • Databases
  • Scientific
  • Geospatial
  • Machine learning
  • Messages & calendars
  • Compression
  • Archives
  1. Home
  2. Data
  3. Binary serialisation
  4. MSGPACK
.MSGPACK
  • Overview

.MSGPACK

MessagePack

Introduction

MessagePack is a binary form of the same values JSON holds: maps, arrays, strings, numbers, booleans and nil, plus raw binary data. Sadayuki Furuhashi created it in 2008. Small values take a single byte, so encoded data is usually much smaller than JSON and faster to read. Unlike Protocol Buffers it needs no schema: every value says what type it is.

Software

  • MessagePack libraries for more than fifty languages, listed on the official site
  • Python with the msgpack package
  • Fluentd, the log collector, which uses MessagePack for its records

Structure

A MessagePack file has no header. It is one value, or a run of values one after another. Each value starts with a type byte; multi-byte numbers and lengths that follow it are big-endian.

First byteTypeValue
00–7Fpositive fixintthe byte itself, 0 to 127
80–8Ffixmapa map of up to 15 key and value pairs
90–9Ffixarrayan array of up to 15 values
A0–BFfixstra UTF-8 string of up to 31 bytes
C0nilno value
C2, C3false, truebooleans
C4–C6bin 8, 16, 32a length, then raw bytes
C7–C9ext 8, 16, 32a length, a type number, then data
CA, CBfloat 32, 64IEEE 754 numbers
CC–CFuint 8 to 64unsigned integers
D0–D3int 8 to 64signed integers
D4–D8fixext 1 to 16a type number and 1, 2, 4, 8 or 16 bytes of data
D9–DBstr 8, 16, 32a length, then a UTF-8 string
DC, DDarray 16, 32a count, then that many values
DE, DFmap 16, 32a count, then that many key and value pairs
E0–FFnegative fixint−32 to −1

The byte C1 is never used. Extension type −1 is reserved for timestamps.

© 2026 fileformats.org About Contact Made by Lewpen