Binary-coded decimal (BCD) represents a decimal number by encoding each decimal digit separately in binary. In common four-bit BCD, the digits 0 through 9 map to 0000 through 1001. For example, decimal 59 is 0101 1001 in BCD—not the ordinary binary integer representation 00111011.
What does BCD mean?
BCD stands for binary-coded decimal. It is a way of representing decimal numbers in which each decimal digit gets its own binary code. The digit boundaries remain visible in the encoded value, unlike an ordinary binary integer, which represents the whole number as one value.
In the common natural BCD mapping, each digit uses four bits, also called a nibble:
| Decimal digit | Four-bit BCD |
|---|---|
| 0 | 0000 |
| 1 | 0001 |
| 2 | 0010 |
| 3 | 0011 |
| 4 | 0100 |
| 5 | 0101 |
| 6 | 0110 |
| 7 | 0111 |
| 8 | 1000 |
| 9 | 1001 |
The six remaining four-bit patterns, from 1010 through 1111, are not decimal digits in this mapping. A particular format may assign some of them special meanings, so their interpretation depends on that format.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →#1 Best Overall
- Used Book in Good Condition
How do you write a number in BCD?
Convert each decimal digit independently to its four-bit code, then place the groups in the same order as the original digits. For decimal 59:
- Convert the digit 5 to
0101. - Convert the digit 9 to
1001. - Join the digit groups:
0101 1001.
That result is BCD for 59. By contrast, 00111011 is 59 written as an ordinary binary integer. The two bit strings represent the same decimal quantity under different encoding rules; splitting BCD into four-bit groups recovers its decimal digits directly.
What is the difference between packed and unpacked BCD?
“Packed” and “unpacked” describe how BCD digits are laid out in storage, not a different rule for converting a decimal digit to BCD. Intel’s architecture manual describes these layouts as follows:
| Layout | Digits per storage unit | Description |
|---|---|---|
| Packed BCD | Two digits per byte | Each digit occupies one half-byte; the high half-byte holds the more significant of the two digits. |
| Unpacked BCD | One digit per byte | The low four bits carry the digit value in the Intel description. |
These are layouts documented for the Intel architecture; other formats or implementations may define additional details. Intel also describes a specialized 80-bit packed decimal integer format, which is one architecture-specific form rather than the definition of all BCD.
Rank #3
- Used Book in Good Condition
How does signed BCD work?
Unsigned four-bit BCD represents digits from 0 to 9; representing a signed number requires a format that specifies how the sign is stored. There is no single sign convention implied by the basic BCD digit mapping.
For example, IBM’s Open XL C/C++ documentation describes BCD built-ins in which digit and sign fields use four bits, with digits in contiguous arrays and a sign nibble at the end. It lists accepted sign codes and describes behavior for IBM processor targets. Those sign codes and rules belong to that IBM implementation; do not assume they apply to every BCD format. See IBM’s BCD built-in documentation.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.How is BCD different from ordinary binary?
Ordinary binary represents the entire integer using base-two place values. BCD instead gives each decimal digit its own code. This makes decimal digit positions directly readable in BCD, while straightforward four-bit-per-digit BCD uses more bits for many values than ordinary binary representation.
BCD’s direct digit structure can be useful when a system needs to retain decimal digits as digits, but storage and performance trade-offs depend on the system and the format. The available sources do not establish a universal speed comparison or say that one representation is always preferable.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Best Value
Are there more compact BCD encodings?
Yes. Straightforward four-bit BCD spends four bits on each decimal digit, but other encodings can store decimal digits more densely. IBM Research describes Chen–Ho encoding as a lossless method for encoding three BCD digits in 10 bits. It is a compression technique related to BCD, not the basic four-bit-per-digit mapping. IBM Research also notes an improvement that is not limited to groups of three digits. See IBM Research’s page for M. F. Cowlishaw’s paper, published May 1, 2002.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




