CBOR to JSON Converter - Convert CBOR Binary Data Online
Free online CBOR to JSON converter tool to decode and convert CBOR binary data to JSON format with Base64 and Hex support.
How to Convert CBOR to JSON - Step by Step Guide
Input Your CBOR Data
Let's decode your CBOR (Concise Binary Object Representation) data! Whether you're working with IoT devices, embedded systems, or compact data formats from RFC 8949 compliant sources, you have several convenient options to get started:
Example: CBOR Input (Base64)
Here's what encoded CBOR data looks like:
o2RuYW1lZU1hZXZlY2FnZRgeZmFjdGl2ZfU=
Automatic Decoding & Analysis
There is no Convert button. About half a second after you stop typing, the bytes are decoded in your browser and the JSON shows up on the right. Here is what happens along the way:
8901240544102066246 doesn't turn into …066000.2.0, not 2, so it reads back as the same type.Example: Decoded JSON Output
The same CBOR, now decoded as readable JSON:
{ "name": "Maeve", "age": 30, "active": true }
Choose Format Options
Pick the mode that matches how your bytes were written down. If you paste into the wrong one, the page tells you instead of showing garbage.
= padding, and a data:…;base64, prefix is fine.0x prefixes between bytes are ignored.Export Your JSON Data
Once the JSON looks right, take it with you:
converted.json.Frequently Asked Questions
What is CBOR and why convert it to JSON?
CBOR (Concise Binary Object Representation, RFC 8949) is a binary format with the same building blocks as JSON: maps, arrays, text, numbers, true/false and null, plus a few extras such as byte strings and tags. It shows up wherever bytes are expensive: IoT sensors, CoAP and MQTT payloads, WebAuthn/FIDO2 attestation data, COSE signatures and EU Digital COVID Certificates. Because it is binary you can't read it in a text editor, so turning it into JSON is the quickest way to see what a payload actually contains.
Where do I get the CBOR to paste here?
Usually from a log line, an API response or a database column, where the bytes have already been written as Base64 or hex. You can also make some yourself: Python's cbor2, JavaScript's cbor-x, Go's fxamacker/cbor, Rust's ciborium or Java's Jackson CBOR module all write CBOR. If you have a raw .cbor or .bin file, upload it and the page reads the bytes directly.
What happens to CBOR types that JSON doesn't have?
Integers of any size, including uint64, int64 and bignums (tags 2 and 3), are written as JSON numbers with every digit. Floats stay floats (2.0 rather than 2). Byte strings become Base64 text. Date strings (tag 0) are kept as written and epoch dates (tag 1) become ISO 8601 text in UTC. undefined becomes null, NaN and Infinity become the text "NaN" and "Infinity", and map keys that aren't text (such as 1 or 2) are written as text, because JSON keys must be strings. Any other tag is shown as {"tag": number, "value": …}. Whenever one of these changes happens, a note above the output says so.
Why does my long ID look right here but change in my own code?
The page writes 8901240544102066246 exactly as it was stored. But JavaScript's JSON.parse turns any integer above 9007199254740991 into the nearest double, so a browser or Node script reading the JSON may still round it. Python's json module and Jackson with BigInteger keep it exact. If the JSON is going into JavaScript, treat such IDs as strings.
Should I paste Base64 or Hex?
Whichever your data is already in. Base64 is shorter and is what you normally find inside JSON, databases and APIs; hex is what debuggers, Wireshark and cbor.me show. URL-safe Base64, missing padding, a data: prefix and hex with spaces, colons or 0x prefixes are all accepted. If you paste hex while Base64 is selected (or the other way round), the page tells you to switch rather than showing nonsense.
My input holds several CBOR values. What happens?
Values written back to back, which RFC 8742 calls a CBOR sequence, are shown as one JSON array with one entry per value. If the data ends in the middle of a value, you get an error saying it looks cut off instead of a partial result.
How big a file can I decode?
Everything runs in your browser, so the limit is your device. A file with a few thousand records decodes in well under a second; files of tens of megabytes work but get slow, mostly because the JSON is shown in a text editor. For hundreds of megabytes, a short script with cbor2 or cbor-x will be faster.
Is my data uploaded anywhere?
No. The CBOR is decoded by JavaScript on this page and nothing you paste or upload is sent to a server. The tool is free and needs no account.
Related Tools
JSON to CBOR
Convert JSON data to CBOR binary format
CBOR Fixer
Fix broken CBOR data automatically, repair malformed binary object representations and structural errors
CBOR Encoder
Encode JSON, YAML, XML, CSV to CBOR binary format with Base64 and Hex output
CBOR Decoder
Decode CBOR binary to JSON, YAML, XML, CSV formats with Base64 and Hex input
CBOR Formatter
Format and beautify CBOR diagnostic notation
CBOR Validator
Validate CBOR binary data structure and integrity