Free browser converter
Decimal to BCD Converter
Encode every decimal digit independently as a four-bit 8421 BCD group. Leading zeros remain data instead of disappearing as numeric padding.
Interactive tool
Encode decimal digits as 8421 BCD
Ready
Choose the exact data representation; the tool never guesses an encoding.
Detailed conversion guide
How to Convert Decimal Digits to BCD
8421 BCD encodes each decimal digit separately in four bits. The decimal string 42 becomes 0100 0010, not the ordinary binary integer 101010.
Because digits are encoded independently, 042 becomes 0000 0100 0010. Preserving that leading zero matters for identifiers and fixed-width displays.
| Input | Output | Meaning |
|---|---|---|
0 | 0000 | one decimal digit |
4 | 0100 | 8421 weights |
9 | 1001 | highest valid BCD digit |
42 | 0100 0010 | two BCD digits |
Decimal Digits to 8421 BCD
Map each validated decimal character to a four-bit binary group. Do not convert the entire decimal string as one base-10 integer.
const bcd = [...digits].map((digit) =>
Number(digit).toString(2).padStart(4, "0")
).join(" ");BCD Is Digit Encoding, Not Ordinary Binary
This page implements unsigned 8421 BCD digit encoding. It does not add sign nibbles, decimal-point metadata, packed-byte storage, or vendor-specific zoned decimal formats.
Each source character must be a decimal digit 0 through 9. Leading zeros are intentionally preserved, while signs and fractions are rejected.
Related converters
Continue with related data converters
Choose the converter for the exact direction and representation you need.