JSON ↔ MessagePack / CBOR

Client

Encode JSON into compact binary (MessagePack or RFC 8949 CBOR), or decode a Base64 payload back to pretty JSON. Sample JSON is pre-filled so you can try encoding immediately—everything runs locally in your tab.

Learn more: MessagePack and CBOR

Serialize JSON-compatible values into binary MessagePack or CBOR, and decode Base64-encoded bytes back to pretty JSON—useful for smaller wire payloads and interoperability checks.

Binary vs JSON text

MessagePack and CBOR are compact binary formats; size is often smaller than minified JSON, especially with many short keys or numeric arrays. They can also represent types JSON does not (for example certain byte strings or extension types), so round-tripping through JSON may drop information.

Base64 panel

The tool shows the encoded bytes as standard Base64 text so you can copy into logs, HAR exports, or tickets. Whitespace in the Base64 field is ignored when decoding.

JSON & binary

?

JSON → binary uses JSON.parse then @msgpack/msgpack encode. Binary → JSON decodes bytes then pretty-prints with JSON.stringify (BigInt and simple Map/Set values are coerced for display).

MessagePack and CBOR can represent types JSON does not (e.g. byte buffers, certain number precisions). Round-trip through JSON may lose information—validate in the system that consumes the binary format.

Format

Choose MessagePack or CBOR, then JSON → binary or binary → JSON. The right panel is standard Base64 of the raw bytes (whitespace ignored).

Nearby workflows on Toolcore

  • JSON formatterwhen the document must parse before any transform or export.
  • JSON ↔ BSONwhen MongoDB-style binary documents are the target format.

Common use cases

  • Inspect API payloads that use MessagePack or CBOR instead of raw JSON.
  • Compare size between JSON text and a binary encoding before wiring a client or device.
  • Decode a captured Base64 blob when logs or traces only show the compact form.
  • Prototype WebSocket or MQTT payloads where bandwidth matters and the wire format is binary.
  • Share a readable JSON view with teammates while the production path stays MessagePack or CBOR.

Common mistakes to avoid

  • Expecting identical bytes across libraries

    Key order and optional CBOR tags can differ. For checksums, normalize or compare decoded values, not raw bytes.

  • Treating Base64 as plain text JSON

    Decode Base64 first—if you paste raw binary or hex into the JSON box, parsing will fail. Use the decode path meant for compact payloads.

  • Assuming CBOR and MessagePack are interchangeable

    They are different encodings with different edge cases. Pick the one your service documents, then validate end-to-end with that stack.

FAQ

Are documents uploaded?

No. Encoding and decoding run in your browser from what you paste.

Should I use MessagePack or CBOR?

Follow your API or device spec. CBOR is standardized in RFC 8949; MessagePack is widely used in caches and RPC. This page helps you inspect either—not choose a standard for production.

Does this validate against a schema or protobuf?

No. Use JSON Schema or your codegen pipeline after you have JSON—this tool only converts between JSON and the binary encoding.

Common search terms

Phrases people search for that match this tool. See the full long-tail keyword index.

  • json to messagepack online
  • json to cbor encoder
  • decode messagepack base64

Related utilities you can open in another tab—mostly client-side.