8421 packed BCD
2 digits per byte (83 → 0x83). Correction: +0110 for digit sums above 9. Used by the x86 DAA instruction.
Add numbers in 8421 BCD, digit by digit, with every +6 (0110) correction shown.
Enter your values below to get started.
Pick BCD bits to type nibbles such as 0100 0101; spaces are optional.
A nibble above 1001 is rejected: 1010 to 1111 are not BCD digits.
Open Nibble view to see the binary sum, the correction and the result for each digit.
The Packed BCD row shows the bytes in hex: 83 decimal is stored as 0x83.
A BCD sum calculator adds 2 numbers in binary-coded decimal (BCD), where each decimal digit is stored as its own 4-bit nibble, and applies the +6 (0110) correction to any digit sum above 9. Enter decimal numbers or BCD bits to get the BCD result, a nibble-by-nibble view of every correction and carry, and the decimal, packed-hex and pure-binary equivalents.
A BCD sum is the result of adding 2 numbers stored in binary-coded decimal (BCD), where each decimal digit gets its own 4 bits and a digit sum above 9 is corrected by adding 6 (0110). The BCD sum of 45 (0100 0101) and 38 (0011 1000) is 83 (1000 0011).
The standard code is 8421 BCD, named after the weights of its 4 bits: 8, 4, 2 and 1. Only 10 of the 16 possible nibbles are used (0000 to 1001), so BCD needs more bits than pure binary: 2026 takes 16 bits in BCD and 11 bits in binary. IBM mainframes from the 1950s, the Intel 4004 (1971) and the x86 DAA instruction all support BCD sums in hardware.
The BCD sum calculator adds the 2 numbers one 4-bit digit at a time from the right, checks each binary digit sum, adds 0110 when the sum is greater than 9, and passes a decimal carry of 1 to the next digit. This copies what a hardware BCD adder does: a 4-bit binary adder, a "greater than 9" detector and a second adder for the correction.
Each decimal digit becomes a nibble: 4 → 0100, 5 → 0101. BCD-bit input is checked for codes above 1001.
A 4-bit binary add gives a sum from 0 to 19 (9 + 9 + carry 1).
Sums 10 to 19 get +0110. That pushes the nibble past 1111, so it wraps and produces the decimal carry.
The carry joins the next digit's sum; the final carry becomes a new leading digit 0001.
The BCD sum rule is: add the 2 digits and the carry in binary; if the result S is greater than 9, add 6 (0110), write the lower 4 bits and carry 1. The correction condition in logic form uses the carry out K and the sum bits Z8 Z4 Z2 Z1 of the first adder.
For 5 + 8: S = 1101 (13). 13 > 9, so 1101 + 0110 = 1 0011: digit 0011 (3), carry 1. For 9 + 9: S = 1 0010 (18) with K = 1, so 1 0010 + 0110 = 1 1000: digit 1000 (8), carry 1.
There are 5 common BCD formats, and each has its own sum rule: 8421 packed BCD, unpacked BCD, Excess-3, 2421 (Aiken) and ASCII digits. The +6 correction belongs to 8421 BCD; Excess-3 adds or subtracts 3 instead.
2 digits per byte (83 → 0x83). Correction: +0110 for digit sums above 9. Used by the x86 DAA instruction.
1 digit per byte (83 → 0x08 0x03). The x86 AAA instruction adjusts each byte after an add.
Each digit is stored as d + 3, so 5 → 1000. After adding, subtract 0011 if no carry occurred, add 0011 if it did.
Weights 2-4-2-1; the code is self-complementing, so 9 − d is a bit inversion. Useful for subtraction.
Characters '0' to '9' are bytes 0x30 to 0x39; masking with 0x0F leaves an unpacked BCD digit.
To add BCD numbers by hand, write each number in 4-bit groups, add the rightmost groups in binary, add 0110 if the group sum is over 1001 or overflowed 4 bits, carry 1 to the next group, and repeat. Here is 45 + 38:
A BCD sum adds 6 to skip codes: a 4-bit nibble has 16 codes but a decimal digit uses only 10, leaving 6 unused codes (1010 to 1111) to skip. A binary nibble rolls over at 16; decimal rolls over at 10. Adding 6 to any sum from 10 to 15 lands it on 16 to 21, which wraps the nibble to 0 to 5 and produces the carry.
Sums of 16 to 19 have already wrapped inside the 4-bit adder, so they lost 16 instead of 10; adding 6 restores the missing 6. Both cases use the same correction, which is why 1 adder with a 2-gate detector handles every digit.
To use the BCD sum calculator, choose decimal or BCD-bit input, type the 2 numbers and press Calculate. The result card shows the BCD sum and the number of +6 corrections; the tabs show the steps, a nibble view with every correction, and a digit table.
Decimal digits (45) or BCD bits (0100 0101).
Whole non-negative numbers up to 40 digits.
The answer appears in BCD with the decimal value underneath.
The Nibble view tab marks every +0110 correction in orange.
BCD sums run wherever decimal digits must be exact or shown on a display. There are 5 common uses:
Common BCD additions with the number of +6 corrections.
| Decimal problem | BCD sum | +6 corrections | Calculator |
|---|---|---|---|
| 123 + 456 = 579 | 0101 0111 1001 | 0 | |
| 45 + 38 = 83 | 1000 0011 | 1 | |
| 27 + 15 = 42 | 0100 0010 | 1 | |
| 9 + 9 = 18 | 0001 1000 | 1 | |
| 999 + 1 = 1000 | 0001 0000 0000 0000 | 3 | |
| 2964 + 3159 = 6123 | 0110 0001 0010 0011 | 3 |
Work each BCD addition by hand, then reveal the answer or check it in the calculator.
Add 25 and 34 in BCD.
Add 8 and 7 in BCD.
Add 56 and 67 in BCD.
Add 99 and 99 in BCD.
Add the BCD numbers 0111 1001 and 0010 0110.
Add 1234 and 8766 in BCD. How many digits need +6?
Discover 67 free sum calculators across different categories. Find the right calculator for your needs.
Try a different name or choose another category.
A BCD sum calculator is an online tool that adds 2 numbers in binary-coded decimal (BCD) and shows each 4-bit digit sum, every +6 (0110) correction and every carry. It accepts decimal digits or BCD bits.
BCD addition adds 6 to skip the 6 unused nibble codes 1010 to 1111. A 4-bit sum rolls over at 16 while a decimal digit rolls over at 10, and 16 − 10 = 6.
The +6 correction is needed when a digit sum is greater than 9 (1001) or when the 4-bit addition produces a carry out. Sums from 0 to 9 need no correction.
9 + 9 in BCD is 0001 1000 (18). The binary sum 1 0010 has a carry out, so adding 0110 gives 1 1000: digit 8 with a carry of 1.
No, BCD is not the same as binary. BCD stores each decimal digit in its own 4 bits, so 83 is 1000 0011 in BCD and 1010011 in binary.
Yes, the BCD sum calculator takes BCD bits. Pick BCD bits and type nibbles such as 0111 1001; any nibble from 1010 to 1111 is rejected as invalid.
A BCD sum needs 4 bits per decimal digit. The sum of two 3-digit numbers has at most 4 digits, so it fits in 16 bits.
Packed BCD stores 2 digits per byte (83 → 0x83), and unpacked BCD stores 1 digit per byte (83 → 0x08 0x03). The +6 correction is the same for both.
A BCD sum adds decimal digits as 4-bit nibbles and fixes any digit sum above 9 by adding 6 (0110), and the BCD sum calculator shows each nibble, each correction and each carry. Use it to check hardware adder designs, DAA instruction results, clock-chip arithmetic and homework on 8421 code.
Not sure which BCD format your problem uses? Answer the questions below.