TOP

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.

No signupFree online conversion

Interactive tool

Encode decimal digits as 8421 BCD

Ready

Mode and output format

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.

InputOutputMeaning
00000one decimal digit
401008421 weights
91001highest valid BCD digit
420100 0010two 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

Choose the converter for the exact direction and representation you need.

Advertisement

Sponsored link