Decimal to BCD Converter
Convert decimal numbers into standard 8421 Binary-Coded Decimal (BCD) online. Each decimal digit becomes a separate four-bit group. View the complete BCD code, digit-by-digit mapping, ordinary binary comparison, and step-by-step conversion details.
Convert Decimal to BCD
Enter a whole number using digits 0–9, then select Convert to BCD.
BCD Conversion Results
Each four-bit group represents one decimal digit in 8421 BCD.
8421 BCD Output
BCD Without Spaces
Digit-by-Digit Conversion
| Position | Decimal digit | 8421 BCD | Bit weights |
|---|
Ordinary Binary Comparison
This is the conventional base-2 representation of the complete integer. It is different from the BCD representation above.
Decimal to BCD Examples
Choose a number to see its 8421 BCD representation.
What Is Binary-Coded Decimal (BCD)?
Binary-Coded Decimal is a way of representing decimal numbers in binary form. In standard 8421 BCD, each decimal digit from 0 through 9 is encoded separately as a four-bit group. The four bit positions have weights 8, 4, 2 and 1.
For example, decimal 59 contains the digits 5 and 9. Digit 5 maps
to 0101, and digit 9 maps to 1001. Therefore,
the BCD representation is 0101 1001. The groups retain
the individual decimal digits instead of encoding the complete
number as one base-2 value. Learn more about BCD encoding.
How to Convert Decimal to BCD
- Write the decimal number as a sequence of individual digits.
- Find the four-bit 8421 BCD code for each digit.
- Keep the four-bit groups in the same order as the decimal digits.
- Join the groups, optionally separating them with spaces for readability.
For example, converting 847 to BCD works as follows:
- Digit 8 becomes
1000. - Digit 4 becomes
0100. - Digit 7 becomes
0111.
The final result is 1000 0100 0111.
8421 BCD Conversion Table
Use this reference table to look up the standard BCD code for each decimal digit.
| Decimal digit | 8 | 4 | 2 | 1 | 8421 BCD |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0000 |
| 1 | 0 | 0 | 0 | 1 | 0001 |
| 2 | 0 | 0 | 1 | 0 | 0010 |
| 3 | 0 | 0 | 1 | 1 | 0011 |
| 4 | 0 | 1 | 0 | 0 | 0100 |
| 5 | 0 | 1 | 0 | 1 | 0101 |
| 6 | 0 | 1 | 1 | 0 | 0110 |
| 7 | 0 | 1 | 1 | 1 | 0111 |
| 8 | 1 | 0 | 0 | 0 | 1000 |
| 9 | 1 | 0 | 0 | 1 | 1001 |
BCD vs Ordinary Binary
BCD and ordinary binary both use the digits 0 and 1, but they encode numbers differently. Ordinary binary converts the complete integer into base 2. BCD converts each decimal digit into its own four-bit code.
| Decimal | 8421 BCD | Ordinary binary |
|---|---|---|
| 9 | 1001 | 1001 |
| 12 | 0001 0010 | 1100 |
| 25 | 0010 0101 | 11001 |
| 59 | 0101 1001 | 111011 |
| 847 | 1000 0100 0111 | 1101001111 |
Where Is BCD Used?
- Digital clocks, counters and decimal displays.
- Digital electronics and educational logic-circuit exercises.
- Systems that represent decimal digits directly.
- BCD arithmetic and decimal-to-display conversion circuits.
Frequently Asked Questions
1. What does a decimal to BCD converter do?
It converts every decimal digit into a four-bit 8421 BCD group and joins the groups in their original order.
2. What is the BCD representation of 59?
Decimal 59 becomes 0101 1001: digit 5 is 0101 and digit 9 is 1001.
3. Is BCD the same as binary?
No. Decimal 59 is 111011 in ordinary binary and 0101 1001 in 8421 BCD.
4. Can I convert numbers with leading zeros?
Yes. The converter preserves leading zeros, so an input such as 0075 is encoded as 0000 0000 0111 0101.
5. What about decimal fractions or negative numbers?
This calculator handles non-negative whole numbers. Fractional values require a separate decimal-point convention, and signed BCD systems may use additional sign representations.
6. Which BCD codes are valid?
In standard 8421 BCD, only groups 0000 through 1001 represent decimal digits. The patterns 1010 through 1111 are invalid as individual 8421 BCD digits.
Related Binary Converters and Calculators
Continue exploring number systems and digital logic with these tools.
Visit the Binarios.org homepage to explore more tools, or read about the site on About Us.