CBOR Encoder & Decoder

Convert JSON to CBOR hex or decode CBOR hex.



FAQ

Where is data processed?

In your browser. Inputs are not uploaded.

What is supported?

JSON-compatible values; decoded integers outside JSON precision become decimal strings and byte strings become hex objects. Tags, indefinite lengths, invalid UTF-8, non-finite numbers, undefined and duplicate map keys are rejected.

Other Languages

References

How we make sure

We check this tool with the automated test suites linked below. Example checks are shown in their original language.

Verification method
Compare encoded bytes with a stored Python cbor2 fixture, decode that fixture and reject a duplicate-key map. Explicit rejection checks cover invalid UTF-8, indefinite structures, NaN, infinities and undefined; an exact uint64-to-decimal-string case remains accepted.
Comparison reference
Python cbor2 6.2.0.post2 stored fixture versus cborg 6.2.1; generator/provenance in tests/fixtures/completion-tools.json.
Verification scope
JSON-compatible values; decoded integers outside JSON precision become decimal strings and byte strings become hex objects. Tags, indefinite lengths and duplicate map keys are not accepted.
Test source and cases (select a file to read it)
  • completion-tools.test.js
    • cbor-converter: cbor2 fixture and malformed duplicate-key input
    • CBOR strict policy rejects invalid UTF8 indefinite structures and non-JSON values

These checks cover the listed examples and boundaries, not every possible input. Round trips and checks using the same library are not independent verification.