Binary to BCD Converter
Convert a binary integer to 8421 BCD instantly. BinaryCon first finds the exact decimal value, then encodes every decimal digit separately as a 4-bit Binary Coded Decimal group with a clear conversion breakdown.
What Is a Binary to BCD Converter?
A binary to BCD converter changes an ordinary binary integer into Binary Coded Decimal. BCD does not encode the complete number as one normal binary magnitude. Instead, each decimal digit is represented independently using four binary bits.
This page uses the common 8421 BCD representation. The four bit positions have weights 8, 4, 2, and 1, allowing each decimal digit from 0 through 9 to have its own 4-bit code.
For example, decimal 45 contains two decimal digits: 4 and 5. In BCD,
digit 4 is 0100 and digit 5 is 0101.
Therefore decimal 45 becomes 0100 0101 in BCD.
When the starting value is binary, BinaryCon performs two logical stages. It first determines the exact decimal integer represented by the binary input. It then converts each digit of that decimal number into its corresponding 4-bit BCD group.
Ordinary binary
The whole number is represented using powers of two, such as 1, 2, 4, 8, 16, 32, and so forth.
BCD
Each decimal digit is encoded separately using exactly four bits in standard 8421 BCD.
How to Use the Binary to BCD Converter
Type or paste a binary value such as 101101. The calculator
accepts unsigned integers containing only 0 and 1.
BinaryCon determines the corresponding decimal integer without using floating-point rounding.
Every decimal digit is treated separately. For decimal 45, the relevant digits are 4 and 5.
Decimal digit 4 becomes 0100, while decimal digit 5 becomes
0101.
Use the grouped BCD result in electronics work, coursework, display-system calculations, or other number-code tasks.
8421 BCD Digit Table
Standard 8421 BCD needs only ten of the sixteen possible 4-bit binary combinations. Decimal digits 0 through 9 map as follows.
| Decimal Digit | 8421 BCD | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|
| 0 | 0000 | 0 | 0 | 0 | 0 |
| 1 | 0001 | 0 | 0 | 0 | 1 |
| 2 | 0010 | 0 | 0 | 1 | 0 |
| 3 | 0011 | 0 | 0 | 1 | 1 |
| 4 | 0100 | 0 | 1 | 0 | 0 |
| 5 | 0101 | 0 | 1 | 0 | 1 |
| 6 | 0110 | 0 | 1 | 1 | 0 |
| 7 | 0111 | 0 | 1 | 1 | 1 |
| 8 | 1000 | 1 | 0 | 0 | 0 |
| 9 | 1001 | 1 | 0 | 0 | 1 |
1010 through 1111 represent decimal values
10–15 in ordinary binary, but they are not valid individual decimal
digits in standard 8421 BCD.
Worked Example: Convert Binary 101101 to BCD
Binary 101101₂ does not become BCD by simply dividing it into 4-bit groups. We first need to identify its decimal value.
= 1×2⁵ + 0×2⁴ + 1×2³ + 1×2² + 0×2¹ + 1×2⁰
= 32 + 8 + 4 + 1
= 45₁₀ Step 2: Separate decimal 45 into digits 4 | 5 Step 3: Encode each digit as 8421 BCD 4 → 0100
5 → 0101 Final result 101101₂ → 0100 0101 BCD
Example: Convert Binary 11111111 to BCD
Binary 11111111 represents decimal 255.
Decimal 255 contains three digits: 2, 5, and 5.
Decimal: 255₁₀ BCD encoding: 2 → 0010
5 → 0101
5 → 0101 Therefore: 11111111₂ → 0010 0101 0101 BCD
Notice that this BCD result contains 12 bits because three decimal digits require three 4-bit BCD groups.
Binary vs BCD: Why the Bit Patterns Are Different
Ordinary binary represents the entire numeric magnitude efficiently. BCD represents decimal digits individually. As a result, the bit pattern and often the number of bits required are different.
| Decimal | Ordinary Binary | 8421 BCD |
|---|---|---|
| 5 | 101 | 0101 |
| 9 | 1001 | 1001 |
| 10 | 1010 | 0001 0000 |
| 12 | 1100 | 0001 0010 |
| 25 | 11001 | 0010 0101 |
| 45 | 101101 | 0100 0101 |
| 99 | 1100011 | 1001 1001 |
| 255 | 11111111 | 0010 0101 0101 |
Why You Cannot Just Group the Binary Number Into 4 Bits
A common mistake is to assume that because BCD uses 4-bit groups, the original binary number can simply be divided into groups of four. That is not how BCD works.
Consider binary 1010. As an ordinary binary integer,
this represents decimal 10.
If someone incorrectly treats 1010 as one BCD group,
it would represent an invalid BCD digit because valid 8421 BCD digits
range only from 0000 through 1001.
Decimal digits: 1 and 0
1 → 0001
0 → 0000
BCD = 0001 0000
Valid and Invalid 8421 BCD Codes
Four bits can form sixteen different patterns, but a decimal digit has only ten possible values. Standard BCD therefore uses ten patterns and leaves six combinations unused for normal decimal digits.
| BCD Pattern | Status | Meaning |
|---|---|---|
0000 – 1001 | Valid | Decimal digits 0–9 |
1010 | Invalid digit | Unused in standard 8421 BCD |
1011 | Invalid digit | Unused in standard 8421 BCD |
1100 | Invalid digit | Unused in standard 8421 BCD |
1101 | Invalid digit | Unused in standard 8421 BCD |
1110 | Invalid digit | Unused in standard 8421 BCD |
1111 | Invalid digit | Unused in standard 8421 BCD |
Binary to BCD Reference Examples
These examples show the full relationship between binary input, decimal value, and 8421 BCD output.
| Binary Input | Decimal | BCD |
|---|---|---|
0 | 0 | 0000 |
1 | 1 | 0001 |
101 | 5 | 0101 |
1001 | 9 | 1001 |
1010 | 10 | 0001 0000 |
1111 | 15 | 0001 0101 |
10000 | 16 | 0001 0110 |
11001 | 25 | 0010 0101 |
101101 | 45 | 0100 0101 |
1100011 | 99 | 1001 1001 |
1100100 | 100 | 0001 0000 0000 |
11111111 | 255 | 0010 0101 0101 |
10000000000 | 1024 | 0001 0000 0010 0100 |
How Many Bits Does BCD Need?
Standard 8421 BCD always requires four bits for each decimal digit. Therefore, if the decimal representation contains n digits, its unpacked BCD representation requires 4 × n bits.
| Decimal Example | Decimal Digits | BCD Bits |
|---|---|---|
| 7 | 1 | 4 |
| 45 | 2 | 8 |
| 255 | 3 | 12 |
| 1024 | 4 | 16 |
| 123456 | 6 | 24 |
This is one reason BCD is generally less space-efficient than ordinary binary. Its advantage is that decimal digits remain directly accessible rather than being encoded as one compact binary magnitude.
What Happens to Leading Zeros in the Binary Input?
Leading zeros do not change the numerical value of an unsigned binary
integer. Therefore 1010, 01010, and
00001010 all represent decimal 10.
Because this converter produces BCD from the numeric decimal value, all of these binary inputs produce:
BCD = 0001 0000
If a specific application requires a fixed number of leading decimal digits—for example, displaying 0010 instead of 10—that is a formatting requirement separate from converting the numeric value itself.
Where Binary Coded Decimal Is Used
Decimal displays
BCD is convenient when individual decimal digits must be sent to display or digit-processing circuitry.
Digital electronics
Counters, encoders, decoders, calculators, and educational logic circuits often demonstrate or use BCD representations.
Decimal-oriented systems
Some systems benefit from keeping decimal digits individually encoded instead of repeatedly converting from a pure binary value.
Computer science education
BCD helps demonstrate the difference between representing a numeric value in binary and encoding individual decimal symbols.
Is BCD More Efficient Than Ordinary Binary?
Usually no. Ordinary binary generally stores an integer using fewer bits because every available bit pattern contributes to the numeric range. Standard BCD reserves four bits for every decimal digit but uses only ten of the sixteen possible 4-bit combinations.
Decimal 99 provides a simple comparison:
9 → 1001
Result = 1001 1001 BCD uses 8 bits for the same decimal quantity.
BCD trades some storage efficiency for a representation that aligns directly with decimal digits.
Common Binary to BCD Conversion Mistakes
BCD groups represent decimal digits. First determine the decimal number, then encode each of its digits separately.
Standard 8421 BCD has valid digit codes only from
0000 through 1001.
Every decimal digit requires four bits. Decimal 2 must be written
0010, not simply 10.
BCD 0010 0101 represents decimal 25 because its groups
encode digits 2 and 5. Reading all eight bits as ordinary binary would
produce a different interpretation.
Related BinaryCon Tools
Continue working with binary values, decimal conversion, digital codes, and bit representations using these related converters.
Binary to BCD Converter FAQs
How do you convert binary to BCD?
First convert the binary integer to its decimal value. Then separate
that decimal number into individual digits and replace each digit with
its four-bit 8421 BCD code. For example, binary 101101 is decimal 45,
so digit 4 becomes 0100 and digit 5 becomes 0101. The final BCD is
0100 0101.
What is binary 1010 in BCD?
Binary 1010₂ equals decimal 10. Decimal 10 contains
digits 1 and 0. Digit 1 is BCD 0001 and digit 0 is
0000. Therefore the BCD result is
0001 0000.
What is binary 101101 in BCD?
Binary 101101 equals decimal 45. Decimal digit 4 maps
to 0100 and digit 5 maps to 0101.
Therefore 101101₂ = 0100 0101 in 8421 BCD.
What is binary 11111111 in BCD?
Binary 11111111 equals decimal 255. Encode each decimal
digit separately: 2 → 0010, 5 → 0101,
and 5 → 0101. The BCD result is
0010 0101 0101.
What does BCD stand for?
BCD stands for Binary Coded Decimal. It is a coding method in which every decimal digit is represented independently by a binary pattern. In the common 8421 form, each decimal digit requires four bits.
Why is decimal 10 written as 0001 0000 in BCD?
BCD encodes decimal digits rather than the complete numeric magnitude.
Decimal 10 consists of digit 1 followed by digit 0. BCD 0001 encodes
digit 1 and 0000 encodes digit 0, producing 0001 0000.
Ordinary binary 1010 represents the same numerical quantity in a
different encoding.
Is 1010 a valid BCD digit?
No, not in standard 8421 BCD. Individual valid BCD digit groups range from 0000 for decimal 0 through 1001 for decimal 9. Patterns 1010 through 1111 are not valid decimal-digit codes in standard BCD.
Is BCD the same as binary?
No. Ordinary binary represents the whole integer using powers of two.
BCD represents each decimal digit independently. For example, decimal
25 is ordinary binary 11001, while its BCD representation
is 0010 0101.
Why does every BCD decimal digit use four bits?
Three bits provide only eight possible patterns, which is not enough to represent all ten decimal digits. Four bits provide sixteen patterns. Standard 8421 BCD uses ten of them for digits 0 through 9 and leaves six combinations unused as normal digits.
What does 8421 mean in BCD?
The name 8421 describes the positional weights of the four bits:
8, 4, 2, and 1. For example, BCD 0101 has the 4 and
1 positions active, giving decimal digit 5.
Does BCD preserve leading zeros?
BCD can represent leading decimal zeros when a fixed-width decimal field requires them. However, this Binary-to-BCD converter first interprets the input as a numeric binary integer, so insignificant leading zeros in the original binary input do not create additional decimal digits.
Can the calculator handle very large binary integers?
Yes. The binary-to-decimal stage uses JavaScript BigInt rather than an ordinary floating-point Number. The exact decimal integer can therefore be converted into decimal digits and BCD groups without the normal safe-integer rounding problem associated with large numeric values.
Does this converter support negative binary numbers?
This calculator treats the entered binary value as an unsigned non-negative integer. Signed binary formats such as two’s complement require an explicit bit width and signed interpretation before the magnitude can be converted to a decimal-digit representation.
Is BCD used because it is smaller than binary?
Usually not. BCD is generally less storage-efficient than pure binary. Its benefit is that decimal digits remain individually represented, which can simplify some decimal displays, decimal-oriented circuits, and applications where exact decimal digit handling is important.
Convert Binary to BCD Instantly
Use BinaryCon for accurate binary-to-BCD conversion, exact decimal interpretation, digit-by-digit 8421 encoding, verified examples, and free number-system tools whenever you need them.