Decimal to BCD Converter
Convert decimal numbers to 8421 Binary Coded Decimal instantly. Enter a non-negative whole number and BinaryCon will encode every decimal digit separately into its exact 4-bit BCD representation.
What Is a Decimal to BCD Converter?
A decimal to BCD converter changes an ordinary decimal integer into Binary Coded Decimal. In standard 8421 BCD, every decimal digit is represented independently with four binary bits.
This differs from ordinary binary conversion. Decimal 45 in pure binary is
101101, but its BCD representation is
0100 0101 because decimal digit 4 is encoded separately from
decimal digit 5.
BCD is useful when a system needs direct access to individual decimal digits, such as in display logic, decimal-oriented electronics, counters, educational circuits, or decimal data processing.
Ordinary binary
Represents the complete number as a single magnitude using powers of two.
8421 BCD
Represents every decimal digit separately with one 4-bit group.
How to Use the Decimal to BCD Converter
Type a value such as 45. Use non-negative whole numbers only.
Decimal 45 contains two digits: 4 and 5. Decimal 255 contains three digits: 2, 5, and 5.
BinaryCon replaces each decimal digit with the corresponding 4-bit 8421 BCD group.
The result card shows the final BCD code and a digit-by-digit conversion breakdown.
Use the grouped output in digital logic, coursework, electronics, documentation, or another BinaryCon tool.
8421 BCD Code Table
Standard 8421 BCD uses four bit positions with weights 8, 4, 2, and 1. Only ten of the sixteen possible 4-bit patterns are used for decimal digits.
| 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 |
Worked Example: Convert Decimal 45 to BCD
Decimal 45 contains two separate decimal digits: 4 and 5.
5 → 0101 Join the BCD groups: 45₁₀ → 0100 0101 BCD
Example: Convert Decimal 255 to BCD
5 → 0101
5 → 0101 Final BCD: 255₁₀ → 0010 0101 0101
Since the decimal number has three digits, it requires three 4-bit BCD groups, or 12 BCD bits.
Decimal to BCD Reference Table
| Decimal | 8421 BCD | BCD Bits |
|---|---|---|
| 0 | 0000 | 4 |
| 5 | 0101 | 4 |
| 9 | 1001 | 4 |
| 10 | 0001 0000 | 8 |
| 12 | 0001 0010 | 8 |
| 25 | 0010 0101 | 8 |
| 45 | 0100 0101 | 8 |
| 99 | 1001 1001 | 8 |
| 100 | 0001 0000 0000 | 12 |
| 255 | 0010 0101 0101 | 12 |
| 999 | 1001 1001 1001 | 12 |
| 1024 | 0001 0000 0010 0100 | 16 |
Why Decimal 10 Is 0001 0000 in BCD
A common mistake is to see ordinary binary 1010 for decimal 10
and assume that it is also the BCD value. It is not.
BCD works with decimal digits. Decimal 10 contains the digit 1 followed by the digit 0.
Digit 1 → 0001
Digit 0 → 0000
BCD → 0001 0000
BCD vs Ordinary Binary
| Decimal | Ordinary Binary | 8421 BCD |
|---|---|---|
| 5 | 101 | 0101 |
| 9 | 1001 | 1001 |
| 10 | 1010 | 0001 0000 |
| 15 | 1111 | 0001 0101 |
| 25 | 11001 | 0010 0101 |
| 45 | 101101 | 0100 0101 |
| 99 | 1100011 | 1001 1001 |
| 255 | 11111111 | 0010 0101 0101 |
How Many Bits Does BCD Require?
Standard unpacked 8421 BCD uses exactly four bits for every decimal digit. If a decimal number contains n digits, its BCD representation requires:
| Decimal | Digits | BCD Bits |
|---|---|---|
| 7 | 1 | 4 |
| 45 | 2 | 8 |
| 255 | 3 | 12 |
| 1024 | 4 | 16 |
| 12345 | 5 | 20 |
Why Are 1010 Through 1111 Invalid BCD Digits?
Four binary bits can represent sixteen patterns, but decimal has only ten digits. Standard 8421 BCD therefore needs only codes for decimal digits 0 through 9.
| 4-Bit Pattern | BCD Status |
|---|---|
0000–1001 | Valid decimal digits 0–9 |
1010 | Invalid standard BCD digit |
1011 | Invalid standard BCD digit |
1100 | Invalid standard BCD digit |
1101 | Invalid standard BCD digit |
1110 | Invalid standard BCD digit |
1111 | Invalid standard BCD digit |
What Does 8421 Mean in BCD?
The name 8421 refers to the positional weights of the four bits: 8, 4, 2, and 1.
For example, digit 7 has BCD pattern 0111:
Digit 9 is 1001 because 8 + 1 = 9.
What About Leading Zeros?
A numeric decimal value normally ignores unnecessary leading zeros.
For example, entering 0045 and 45 represents
the same ordinary integer.
This calculator normalizes ordinary numeric input, so both produce:
If you specifically need BCD for a fixed decimal field such as
0045, that is a formatting requirement where the leading
decimal zeros would each be encoded as 0000.
Is BCD More Efficient Than Binary?
Generally, no. Pure binary uses available bit patterns more efficiently, while BCD dedicates four bits to every decimal digit and leaves six combinations unused in each digit position.
For decimal 255:
5 → 0101
5 → 0101 Result: 0010 0101 0101 This uses 12 bits.
BCD’s advantage is therefore not compact storage. Its advantage is the direct correspondence between stored groups and decimal digits.
Where Decimal to BCD Conversion Is Used
Digital displays
Digit-oriented systems can use BCD so every decimal digit is available as a separate encoded value.
Electronic counters
Decimal counters and BCD counters naturally work with values 0 through 9 before moving to the next decimal position.
Logic circuit education
BCD is commonly used to teach decoders, counters, digital number representations, and display-driving logic.
Decimal-oriented data
Some applications benefit from keeping decimal digits explicit instead of repeatedly converting a pure binary magnitude.
Common Decimal to BCD Conversion Mistakes
Pure binary and BCD are different. BCD requires converting each decimal digit separately.
Each digit always needs four bits. Decimal 2 must be written
0010, not 10.
Standard 8421 BCD uses only 0000 through
1001 for individual digits.
BCD groups must be interpreted digit by digit. For example,
0100 0101 represents decimal 45 in BCD.
Related BinaryCon Tools
Convert between BCD, binary, decimal, and other common number systems using these related tools.
Decimal to BCD Converter FAQs
How do you convert decimal to BCD?
Separate the decimal number into individual digits and replace each digit
with its 4-bit 8421 BCD code. For example, decimal 45 contains digits
4 and 5, so it becomes 0100 0101.
What is decimal 9 in BCD?
Decimal digit 9 is 1001 in 8421 BCD because its active weights are 8 and 1.
What is decimal 10 in BCD?
Decimal 10 contains digits 1 and 0. Digit 1 is 0001
and digit 0 is 0000, so decimal 10 becomes
0001 0000 in BCD.
What is decimal 45 in BCD?
Decimal 45 becomes 0100 0101. Digit 4 maps to
0100 and digit 5 maps to 0101.
What is decimal 255 in BCD?
Decimal 255 contains digits 2, 5, and 5. Their BCD codes are
0010, 0101, and 0101.
The final result is 0010 0101 0101.
Is BCD the same as binary?
No. Ordinary binary represents the entire numerical value using powers
of two. BCD represents each decimal digit separately. Decimal 25 is
11001 in ordinary binary but
0010 0101 in BCD.
Why does BCD use four bits for one decimal digit?
Three bits provide only eight combinations, which is not enough for ten decimal digits. Four bits provide sixteen combinations, so ten can be assigned to digits 0 through 9.
What are the invalid BCD codes?
In standard 8421 BCD, individual digit patterns
1010, 1011, 1100,
1101, 1110, and 1111
are not valid decimal digit codes.
What does 8421 BCD mean?
The four bit positions have weights 8, 4, 2, and 1. For example,
0110 represents decimal digit 6 because 4 + 2 = 6.
How many BCD bits does a number need?
Standard unpacked 8421 BCD uses four bits per decimal digit. A two-digit decimal number uses 8 bits, a three-digit number uses 12 bits, and a four-digit number uses 16 bits.
Can this converter handle very large decimal integers?
Yes. BCD encoding works directly from the decimal digit characters, so very long non-negative whole numbers can be encoded without floating-point rounding.
Does BCD support decimal fractions?
BCD can represent decimal digits on either side of a decimal point, but this calculator is designed for whole-number integers. Fractional BCD requires preserving the decimal-point position separately because the point itself is not one of the four-bit digit codes.
Can BCD represent negative numbers?
The decimal digits themselves can be encoded in BCD, but representing sign requires an additional convention, sign field, or packed-decimal format. This calculator handles non-negative decimal integer digits only.
Why is BCD still useful if binary is more compact?
BCD preserves decimal digits directly. That can simplify decimal displays, decimal counters, certain arithmetic systems, and applications where digit-by-digit decimal handling is more useful than minimum bit usage.
Convert Decimal to BCD Instantly
Use BinaryCon for accurate 8421 BCD encoding, digit-by-digit conversion, verified reference values, and practical decimal and binary tools without registration.