Developer Tools
BCD converter.
Convert decimal to binary-coded decimal and back, in packed (two digits per byte) or unpacked form, or add two BCD numbers digit by digit with the +6 correction. Runs in your browser.
Input
Result
Enter a value, then press Calculate.
How BCD works
- One digit, one nibble: every decimal digit 0 to 9 gets its own 4-bit group: 0 = 0000, 1 = 0001 ... 9 = 1001. The groups 1010 to 1111 never appear in valid BCD.
- Packed BCD: two digits per byte. 91 is
1001 0001, which reads as 0x91 in hex. - Unpacked BCD: one digit per byte with 0000 in the high half. 59 is
00000101 00001001. - Not the same as binary: 25 in plain binary is
11001; in packed BCD it is0010 0101. - Addition: add each digit pair in binary. If the 4-bit sum is above 9 (or carries out), add 0110 (6) to skip the six unused codes and carry 1 to the next digit.
Worked examples
| Decimal | Packed BCD | Unpacked BCD |
|---|---|---|
| 259 | 00000010 01011001 | 00000010 00000101 00001001 |
| 91 | 10010001 | 00001001 00000001 |
| 4096 | 01000000 10010110 | 00000100 00000000 00001001 00000110 |
8 + 5: 1000 + 0101 = 01101 (13, not a digit), add 0110 to get 0011 with a carry, so the answer is 13 = 0001 0011.
Where BCD is used
BCD avoids binary rounding when handling decimal quantities, so it shows up in digital clocks, calculators, seven-segment displays, financial hardware and legacy mainframe data. The x86 instruction set has packed BCD adjust instructions (DAA, DAS) for 32-bit code. For converting other bases see the Binary Converter; to compare a signed number format see two's complement.
Runs in your browser. Nothing is sent anywhere.
FAQ
What is BCD (binary-coded decimal)?
BCD stores each decimal digit as its own 4-bit binary group, so 259 becomes 0010 0101 1001 instead of the single binary number 100000011.
What is the difference between packed and unpacked BCD?
Packed BCD puts two digits in each byte. Unpacked BCD uses one byte per digit, with the high four bits set to 0000.
Why does BCD addition add 6?
A 4-bit group can hold 0 to 15 but BCD only uses 0 to 9. When a digit sum is above 9, adding 6 skips the six unused codes and produces the carry into the next digit.
Is 1010 a valid BCD digit?
No. The groups 1010 to 1111 (10 to 15) are not decimal digits, so this converter reports them as invalid and tells you which nibble it found.
Does BCD handle negative numbers or decimals?
Plain BCD does not. Real systems add a sign nibble or sign byte and track the decimal point separately; those conventions differ between platforms, so this tool converts non-negative whole numbers only.
Sources
Sources retrieved October 2026.