# Protobuf Decoder Online - MessagePack, CBOR & BSON Viewer

> Decode raw Protobuf without a schema or with a pasted .proto, plus MessagePack, CBOR and BSON. Tree + JSON views with byte-offset highlighting.

- URL: https://qilingtools.com/en/binary-decoder
- Category: Developer Tools (https://qilingtools.com/en/dev)
- Tags: [Developer](https://qilingtools.com/en/tags/dev), [Data Formats](https://qilingtools.com/en/tags/data), [Encoding](https://qilingtools.com/en/tags/encode)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

Captured some gRPC / Protobuf bytes, found MessagePack in Redis, got CBOR from a device or a BSON dump from MongoDB? Paste it as hex (spaces, 0x and \x styles all work) or Base64, or open the file, and the format is detected for you. Without a schema, Protobuf is decoded straight from the wire format: field numbers and wire types, varints read as unsigned, signed int64 and zigzag (sint), fixed32/64 as integers and floats, and length-delimited fields tried as printable string, nested message and packed repeated values before falling back to bytes — with the other possible readings listed alongside, plus protoc --decode_raw-style text output. Paste a .proto file to decode with real field and enum names, including nested types, repeated, packed, map and oneof fields. MessagePack covers every type plus the timestamp extension; CBOR follows RFC 8949 with tags (dates, bignums, UUIDs, embedded CBOR), half-precision floats and indefinite-length strings, arrays and maps, and produces diagnostic notation; BSON handles ObjectId, dates, Decimal128 and binary and outputs Extended JSON. Results appear as a tree and as JSON: hover a node to highlight its bytes in the hex view, or click a byte to jump to its node; decoding errors point at the exact offset. It also works in reverse, encoding JSON to MessagePack, CBOR or BSON. Everything runs locally in your browser.

## How to use

1. Paste hex or Base64, or open a binary file
2. Pick the format (auto-detected by default); for Protobuf optionally paste a .proto and choose the root message
3. Explore the tree alongside the hex view and copy the JSON

## Features

- Schema-less Protobuf: varint / zigzag / fixed / nested / packed inference
- Named decoding from a pasted .proto (enums, maps, oneofs, nested types)
- MessagePack with every type and the timestamp extension
- CBOR (RFC 8949): tags, half floats, indefinite lengths, diagnostic notation
- BSON: ObjectId, dates, Decimal128, Extended JSON output
- Two-way byte-offset linking between tree and hex view
- Auto-detects format and input encoding (hex / Base64 / file)
- Encode JSON to MessagePack / CBOR / BSON

## FAQ

### Can I decode Protobuf without the .proto file?

Yes. The wire format carries field numbers and wire types, so the structure can be fully recovered — just not the names or exact types. A varint could be an int, bool, enum or zigzag-encoded sint, and a length-delimited field could be a string, bytes, a nested message or a packed array. The tool shows the most likely reading and lists alternatives in grey. Paste the .proto for exact results.

### How do I decode captured gRPC traffic?

Each gRPC message starts with a 5-byte frame header: a 1-byte compression flag and a 4-byte big-endian length. Strip those 5 bytes before pasting; if the flag is 1 the payload is also gzip-compressed and must be decompressed first. gRPC-Web text is the same after Base64 decoding.

### Why can the same bytes be detected as different formats?

None of these formats has a magic number, and short inputs are often valid Protobuf, MessagePack and CBOR at the same time. Auto-detection prefers the one that decodes completely into the most sensible structure (BSON is easy thanks to its length header). If it guesses wrong, choose the format manually.

### How are big integers and binary data shown in JSON?

Integers beyond JavaScript’s safe range (2^53) are output as strings so no precision is lost, and bytes are output as Base64 strings, matching Protobuf’s JSON mapping. BSON uses MongoDB Extended JSON — {"$oid": "…"}, {"$date": …}, {"$numberLong": "…"} — so types survive encoding back to BSON.

## Related tools

- [JSON Formatter](https://qilingtools.com/en/json): Free online JSON formatter: beautify or minify, validate with the exact line and column of any error, browse a collapsible tree, sort keys and escape strings.
- [Base64 Encode/Decode](https://qilingtools.com/en/base64): Free online Base64 encoder and decoder: UTF-8 safe, optional URL-safe variant, convert text to Base64 and back in real time. Processed locally, never uploaded.
- [URL Encode/Decode](https://qilingtools.com/en/url-encode): Free online URL encoder and decoder with encodeURIComponent and encodeURI modes. Escapes Chinese, spaces and special characters. Real-time and local, no upload.
- [JWT Decoder](https://qilingtools.com/en/jwt): Free online JWT decoder: decode the header and payload of a JSON Web Token, show expiry and issued-at times, all locally without uploading the token.
- [Timestamp Converter](https://qilingtools.com/en/timestamp): Free online Unix timestamp converter: convert timestamps and dates, auto-detect seconds or milliseconds, and show local, UTC, ISO 8601 and relative time.
- [Hash / Checksum](https://qilingtools.com/en/hash): Free online hash calculator: SHA-1, SHA-256, SHA-384 and SHA-512 of text or any file through the browser crypto API. Files never leave your device.
- [UUID Generator](https://qilingtools.com/en/uuid): Free online UUID generator: create RFC 4122 UUID v4 in bulk with a cryptographic RNG. Options for uppercase, no hyphens and braces, with one-click copy.
- [Base Converter](https://qilingtools.com/en/base-convert): Free online number base converter: convert between binary, octal, decimal, hexadecimal and any base 2–36. Uses BigInt for huge integers, computed locally.
