Convert between CBOR, CDN (CBOR-EDN), and JavaScript values — with CDDL
validation
@cbortech/cbor
is a zero-dependency TypeScript library implementing
RFC 8949 CBOR
and
CDN (CBOR-EDN) draft-25
/
draft-27, and
RFC 8610 CDDL
— encode, decode, parse, pretty-print, and round-trip with full
fidelity. Everything on this page runs in your browser using the library
itself, including live validation of CDN input against CDDL schemas.
-
Lossless round-trips — encoding widths and comments
survive CDN (CBOR-EDN) ⇄ CBOR conversion.
-
JSON-like API —
CBOR.parse /
CBOR.stringify with reviver and replacer support.
-
AST access — inspect every data item with byte
ranges, warnings, and annotated hex dumps.
-
CDDL validation — click CDDL below to open the schema
pane and validate CDN input live, with failures highlighted in the
schema, source, and CBOR bytes. Supports every
RFC 8610
control operator, plus
RFC 9165's
.plus, .cat, and .feature.
-
Extensible — app-extensions for dates, IP addresses,
string concatenation, and more, plus optional
hash,
uuid, and
set/map
support. Toggle any extension from the Extensions button in the
playground control bar below.