9
0

CBOR Encode

Egor VolchenkoEgor Volchenko
CreatedNov 30, 2026
UpdatedNov 30, 2026

This CBOR encoder converts valid JSON into Concise Binary Object Representation and displays the resulting bytes as Base64. Use it to prepare a small serialized test payload. The current form accepts JSON text; it has no diagnostic-notation mode, file upload, or Hex-output selector.

1
1

How to use CBOR Encode

Use the following steps to process a small test input.

Convert JSON to CBOR bytes

  1. Paste one JSON value into Input text. Use double quotes for object keys and strings.
  2. Set Input Encoding: to UTF-8 for JSON text. Choose Hex or Base64 only when the JSON text itself is already encoded that way.
  3. Leave Auto / Live on to update the result as you edit. To run manually, turn it off and click Run.
  4. Read CBOR Encode Result as Base64. The value represents CBOR bytes, not JSON text encoded directly as Base64.
  5. Click Copy to copy the result. Use Clear where shown, or the field clear controls, to remove the text.

JSON input [1,2,3] returns gwECAw==. Decoding that Base64 gives CBOR bytes 83010203.

A rejected request may leave an earlier result visible. Clear the fields and recheck the input before relying on a new calculation.

Keep JSON syntax separate from CBOR notation

Objects, arrays, strings, numbers, booleans, and null can be supplied as JSON. CBOR diagnostic notation and JavaScript object syntax are different languages and are not accepted as alternative input modes.

Compare decoded values as well as bytes

CBOR allows several encodings for some values. This form has no canonical-encoding option, map-sorting control, or tag editor. A different valid encoder can produce different bytes for an equivalent value.

Frequently asked questions

It requires valid JSON after the selected input encoding is applied. Diagnostic notation is not an available input mode.

API — JSON to CBOR Converter

Automate this tool directly from your scripts, CI/CD pipelines, or backend applications via HTTP POST.

No API Key Required 60 req/min
https://million.tools/api/v1/run/cbor-encode

Request Parameters (JSON / Form Data)

  • start (or input)

    Input text

    Type: string Default: —
  • input_encoding

    Input Encoding

    hex hex_ignore_non_hex base64 utf-8 utf-16le utf-16be windows-1251 windows-1252
    Type: string Default: utf-8
bash — cURL
curl -X POST https://million.tools/api/v1/run/cbor-encode \
  -H "Content-Type: application/json" \
  -d '{"start":"[1,2,3]"}'
const response = await fetch('https://million.tools/api/v1/run/cbor-encode', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "start": "[1,2,3]"
  }),
});

const data = await response.json();
console.log(data.result);
import requests

response = requests.post(
    'https://million.tools/api/v1/run/cbor-encode',
    json={
        "start": "[1,2,3]",
    },
    timeout=15,
)

data = response.json()
print(data['result'])
$ch = curl_init('https://million.tools/api/v1/run/cbor-encode');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'start' => '[1,2,3]',
    ]),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);

echo $response['result'] ?? '';
{
    "status": "success",
    "tool": "cbor-encode",
    "service": "cbor_encode",
    "result": "gwECAw==",
    "results": {
        "result": "gwECAw=="
    }
}
Egor Volchenko
Egor Volchenko Developer & Author

Hi! I’m a WordPress developer with over 10 years of experience. I love Tailwind CSS, clean code, and intuitive interfaces. I’m currently working on million.tools — a service with convenient online tools for everyday tasks. I’m building it from scratch with great attention to detail and user experience.

Published:
Updated:

Ratings & feedback 0

Share your experience with this tool.

Leave feedback

Your rating (optional)

Select a rating

Write a review, leave a rating, or do both.

Your email stays private.

No feedback yet

Be the first to leave a review or rating.