Tools

Home
Text to BinaryBase64 Encode/DecodeHash GeneratorUTF-8 Encode/DecodeURL Encode/Decode

Decimal to BCD Converter

Convert decimal numbers to BCD (Binary Coded Decimal) online. Each decimal digit becomes a 4-bit binary nibble.

Your files never leave your browser
INPUT (DECIMAL NUMBERS)0 numbers
OUTPUT (BCD)0 results
Ready·Decimal to BCD

Paste decimal numbers and each digit becomes its own 4-bit BCD nibble — 42 turns into 0100 0010, 9075 turns into 1001 0000 0111 0101. Flip to hex packed BCD when you need the compact byte form (0x42) that real-time clock chips and seven-segment drivers actually store. And everything runs in your browser. Nothing gets uploaded.

How to Use

Enter decimal numbers in the left panel. You can type one per line, or separate them with spaces or commas. Click Sample for example data.

Choose an output format -- binary nibbles (e.g. 0100 0010) or hex packed BCD (e.g. 0x42). Optionally change the nibble separator.

Click Convert or leave Live mode enabled for real-time conversion as you type.

Copy, Download, or Swap the result. Swap puts the BCD output back into the input for reverse conversion.

Frequently Asked Questions

What is BCD (Binary Coded Decimal)?

BCD is a class of binary encoding where each decimal digit (0-9) is represented by a fixed number of binary bits, typically four (a nibble). For example, the decimal number 42 is encoded as 0100 0010 in BCD -- the digit 4 becomes 0100 and the digit 2 becomes 0010. Unlike standard binary, BCD does not convert the entire number as a single value; it encodes each digit independently.

How does BCD differ from standard binary?

In standard binary, the number 42 is represented as 101010 (a single 6-bit value). In BCD, 42 is represented as 0100 0010 (two 4-bit nibbles, one per digit). BCD is less space-efficient but preserves the decimal structure, making it easier to display individual digits directly. This is why BCD is commonly used in clocks, calculators, and financial systems.

What is packed BCD in hex format?

Packed BCD stores two decimal digits in a single byte. When displayed in hexadecimal, the hex digits happen to match the original decimal digits. For example, decimal 42 in packed BCD is byte 0x42, and decimal 90 is 0x90. This is because each hex digit corresponds to one BCD nibble. The hex output option shows this compact packed representation.

What happens with odd numbers of digits?

When a decimal number has an odd number of digits (e.g. 5 or 123), the tool pads the most significant nibble with a leading zero to form a complete byte in packed BCD. For example, the digit 5 becomes 0x05 in hex packed BCD, and 123 becomes 0x01 0x23. In binary nibble mode, each digit is always shown as a 4-bit group regardless.

Where is BCD used in practice?

BCD is widely used in digital clocks and watches, calculators, financial systems that require exact decimal precision, seven-segment display drivers, embedded systems, BIOS real-time clocks, and legacy mainframe computing. It avoids floating-point rounding errors that can occur when representing decimal values in pure binary, making it ideal for applications requiring exact decimal arithmetic.

Share: