Protocols & Binary Serialization

CBOR to JSON converterInspect every byte and type

Decode one CBOR item from Hex, Base64, Base64URL or a local file; inspect its tree and marked JSON mapping.

CBOR to JSON converter

Input

Result

Enter data or load the example.

Processed locally in this browser; no payload is uploaded.

Options

Choose the input format explicitly; one complete CBOR item is expected.

Enter data or load the example.

A CBOR to JSON converter is useful when a compact payload carries tags, byte strings or map keys that plain JSON cannot name accurately. This page keeps those types visible instead of silently flattening them. Use the CBOR decoder to inspect a captured message, then switch to the CBOR encoder when you need new bytes from ordinary JSON.

Why use this CBOR to JSON converter

Follow bytes into a typed tree

A Hex payload becomes a field tree with byte offsets. A tag remains a tag, and a numeric map key stays numeric, so a CBOR viewer can show what the wire item actually contains.

Hex bytes branching into a tree of typed CBOR fields and offset markers

Keep the JSON mapping explicit

This CBOR to JSON converter wraps every map as ordered entries and labels bytes, tags and unsafe integers. The mapping avoids inventing ordinary JSON values where the CBOR model is wider.

A byte string, numbered tag and numeric key retained as separate structured cards

Choose the bytes, then verify the type

01

Select the real input format

Hex is the default. Choose Base64 or Base64URL explicitly, or read a local .cbor file; guessing between alphabets can decode the wrong bytes.

02

Watch when the result updates

Automatic conversion waits 350 ms after a change. Turn it off for manual runs with Ctrl/Cmd + Enter; old results cannot be copied after the input changes.

03

Compare tree and mapped JSON

The tree shows type and byte span; the JSON tab uses $cbor markers. A .json export is that mapping, while JSON→CBOR downloads raw .cbor bytes.

Read structure or produce new bytes

Decode common CBOR encodings

The CBOR decoder accepts definite and indefinite arrays, maps, byte and text strings, integers, floats, simple values and tags.

Inspect a type-aware mapping

The JSON view exposes ordered map entries, byte strings and numbered tags. It is a readable projection, not a claim that CBOR and JSON share one data model.

Encode plain JSON

JSON to CBOR turns objects, arrays, strings, booleans, null and safe numbers into a binary item; copy Hex or Base64 or download .cbor.

What this mapping preserves and cannot infer

One complete item
The CBOR to JSON converter rejects trailing bytes instead of silently treating a CBOR sequence as one value. Parse sequences with a dedicated stream tool.
Marked JSON is a view
All maps use $cbor entries, even string-key maps. The JSON→CBOR input accepts ordinary JSON and does not interpret those markers as a byte-perfect reverse format.
Precision and resource limits
Ordinary JSON integers beyond the JavaScript safe range are rejected on encode; decode labels large CBOR integers. Inputs are capped at 1 MiB, 10,000 nodes and 64 levels.
No protocol validation
A tag number is displayed, not treated as proof of COSE signatures, WebAuthn data, CDDL validity or trust. No URL is fetched.

CBOR to JSON converter questions

How do I decode a CBOR payload?

Choose Hex, Base64 or Base64URL, then paste one complete CBOR item. The default Hex sample demonstrates a tag, a byte string and a numeric map key.

How are large integers handled?

CBOR integers outside the safe JavaScript number range stay decimal strings inside a typed wrapper in the mapping. Ordinary JSON encoding rejects unsafe integer literals rather than rounding them.

What if the payload has trailing bytes?

Extra bytes after one data item cause a trailing-byte error with a byte offset. This tool does not automatically split a CBOR sequence.

Why is a byte string rendered as 0x...?

The mapping uses a $cbor bytes wrapper with a hex field, so a byte string cannot be mistaken for an ordinary text string.

Does it work with .cbor files?

Yes. The file input reads .cbor or .bin data with the browser File API and previews replacement before applying it; no upload is performed.

Still have a question?

Use the CBOR to JSON converter now

Inspect a captured CBOR item or encode a plain JSON value. The mapped output makes non-JSON types visible before you export.