MessagePack & CBOR Encoder
Encode JSON to MessagePack or CBOR — and decode it back — with a byte-by-byte annotation of every field, the encoded size versus the original JSON size, and format auto-detection. The codecs are implemented here in TypeScript; no library and no network call.
1 · JSON → bytes
Numbers outside the 64-bit range throw instead of silently losing precision. Use {"$bytes":"<base64>"} for a byte string, {"$tag":1,"value":…} for a CBOR tag, and {"$indefinite":[…]} for an indefinite-length CBOR array or map.
86 a2 69 64 2a a4 6e 61 6d 65 ab 50 75 72 65 42 72 6f 77 73 65 72 a5 72 61 74 69 6f ca 3f c0 00 00 a6 62 69 6e 61 72 79 c4 05 68 65 6c 6c 6f a5 66 6c 61 67 73 93 c3 c2 c0 a6 6e 65 73 74 65 64 83 a4 74 69 6e 79 cc ff a3 62 69 67 cf 00 00 00 01 00 00 00 00 a3 6e 65 67 d1 fc 18a6 62 69 64 18 2a 64 6e 61 6d 65 6b 50 75 72 65 42 72 6f 77 73 65 72 65 72 61 74 69 6f fa 3f c0 00 00 66 62 69 6e 61 72 79 45 68 65 6c 6c 6f 65 66 6c 61 67 73 83 f5 f4 f6 66 6e 65 73 74 65 64 a3 64 74 69 6e 79 18 ff 63 62 69 67 1b 00 00 00 01 00 00 00 00 63 6e 65 67 39 03 e7Byte-by-byte breakdown — MessagePack
| Offset | Bytes | Hex | Meaning |
|---|---|---|---|
| 0x0000 | 1 | 86 | map fixmap(6) |
| 0x0001 | 1 | a2 | str fixstr(2) |
| 0x0002 | 2 | 6964 | "id" (2 bytes UTF-8) |
| 0x0004 | 1 | 2a | positive fixint 42 |
| 0x0005 | 1 | a4 | str fixstr(4) |
| 0x0006 | 4 | 6e616d65 | "name" (4 bytes UTF-8) |
| 0x000a | 1 | ab | str fixstr(11) |
| 0x000b | 11 | 5075726542726f77736572 | "PureBrowser" (11 bytes UTF-8) |
| 0x0016 | 1 | a5 | str fixstr(5) |
| 0x0017 | 5 | 726174696f | "ratio" (5 bytes UTF-8) |
| 0x001c | 5 | ca3fc00000 | float32 1.5 |
| 0x0021 | 1 | a6 | str fixstr(6) |
| 0x0022 | 6 | 62696e617279 | "binary" (6 bytes UTF-8) |
| 0x0028 | 2 | c405 | bin 8(5) |
| 0x002a | 5 | 68656c6c6f | bin (5 bytes) |
| 0x002f | 1 | a5 | str fixstr(5) |
| 0x0030 | 5 | 666c616773 | "flags" (5 bytes UTF-8) |
| 0x0035 | 1 | 93 | arr fixarray(3) |
| 0x0036 | 1 | c3 | true |
| 0x0037 | 1 | c2 | false |
| 0x0038 | 1 | c0 | nil |
| 0x0039 | 1 | a6 | str fixstr(6) |
| 0x003a | 6 | 6e6573746564 | "nested" (6 bytes UTF-8) |
| 0x0040 | 1 | 83 | map fixmap(3) |
| 0x0041 | 1 | a4 | str fixstr(4) |
| 0x0042 | 4 | 74696e79 | "tiny" (4 bytes UTF-8) |
| 0x0046 | 2 | ccff | uint8 255 |
| 0x0048 | 1 | a3 | str fixstr(3) |
| 0x0049 | 3 | 626967 | "big" (3 bytes UTF-8) |
| 0x004c | 9 | cf0000000100000000 | uint64 4294967296 |
| 0x0055 | 1 | a3 | str fixstr(3) |
| 0x0056 | 3 | 6e6567 | "neg" (3 bytes UTF-8) |
| 0x0059 | 3 | d1fc18 | int16 -1000 |
2 · Bytes → JSON
What is covered
MessagePack
Positive and negative fixint, uint8/16/32/64, int8/16/32/64, float32/float64 (the narrowest that round-trips), fixstr and str8/16/32, bin8/16/32, fixarray and array16/32, fixmap and map16/32, nil, true, false.
CBOR (RFC 8949)
All integer widths, float16/32/64, definite and indefinite byte and text strings, arrays and maps, tags, simple values, null and undefined. Tag 0/1 render as ISO dates, tags 2/3 as bignums.
Note on integers: MessagePack has no native bigint, so values beyond ±2^53 come back as strings. Anything outside the 64-bit range is rejected rather than truncated.
About this tool
This tool encodes JSON into MessagePack and CBOR and decodes both formats back to JSON, using codec implementations written from scratch in TypeScript — no library is bundled or fetched. It annotates every encoded field with its offset, byte length, raw hex and meaning, and reports the encoded size against the original JSON. Everything runs in your browser, so pasted data never leaves the page and the tool works fully offline.
- 100% free — no account needed
- Runs in your browser
- Nothing is uploaded
Frequently asked questions
Is MessagePack & CBOR Encoder really free?
Yes. MessagePack & CBOR Encoder is completely free on PureBrowser — every feature, with no account, no trial, and no credit card.
Does MessagePack & CBOR Encoder upload my data?
No. MessagePack & CBOR Encoder runs entirely inside your browser, so anything you type, paste, or open stays on your own device.
Do I need to sign up or install anything?
Neither. There is no account and nothing to download — open the page and MessagePack & CBOR Encoder is ready to use on desktop or mobile.
Does MessagePack & CBOR Encoder work offline?
Once the page has loaded, yes. All of the processing happens locally in your browser, so it keeps working without a connection.
More developer tools
Folder Structure Generator
Build folder structure diagrams, ASCII directory trees, and file tree visualizations for READMEs and docs.
.gitignore Generator
Generate merged .gitignore rules for your stack with one click.
JSON to TypeScript Interface
Convert JSON into TypeScript interfaces with inferred nested types.
Text to Slug Converter
Convert titles and phrases into clean SEO-friendly URL slugs.
UTM Builder
Build campaign URLs with UTM parameters for analytics tracking.
JSON Formatter & Validator
Validate, format, and minify JSON directly in your browser.