BCD Sum Calculator

Add numbers in 8421 BCD, digit by digit, with every +6 (0110) correction shown.

  1. Enter valuesUse your own inputs or an example
  2. CalculateApply your selected settings
  3. View resultExplore the answer and explanation

Enter the 2 numbers

Enter your values below to get started.

Examples:
Input format
Decimal: 45. BCD bits: 0100 0101.
Reset restores the default values.

Tips for this calculator

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.

What is a BCD Sum?

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.

InteractiveEncode a decimal number as BCD nibbles

How Does the BCD Sum Calculator Work?

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.

InteractiveOne-digit BCD adder with correction
  1. Encode

    Each decimal digit becomes a nibble: 4 → 0100, 5 → 0101. BCD-bit input is checked for codes above 1001.

  2. Add the nibbles

    A 4-bit binary add gives a sum from 0 to 19 (9 + 9 + carry 1).

  3. Correct

    Sums 10 to 19 get +0110. That pushes the nibble past 1111, so it wraps and produces the decimal carry.

  4. Carry and repeat

    The carry joins the next digit's sum; the final carry becomes a new leading digit 0001.

BCD Sum Formula: the +6 Correction Rule

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.

C=K+Z8Z4+Z8Z2,digit={SS≤9(S+6) mod 16S>9C = K + Z_8 Z_4 + Z_8 Z_2, \qquad \text{digit} = \begin{cases} S & S \le 9 \\ (S + 6) \bmod 16 & S > 9 \end{cases}

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.

InteractiveWhich raw sums need the +6 correction?

Types of BCD Codes and BCD Sums

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.

InteractiveThe same number in 5 BCD formats

8421 packed BCD

2 digits per byte (83 → 0x83). Correction: +0110 for digit sums above 9. Used by the x86 DAA instruction.

Unpacked BCD

1 digit per byte (83 → 0x08 0x03). The x86 AAA instruction adjusts each byte after an add.

Excess-3 (XS-3)

Each digit is stored as d + 3, so 5 → 1000. After adding, subtract 0011 if no carry occurred, add 0011 if it did.

2421 (Aiken code)

Weights 2-4-2-1; the code is self-complementing, so 9 − d is a bit inversion. Useful for subtraction.

ASCII digits

Characters '0' to '9' are bytes 0x30 to 0x39; masking with 0x0F leaves an unpacked BCD digit.

How to Add BCD Numbers by Hand

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:

  1. Write 45 = 0100 0101 and 38 = 0011 1000.
  2. Units: 0101 + 1000 = 1101 (13). 13 > 9, so add 0110: 1101 + 0110 = 1 0011. Write 0011, carry 1.
  3. Tens: 0100 + 0011 + 1 = 1000 (8). 8 ≤ 9, so no correction. Write 1000.
  4. The BCD sum is 1000 0011 = 83.
InteractiveStep through BCD sums by hand

    Why a BCD Sum Adds 6: the 6 Unused Codes

    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.

    16−10=6⇒11012 (13)+01102=1 00112  →  carry 1, digit 316 - 10 = 6 \quad\Rightarrow\quad 1101_2\ (13) + 0110_2 = 1\,0011_2 \;\to\; \text{carry } 1,\ \text{digit } 3

    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.

    Interactive16 nibble codes, 10 digits: watch the skip

    Common Mistakes with BCD Sums

    • Skipping the correction after a 4-bit carry: 9 + 9 = 1 0010 looks like a valid digit 2, but the carry out means +0110 is still needed.
    • Correcting sums of exactly 9 or less: 1001 (9) is valid; only 1010 and above, or a carry out, trigger +6.
    • Converting the whole number to binary: BCD adds digit groups, not the full binary value; 83 in BCD is 1000 0011, not 1010011.
    • Accepting invalid nibbles as input: 1100 is not a BCD digit, so a BCD input containing 1100 is an error.
    • Forgetting the carry into the next digit: the +6 correction always produces a carry of 1 into the next group.
    InteractiveTrue or false: BCD sums
    1. In 8421 BCD, 1010 is a valid digit.

    2. 0101 + 0100 (5 + 4) needs the +6 correction.

    3. 1001 + 1001 (9 + 9) needs +6 even though the low 4 bits read 0010.

    4. The BCD sum of 45 and 38 is 1000 0011.

    5. BCD uses fewer bits than pure binary.

    Score: 0 / 5

    How to Use the BCD Sum Calculator

    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.

    InteractiveLoad a BCD sum

    Each button fills the calculator and runs it.

    1. Pick the input format

      Decimal digits (45) or BCD bits (0100 0101).

    2. Type A and B

      Whole non-negative numbers up to 40 digits.

    3. Press Calculate

      The answer appears in BCD with the decimal value underneath.

    4. Inspect each digit

      The Nibble view tab marks every +0110 correction in orange.

    Real-Life Uses of BCD Sums

    BCD sums run wherever decimal digits must be exact or shown on a display. There are 5 common uses:

    • Cash registers and calculators: pocket calculators such as the Texas Instruments TI-30 work in BCD so 0.1 + 0.2 shows exactly 0.3.
    • 7-segment displays: a BCD-to-7-segment decoder (7447 or CD4511 chip) turns each nibble into a lit digit.
    • Real-time clocks: RTC chips such as the DS1307 store seconds, minutes and hours in BCD.
    • Banking and COBOL: packed decimal fields (COMP-3) in IBM z/Architecture keep money exact to the cent.
    • Decimal floating point: IEEE 754-2008 defines decimal64 and decimal128 formats for financial math.
    InteractiveCash register: BCD sum on a 7-segment display

    BCD Sum Examples

    Common BCD additions with the number of +6 corrections.

    BCD Sum Examples
    Decimal problemBCD sum+6 correctionsCalculator
    123 + 456 = 5790101 0111 10010
    45 + 38 = 831000 00111
    27 + 15 = 420100 00101
    9 + 9 = 180001 10001
    999 + 1 = 10000001 0000 0000 00003
    2964 + 3159 = 61230110 0001 0010 00113

    Popular BCD Sum Problems

    Work each BCD addition by hand, then reveal the answer or check it in the calculator.

    1. Add 25 and 34 in BCD.

      0010\,0101 + 0011\,0100
      Show answer0101\,1001 = 59\ (0\ \text{corrections})
    2. Add 8 and 7 in BCD.

      1000 + 0111
      Show answer0001\,0101 = 15
    3. Add 56 and 67 in BCD.

      0101\,0110 + 0110\,0111
      Show answer0001\,0010\,0011 = 123
    4. Add 99 and 99 in BCD.

      1001\,1001 + 1001\,1001
      Show answer0001\,1001\,1000 = 198
    5. Add the BCD numbers 0111 1001 and 0010 0110.

      0111\,1001 + 0010\,0110
      Show answer0001\,0000\,0101 = 105
    6. Add 1234 and 8766 in BCD. How many digits need +6?

      1234 + 8766
      Show answer0001\,0000\,0000\,0000\,0000 = 10000\ (4\ \text{corrections})

    Explore More Sum Calculators

    Discover 67 free sum calculators across different categories. Find the right calculator for your needs.

    Browse All 67 Calculators
    Questions and answers

    Frequently Asked Questions

    What is a BCD sum calculator?

    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.

    Why do you add 6 in BCD addition?

    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.

    When is the +6 correction needed in a BCD sum?

    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.

    What is 9 + 9 in BCD?

    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.

    Is BCD the same as binary?

    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.

    Can the BCD sum calculator take BCD bits as input?

    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.

    How many bits does a BCD sum need?

    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.

    What is the difference between packed and unpacked BCD?

    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.

    Conclusion

    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.

    InteractiveWhich BCD sum rule applies?