New to Rust? Grab our free Rust for Beginners eBook Get it free →
Online Decimal to BCD Converter

When you are learning how decimal digits become bits, it helps to see how each digit is encoded on its own. The Online Decimal to BCD Converter turns each digit into a four-bit BCD group.
I’ll explain what those groups mean and show how to use the converter to check a result.
TL;DR
BCD converts each decimal digit into its own four-bit group, so 45 becomes 0100 0101. Enter a non-negative whole number in the converter and read each group in the same digit order.
- Standard binary treats the whole number as one value, while BCD keeps each digit in its own group.
- Each standard 8421 BCD group represents one digit from 0 to 9.
- This page’s tool accepts digit strings only, including leading zeroes.
What Is Binary-Coded Decimal?
Binary-coded decimal, or BCD, stores a decimal number as a sequence of four-bit groups, with one group for each decimal digit. The common 8421 form uses bit weights 8, 4, 2 and 1.
For instance, 0110 represents 6 because its 4 and 2 positions are set. Groups 1010 through 1111 are not standard digit codes, so check each group against the digit table. The next table compares BCD with standard binary for three values.
| Decimal | Standard binary | 8421 BCD |
|---|---|---|
| 7 | 111 | 0111 |
| 45 | 101101 | 0100 0101 |
| 259 | 100000011 | 0010 0101 1001 |
The table shows that 45 takes six bits as a binary value, while BCD uses two four-bit groups. The direct digit mapping suits displays.
How to Convert a Decimal Integer to BCD
For each digit, look up its four-bit 8421 code. I use the converter here because it returns the groups in the original order.
Step 1: Enter the decimal digits
Type or paste a non-negative whole number into the Decimal Input field. For instance, use 259 to see three separate groups. The page tool checks for digits and trims whitespace around the entry.
Step 2: Map each digit to BCD
Click Convert to BCD. For 259, the result is 0010 0101 1001. Check each group against the corresponding input digit.
The zero digit maps to 0000, preserving its position. A value such as 205 therefore has three groups.
Step 3: Verify the digit groups
Check that each output group matches its digit and that the order has not changed. This catches a whole-number binary result being mistaken for BCD.
Copy the output for your notes or circuit input. Use Clear All before entering another value so the next result is tied to the new input.
Common Input Errors and BCD Edge Cases
| Input or result | What to expect | How to handle it |
|---|---|---|
| 0009 | Four groups, including leading zeroes | Keep the text form when the width matters |
| -9 | Rejected by the digit-only check | Use a separately defined signed BCD convention |
| 9.5 | Rejected by the digit-only check | Choose a decimal-point position and encoding before conversion |
| 1,000 | Comma is not a digit, so the entry is rejected | Enter 1000 without separators |
| 1010 nibble | Invalid as a standard BCD digit | Check for a wrong group boundary or a different encoding |
For fixed-width displays or protocols, preserve the text form so the leading zeroes remain visible.
Signed and fractional values need their own representation rule, such as a sign convention or decimal-point position. This converter accepts digit strings for non-negative integers. Other BCD formats can support more.
Standard 8421 BCD treats groups 1010 through 1111 as invalid digit values. Some extended schemes assign them special meanings, so use them only when the format specification defines that behavior.
Conclusion
Keep the groups in their original order when reading the result. For the reverse operation, use the CodeForGeek BCD to Decimal Converter. For a related digit encoding, see the Decimal to Gray Code Converter.
FAQ
These answers cover common BCD questions.
How do you convert decimal to BCD?
Convert every decimal digit separately to its four-bit 8421 code and keep the groups in the original order.
Is BCD the same as standard binary?
No. Standard binary encodes the whole number as one value, while BCD gives each decimal digit its own four-bit group.
Can this converter handle negative numbers or decimal points?
No. Its input check accepts digit strings only. Signed and fractional BCD require a format rule that this tool does not provide.
What do leading zeroes mean in BCD?
Each leading zero remains a 0000 group, preserving the input digit count when the converter receives it as text.




