opyeb cborlab

Paste it in, no server needed

Paste CBOR bytes,
from major type to COSE signature

Drop in RFC 8949 CBOR as Hex, Base64 or Base64url and read byte offsets, major types 0-7, indefinite-length items, tags and Float16/32/64 as a structure tree and a major-type decomposition table, with the same data in RFC 8949 Extended Diagnostic Notation and in JSON with every loss point flagged. A Tag 18 COSE_Sign1 is split into protected, unprotected, payload and signature, and a public key lets WebCrypto verify the signature. Zero input sent to a server (advertising and affiliate widgets excepted).

Paste CBOR bytes as Hex or Base64. Results update as you type.

CBOR input

—

Spaces, 0x, colons and hyphens are ignored. Empty input decodes to nothing.

JSON to CBOR

Write a byte string as {"$bytes":"hex or base64url"}, an integer-keyed map as {"$map":[[key,value],…]} and a tag as {"$tag":number,"value":value}.

Public key

Paste a JWK (JSON) or an SPKI PEM. The key is used only inside this page.

Result

Decomposition —

offsetheadermajor type AIargumentlength or count

Structure tree

    The download name follows the active tab: cborlab-report.md, cborlab-report.json, cborlab-item.edn and so on.

    Structure summary

    —

    How to read it

    • Severity is error (cannot be decoded), warning (valid but discouraged by the spec) or note (context).
    • Indefinite length is valid CBOR, but deterministic encoding never uses it.
    • EDN is the RFC 8949 §8 notation. Read it together with the JSON loss notes so a conversion is not mistaken for a lossless copy.

    Everything is computed in this browser. Input is never sent to a server.

    How it works

    1. 01Paste the bytes

      Enter CBOR as Hex or Base64, or pick one of the six synthetic presets. Nothing is ever sent anywhere.

    2. 02Read the structure

      The structure tree shows each item's offset and reading, and the table shows every header byte by major type. The EDN tab writes the same items in RFC 8949 notation.

    3. 03COSE and export

      For COSE_Sign1, inspect headers, CWT claims and the signature, then verify it with a public key. Download the Markdown or JSON report or the .cbor file.

    What one screen holds

    Why the input never leaves

    A COSE signature can carry unpublished claims and CBOR can carry device data, so the decoder and the verifier live in the page.

    Questions

    Is it safe to paste bytes that contain a signature?

    The input is processed in the page and never sent or stored, and the public key is used only in browser memory. Advertising and affiliate widgets load from their own origins but do not read it.

    What is EDN?

    The Extended Diagnostic Notation of RFC 8949 §8: a readable text form of CBOR where h'..' is a byte string, [_ ] an indefinite-length array and 1(…) a tag.

    Are half-precision floats read?

    Yes. Half precision (1-5-10), float32 and float64 are all decoded per IEEE 754, and deterministic encoding picks the narrower width when the value survives it, as with 1.5 or 65504.

    How is a COSE signature verified?

    The page builds Sig_structure = ["Signature1", protected, h'', payload] from the protected bstr and the payload bstr and verifies it with WebCrypto. alg comes from label 1 in the protected header.

    What is lost in the JSON view?

    Non-string map keys, duplicate keys, integers above 2^53, tags, byte strings, undefined and NaN or Infinity. Each loss is reported with its offset.

    Does the report contain the input?

    No. It holds the diagnostic list, a structure summary, the EDN and the JSON result, never the full signed bytes or the public key.

    Five articles: the CBOR header, EDN, indefinite length and deterministic encoding, COSE_Sign1, and what JSON conversion loses.

    Open some bytes now

    A synthetic example is already loaded. Paste real bytes and the content still never leaves the browser.