Skip to content
uencoder
TASK

Use CBOR encoding for compact binary JSON

CBOR (Concise Binary Object Representation, RFC 8949) is a binary serialization format for JSON-like data, smaller and faster than JSON.

  1. 1

    CBOR encodes JSON-like data (objects, arrays, strings, numbers, booleans, null) in binary. It is smaller than JSON (no quotes, no delimiters, compact integer encoding) and faster to parse (no text scanning). It also supports types JSON lacks: byte strings, dates, bignums.

  2. 2
    Base64 Encoder →

    After encoding data to CBOR (binary), encode the result as base64 for transport through text-only channels (HTTP, JSON fields, logs). The receiver decodes base64 to bytes, then decodes CBOR to the original data structure.

  3. 3
    Base64 Decoder →

    Decode the base64 to recover the CBOR bytes, then decode CBOR to the original data. This two-step process (base64 → CBOR → data) is common when CBOR must transit text-based protocols.

  4. 4

    Use CBOR when: payload size matters (IoT, mobile), parsing speed is critical, or you need binary data (byte arrays) without base64 inflation. For web APIs, JSON is still the default — CBOR requires content negotiation (Accept: application/cbor). Use it for internal services and constrained environments.

Frequently asked questions

CBOR vs MessagePack?
Both are binary JSON formats. CBOR is an IETF standard (RFC 8949) with a richer type system (tags, simple values). MessagePack is faster but less extensible. Choose CBOR for standards compliance and extensibility; MessagePack for raw speed.
Is CBOR smaller than JSON?
Typically 20-50% smaller for the same data, depending on content. Strings and large integers benefit most. For data with many small integers or booleans, the savings are larger due to CBOR's compact integer encoding.

Workflows that solve this

Convert Ascii85 to Base64
Decode Ascii85 and re-encode as Base64 for wider compatibility.
PIPELINE
Convert Base2048 to Base64
Decode Base2048 (emoji) and re-encode as Base64 for standard transport.
PIPELINE
Convert Base32 to Base64
Decode a Base32-encoded string into raw bytes and re-encode as Base64 for more compact representation.
PIPELINE
Convert Base58 to Base64
Decode Base58 and re-encode as Base64 for standard compatibility.
PIPELINE
Base64 encode then decode round-trip
Encode text to Base64 and decode it back to verify the round-trip preserves the original data.
PIPELINE
Convert Base64 to Base85
Decode Base64 and re-encode as Base85 for compact representation.
PIPELINE
Convert Base64 to Hex
Decode a Base64 string into raw bytes and re-encode it as hexadecimal for inspection or interop.
PIPELINE
Blowfish Encrypt then Base64
Blowfish encrypt then Base64-encode for text-safe transport.
PIPELINE
Decode a Basic Auth credential pair
Decode the Base64 portion of an HTTP Basic Authorization header into username:password.
PIPELINE
DES Encrypt then Base64
DES encrypt then Base64-encode for legacy compatibility.
PIPELINE
Encode a JSON payload for URL transport
Prepare a JSON document for a URL parameter: pretty-print, Base64-encode, then percent-encode — the exact inverse of the nested-parameter decode chain.
PIPELINE
AES encrypt then Base64 encode
Encrypt plaintext with AES and encode the ciphertext as Base64 for text-safe transport.
PIPELINE
Hash content and encode as Base64
Compute a hash of the input and encode the hash digest as Base64 for compact transport.
PIPELINE
Convert Hex to Base64
Decode a hexadecimal string into raw bytes and re-encode it as Base64 for compact transport.
PIPELINE
HMAC Sign then Base64 Encode
Generate HMAC signature then Base64-encode for API auth headers.
PIPELINE
Morse Encode and Base64 Transport
Encode text as Morse code then Base64-encode for digital transport.
PIPELINE
Decode and format a JWT payload
Parse a JWT token, extract its payload, and format the JSON for inspection.
PIPELINE
RC4 Encrypt then Base64
RC4 encrypt then Base64-encode for transport.
PIPELINE
RIPEMD-160 Hash then Base64
Compute RIPEMD-160 hash then Base64-encode for transport.
PIPELINE
Shuffle Text and Base64 Encode
Shuffle text characters then Base64-encode the result.
PIPELINE
Unicode Escape and Base64 Encode
Unicode-escape text then Base64-encode for ASCII-safe transport.
PIPELINE
URL Encode then Base64 Double Encode
URL-encode then Base64-encode for double encoding in API payloads.
PIPELINE
Decode nested URL parameter (Base64 JSON)
Unwrap a URL parameter that carries URL-encoded Base64 JSON into readable, formatted JSON.
PIPELINE
UUencode then Base64
UUencode text then Base64-encode the result for double encoding.
PIPELINE
Generate UUID and Base64 Encode
Generate a UUID then Base64-encode it for compact storage.
PIPELINE

Learn more

Want to understand why?

Related tools