Binary Coded Decimal (BCD) encodes each decimal digit (0–9) individually as a 4-bit binary group, rather than converting the entire number to binary. The decimal number 39 in BCD is 0011 1001 — the digit 3 as 0011 followed by the digit 9 as 1001. BCD is used in digital clocks, financial calculators, and seven-segment displays where decimal digits must be processed individually.
Pure binary conversion of decimal numbers introduces decimal-to-binary rounding errors when working with values like 0.1 or 0.7. BCD avoids this by never leaving the decimal representation — each digit stays a digit throughout processing. Seven-segment LED displays drive segments from 4-bit BCD nibbles. Early pocket calculators and ATM hardware used BCD arithmetic for exact cent-level financial calculations.
Binary converts the entire number. BCD converts each decimal digit separately. Decimal 99 in binary is 1100011; in BCD it is 1001 1001 (two 4-bit groups: 9 and 9).
Excess-3 (XS-3) adds 3 to each decimal digit before encoding in 4-bit binary. So digit 0 becomes 3 (0011), digit 9 becomes 12 (1100). This makes 9's complement easier to compute for decimal subtraction circuits.
The 4-bit groups 1010 through 1111 (values 10–15) are illegal in BCD. They represent wasted bit patterns — an inherent inefficiency compared to pure binary encoding.
BCD appears in financial co-processors, smart card protocols (ISO 7816), telephony signalling (E.164 phone numbers in SS7), and the x86 BCD instruction set (DAA, DAS, AAA instructions).
See also Binary to Decimal, Hex to Binary, and the Gray Code converter.