CBOR to JSON (text) Converter
Explains CBOR (RFC 8949), its types and how to represent compact binary values in textual JSON.
Copied!
Paste the CBOR bytes as hex. Byte strings come back as 0x…; tags return their contents. Indefinite-length items and bignums are not supported.
CBOR (Concise Binary Object Representation, RFC 8949) is a compact binary format whose data model mirrors JSON, with extra types on top: byte strings, timestamps and bignums.
To convert a whole CBOR file to JSON text, reach for a library such as cbor (Node) or cbor2 (Python). Types with no direct JSON equivalent — byte strings, for instance — are usually rendered as base64 or hex.
Reading CBOR bytes without installing anything
CBOR turns up in COSE, WebAuthn, digital certificates and device telemetry, always in the moments where you are handed a pile of bytes and need to understand the payload before writing a single line of code. Paste the hex sequence and the page hands back the equivalent JSON, indented. The sample a26161016162820203 becomes an object with a set to 1 and b set to the list 2, 3.
The reader follows the main path of RFC 8949: the top three bits of the head byte say whether you have an integer, a negative integer, a byte string, text, an array, a map, a tag or a simple value, and the low five bits carry the length. Half, single and double precision floats are all handled. Byte strings come out as text starting with 0x, and map keys always become strings in JSON, even when they were integers.
Two limits are worth knowing before you trust the output. Indefinite-length items, the 0x9f and 0xbf family, are not supported and the tool says so. Tags are unwrapped and then thrown away: a tag 1 timestamp gives you the bare integer 1363896240, and a tag 2 bignum gives you hex bytes instead of a number. When tags matter, use cbor on Node or cbor2 in Python. All decoding happens in your browser.
Frequently asked questions
Can I paste base64 instead of hex?
Why did my timestamp turn into a plain integer?
Why does an indefinite-length array fail?
Related Tools
MessagePack to JSON (text) Converter
Explains the MessagePack binary format, its advantages and how to translate it into textual JSON.
BSON to JSON (text) Converter
Explains differences between binary BSON and JSON with a type table and textual conversion examples.
Binary Code Translator
Convert text to binary code (0s and 1s) and vice versa. Supports any ASCII character. Processed in the browser.
YAML to NDJSON Converter
Explains how to represent YAML lists as NDJSON (one JSON object per line) with practical examples.
JSON to TypeScript
Convert a JSON to TypeScript interfaces with automatically inferred types. Detects strings, numbers, booleans, arrays, nested objects and union types. Everything in your browser.
JSON to YAML
Convert JSON data to YAML format.