JSON ↔ CBOR
Encode JSON to CBOR bytes (shown as hex) or decode CBOR bytes back to JSON. Covers uint/negint/text/array/map/float/bool/null; no byte strings, tags, or indefinite-length items. Runs on your device.
Runs on your device. The file is never uploaded.
JSON to CBOR packs a document into CBOR and prints the result as space-separated hex; decode mode goes the other way, reading raw bytes. Integers get the narrowest head that fits, and anything fractional is written as a 64-bit float. Map keys keep your document order, so the bytes are not canonical CBOR.
Questions
What do the two modes do?
Encode, the default, reads JSON text and writes CBOR bytes shown as space-separated hex. Decode reads the raw bytes of the file you dropped and writes JSON back, pretty-printed with 2 spaces. CBOR is a compact binary encoding for the same kind of data JSON holds.
How do I decode the hex it gave me?
Convert it back to bytes first. Decode mode reads a binary file, not hex text, so run the hex output through the From hexdump tool to get a .bin file and drop that in. From hexdump accepts a plain run of hex pairs as well as a full dump.
Which CBOR types are supported?
Unsigned and negative integers, text strings, arrays, maps, floats, booleans and null, which is everything JSON itself can express. Byte strings and tags are not implemented and a file using them stops with a message naming the major type. Indefinite-length items are refused too.
How are numbers encoded?
A whole number inside the safe integer range gets an integer head using the smallest width that fits, so small values take one byte. Anything else, including any fractional number, is written as a 64-bit float. Decoding accepts half, single and double precision floats and gives you plain JSON numbers back.
Is this canonical CBOR?
No. Map keys are written in the order they appear in your JSON rather than being sorted, so two documents with the same content but different key order produce different bytes. Lengths do use the smallest head that fits. If you need deterministic encoding for a signature, do not rely on this.
Is my payload uploaded?
No. Both directions run in a Web Worker in this tab, with no upload and no stored copy. Documents nested more than 300 levels deep are refused rather than risking a stack overflow, and that is the only limit the tool imposes; everything else is bounded by your own device memory.