AZ Tools

BCD Converter (Binary-Coded Decimal)

Convert

Binary-coded decimal (BCD) encodes each decimal digit in its own 4-bit group instead of converting the whole number to binary. The number 2026 becomes 0010 0000 0010 0110 — one nibble per digit. BCD keeps the decimal digits visible, which is why it shows up in seven-segment displays, real-time clock chips, calculators and financial hardware where exact decimal rounding matters. The cost is wasted bit space and the fact that nibble values 1010-1111 are illegal. This tool converts a decimal number into its 8421 BCD bit pattern and packed-BCD hex bytes, and converts a BCD bit string back to decimal, rejecting any nibble above 9.

Decimal
2026
BCD (8421)
0010 0000 0010 0110
Packed BCD (hex)
20 26
20010
00000
20010
60110

BCD encodes each decimal digit in its own 4 bits (8421). Nibbles 1010-1111 are illegal. Packed BCD stores two digits per byte.

How to use

  1. Choose whether your input is a decimal number or a BCD bit string.
  2. Type the value; the decimal, BCD binary and packed-BCD hex update instantly.
  3. Each decimal digit is shown with its 4-bit nibble below the result rows.

Frequently asked questions

How is BCD different from plain binary?
Plain binary converts the whole number at once (2026 = 11111101010). BCD encodes each decimal digit separately in 4 bits (2 0 2 6 = 0010 0000 0010 0110), so the decimal digits stay readable.
What is packed BCD?
Packed BCD stores two decimal digits per byte — one digit in the high nibble, one in the low. So 2026 packs into the hex bytes 20 26. It is the common storage form in RTC chips and older CPUs.
Why is 1010 not valid BCD?
A nibble can only represent decimal digits 0-9 (0000-1001). The patterns 1010 through 1111 (10-15) have no decimal digit, so they are invalid in standard 8421 BCD.
Where is BCD used?
Seven-segment LED displays, real-time clock and calendar chips, pocket calculators, and any system that must show or round numbers in exact decimal without binary fraction error.

Related tools