MessagePack to JSON

Decode MessagePack bytes into readable JSON.

Runs in your browser Instant No sign-up
Input
Indent
MessagePack (hex or Base64)
JSON
Reverse

Paste, type or drop a file — output appears as you type.

Waiting for input
Processed locally · nothing is uploadedProcessed locally

How to use the MessagePack decoder

  1. Paste the bytes as hex (86 a2 69 64 …) or Base64 into the left pane. The JSON appears as you type.
  2. Input: Detect (the default), Hex or Base64.
  3. Indent: 2 or 4 spaces, tabs, or minified.
  4. Under More options: Values (First value, or All to decode a stream of concatenated values as an array) and Bytes as (Hex string or Tagged).

Example

86 a2 69 64 cf 00 20 00 00 00 00 00 01 a4 6e 61 6d 65 ac 4c 61 6e 20 4e 67 75 79 e1 bb 85 6e
a6 61 63 74 69 76 65 c3 a5 73 63 6f 72 65 ca 40 90 00 00 …

decodes to

{
  "id": 9007199254740993,
  "name": "Lan Nguyễn",
  "active": true,
  "score": 4.5,
  "tags": ["admin", "beta"],
  "address": { "city": "Hà Nội", "zip": null }
}

Note that id is 2^53 + 1: a JavaScript JSON.parse of a naive conversion would print 9007199254740992. Here it stays exact.

What it understands

The whole MessagePack specification: nil, booleans, positive and negative fixint, uint8–uint64 and int8–int64, float32 and float64, fixstr/str8/str16/str32, bin8–bin32, fixarray/array16/array32, fixmap/map16/map32, fixext and ext8–ext32, and the timestamp extension. Map keys that are not strings (numbers, booleans, arrays) are written as their JSON text, because JSON object keys are always strings, and a warning says so. If a map repeats a key, the last value wins and you are told.

Bytes left over after the first value are reported with their offset rather than silently ignored. Many log pipelines and socket protocols write several MessagePack values back to back; set Values to All to see every one of them as an array.

When it helps

MessagePack shows up in Redis and cache payloads, Fluentd and Fluent Bit logs, Socket.IO and SignalR traffic, Pusher and MQTT messages, and RPC frameworks. When a binary blob turns up in a debugger or a database column, paste it here to see what’s inside, then format or explore the result with the JSON Formatter or the JSON Viewer.

To go the other way, the JSON to MessagePack encoder produces the smallest encoding of a JSON document. If you only have the data as Base64 text and want the raw bytes in another form, the Base64 decoder helps, and CBOR to JSON handles the similar CBOR format.

Limits

Floats that are NaN or Infinity become null with a warning, since JSON has no way to write them. A timestamp outside the range JavaScript dates can represent is shown as its raw ext value instead of a wrong date. Values are decoded in a background worker, so even a large payload cannot freeze the page.

Frequently asked questions

Can I paste Base64 instead of hex?

Yes. Input is set to Detect by default: spaced or plain hex, 0x-prefixed bytes and \x escapes are read as hex, everything else as Base64 (a data: URI works too). If the guess is wrong, pick Hex or Base64 in the Input option.

Are 64-bit integers exact?

Yes. uint64 and int64 values beyond 2^53 are kept as exact integers in the JSON output, for example 18446744073709551615, instead of being rounded the way JavaScript numbers would.

How are bin, ext and timestamp values shown?

bin values become hex strings (or {"$bin": "…"} with Bytes as set to Tagged). Extension types become {"$ext": type, "hex": "…"}. The standard timestamp extension (type -1) in its 32, 64 and 96-bit forms becomes an ISO 8601 string with nanoseconds.

What happens with truncated or corrupt data?

Nothing is guessed. You get an error that names the byte offset, such as "Truncated: str8 at byte 0 needs 40 bytes, 2 left". A length or count larger than the remaining data is refused before anything is allocated, and nesting deeper than 500 levels is stopped.

Is my data uploaded?

No. Decoding happens in your browser, so payloads from production systems never leave your device.

Last updated