.msgpack

What is a .msgpack file?

MessagePack Serialized Data · Data · Sadayuki Furuhashi · 2008

A .msgpack file holds data serialized with MessagePack, a binary cousin of JSON: the same maps, arrays, strings and numbers, encoded far more compactly for speed over networks and in caches.

Category
Data
Type
Binary
Is a .msgpack file safe to open? Safe as data. Like all deserialization, decoding untrusted input deserves care: use a maintained library and avoid application-level types that auto-instantiate objects.

What is a .msgpack file used for?

MessagePack's pitch is 'like JSON, but fast and small': an integer that costs several JSON characters packs into one or a few bytes. It is popular in game networking, Redis payloads, telemetry and inter-service messaging.

The format is a stream of typed values with no file header, so there is no magic number; whatever bytes come first simply encode the first value. Implementations exist for practically every language.

How to open a .msgpack file

The .msgpack format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list. For a step-by-step walkthrough, see how to open a .msgpack file.

Windows

  • Python (msgpack)
  • Node.js (@msgpack/msgpack)
  • msgpack-tools (CLI)

macOS

  • Python (msgpack)
  • msgpack-tools (CLI)

Linux

  • Python (msgpack)
  • msgpack-tools (CLI)

How to convert a .msgpack file

You can convert a .msgpack file to json using a conversion tool or the export menu of an app that opens it.

.msgpack file signature (magic bytes)

Programs recognise a .msgpack file by the bytes at the start of the file, not by its name. These are the signatures for MessagePack.

Hex signatureOffsetNote
(no fixed signature)0no fixed magic; structure defined by a schema or header

See the full magic-numbers reference for every format.

Frequently asked questions

What is a .msgpack file?

A .msgpack file holds data serialized with MessagePack, a binary cousin of JSON: the same maps, arrays, strings and numbers, encoded far more compactly for speed over networks and in caches.

How do I read a .msgpack file?

Decode it with a MessagePack library, for example msgpack.unpack() in Python, or convert it to readable JSON with the msgpack2json tool from msgpack-tools.

What is the difference between MessagePack and JSON?

The data model is nearly identical; the encoding is not. MessagePack is binary, smaller and faster to parse, while JSON is human-readable text.

MessagePack or BSON?

Both are binary JSON relatives. MessagePack optimises for compactness on the wire; BSON, MongoDB's format, optimises for in-place scanning and adds types like ObjectId.

Related formats

Sources

Details on this page were checked against authoritative references: