.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.

What opens 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.

Windows

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

macOS

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

Linux

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

Open a .msgpack file step by step

  1. Confirm the file really is a .msgpack. Drop it into the WhatFileType identifier, which reads its signature in your browser without uploading anything.
  2. On Windows, open it with Python (msgpack) or Node.js (@msgpack/msgpack).
  3. On Mac, use Python (msgpack) or msgpack-tools (CLI).
  4. On Linux, try Python (msgpack) or msgpack-tools (CLI).
  5. Still stuck? Convert the .msgpack to json, which opens more widely.

Why can't I open my .msgpack file?

Almost always because no installed app understands MessagePack. Install one of the apps above, or convert the file to a format your existing software already reads. If double-clicking opens the wrong program instead of nothing at all, the file association is set to the wrong app rather than the file being broken.

The other possibility is that the file is not really a .msgpack at all. Drop it into the file identifier to check it by its bytes instead of its name. Nothing is uploaded.

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.

MessagePack has no fixed magic number, so there is no signature table on this page. Its bytes alone do not prove the format: identification relies on the extension, the structure of the content and the program that created it. The magic-numbers reference lists the formats that do carry one.

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. How sources are ranked and what is deliberately left out is set out in the methodology.