Hex Sum Calculator

Add or subtract hexadecimal numbers with carries, borrows and decimal and binary checks.

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

Enter the hex numbers

Enter your values below to get started.

Examples:
One number per line, or separate with spaces, commas or +. 0x prefixes, # and a trailing h are accepted.
Operation
A fixed width keeps the last digits and reports the carry or borrow out.
Reset restores the default values.

Tips for this calculator

Letters are case-insensitive: beef and BEEF are the same number.

Pick Subtract to compute the 1st number minus all the others.

Set a Register width to see what an 8-bit or 32-bit CPU register keeps.

Open the Table tab to see each column's total in decimal.

A hex sum calculator adds or subtracts numbers written in base 16 (digits 0–9 and A–F) and shows each carry or borrow column by column. Enter 2 to 50 hexadecimal numbers to get the hex result, its decimal, binary and octal values, a long-addition layout, and an optional 8-, 16-, 32- or 64-bit register view that flags a carry out.

What is a Hex Sum?

A hex sum is the result of adding numbers written in hexadecimal (base 16), where each column holds a digit from 0 to F and a column total of 16 or more carries 1 to the next column. The hex sum 3A7 + 1C9 equals 570, which is 935 + 457 = 1,392 in decimal.

Hexadecimal uses 16 digits: 0–9 for values 0 to 9 and A, B, C, D, E, F for values 10 to 15. Each column has a place value of 16n: 1, 16, 256, 4,096 and 65,536. IBM popularized the A–F digits with the System/360 in 1964, and the C programming language added the 0x prefix used in code today.

One hex digit stands for exactly 4 bits (a nibble), so 2 hex digits describe 1 byte (8 bits) and 8 hex digits describe a 32-bit word.

InteractiveHex place values: type a number

How Does the Hex Sum Calculator Work?

The hex sum calculator right-aligns the numbers, adds each column from the right in decimal, writes the total minus 16 when the total reaches 16, and carries 1 left. Subtraction works the same way with borrows: a top digit smaller than the bottom digit borrows 16 from the next column.

InteractiveWalk through a hex sum column by column
  1. Parse each number

    The calculator strips 0x, # or a trailing h and checks for the digits 0–9 and A–F.

  2. Add or subtract by column

    Column total = digit values + carry in. 7 + 9 = 16 writes 0 and carries 1.

  3. Apply the register width

    With 8 bits the calculator keeps 2 hex digits; anything beyond is the carry out.

  4. Convert

    The result is shown in decimal (base 10), binary (base 2) and octal (base 8) with exact big-integer math.

Hex Sum Formula and Addition Table

Each hex column follows one formula: digit = (a + b + cin) mod 16 and carry = ⌊(a + b + cin) ÷ 16⌋. For A + C + 1 = 10 + 12 + 1 = 23, the digit is 23 − 16 = 7 and the carry is 1.

sk=(ak+bk+ck) mod 16,ck+1=⌊ak+bk+ck16⌋s_k = (a_k + b_k + c_k) \bmod 16, \qquad c_{k+1} = \left\lfloor \frac{a_k + b_k + c_k}{16} \right\rfloor

Place-Value Formula

The value of a hex number is the sum of each digit times 16 to the power of its position.

57016=5⋅162+7⋅161+0⋅160=1280+112+0=1392570_{16} = 5\cdot 16^2 + 7\cdot 16^1 + 0\cdot 16^0 = 1280 + 112 + 0 = 1392

Hex Subtraction Formula

Hex subtraction writes (a − b − borrow) when that value is 0 or more, and (a + 16 − b − borrow) with a new borrow when the value is negative. 3 − 9 borrows: 3 + 16 − 9 = 10 = A.

InteractiveHex addition table: pick 2 digits

Types of Hex Sums

There are 4 types of hex sums: unlimited hex addition, hex subtraction, fixed-width (modular) hex sums, and negative hex differences. The same digits give different answers depending on the type: C8 + 64 is 12C with unlimited width but 2C in an 8-bit register.

InteractiveSame digits, 4 types of hex sum

Hex addition

Every carry is kept, so the result can be 1 digit longer than the longest number: FFFF + 1 = 10000.

Hex subtraction

Borrows replace carries: 7F3 − 2A9 = 54A, with 1 borrow in the 160 column.

Fixed-width hex sum

Only n bits are kept, which is addition mod 2n. CPU registers, checksums and hash functions work this way.

Negative hex difference

When the result is below 0, the calculator shows −54A. In a register the same value wraps to its two's complement, FAB6 in 16 bits.

How to Add Hex Numbers by Hand

To add hex numbers by hand, convert each column's digits to decimal, add them with the carry, subtract 16 when the total is 16 or more, write the digit and carry 1. Here is 3A7 + 1C9:

  1. 160 column: 7 + 9 = 16. Write 0, carry 1.
  2. 161 column: A + C + 1 = 10 + 12 + 1 = 23. 23 − 16 = 7. Write 7, carry 1.
  3. 162 column: 3 + 1 + 1 = 5. Write 5.
  4. The hex sum is 570 (935 + 457 = 1,392).
InteractiveStep through hex sums by hand

    Hex Sums and Binary: Why 1 Hex Digit = 4 Bits

    A hex sum and a binary sum always give the same result: 16 = 24, so every hex digit maps to exactly 4 bits. A carry out of a hex column is the same event as a carry out of the matching 4-bit group in binary.

    AB16+5E16=10916  ⟺  1010 10112+0101 11102=1 0000 10012\text{AB}_{16} + \text{5E}_{16} = \text{109}_{16} \iff 1010\,1011_2 + 0101\,1110_2 = 1\,0000\,1001_2

    Programmers write memory addresses, colors and machine code in hex for this reason: 1 byte = 2 hex digits, 1 kibibyte (KiB) = 40016 = 1,024 bytes, and the 32-bit maximum is FFFFFFFF = 4,294,967,295.

    InteractiveHex digits split into 4-bit nibbles

    Common Mistakes with Hex Sums

    • Carrying at 10 instead of 16: 7 + 5 = C in hex, not 12.
    • Reading letters as digits out of order: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
    • Borrowing 10 instead of 16: in hex subtraction a borrow adds 16 to the top digit.
    • Writing a 2-digit column result: 9 + 8 = 17 = 1116, so write 1 and carry 1.
    • Ignoring the register width: FF + 1 = 100 in math, but an 8-bit register holds 00.
    InteractiveTrue or false: hex sums
    1. In hex, 9 + 1 = A.

    2. F + 1 = 10 in hexadecimal.

    3. A hex column carries when the total reaches 10.

    4. FF + 1 in an 8-bit register gives 100.

    5. Every hex digit equals exactly 4 binary digits.

    Score: 0 / 5

    How to Use the Hex Sum Calculator

    To use the hex sum calculator, type 2 or more hex numbers, choose Add all or Subtract, pick a register width if you need one, and press Calculate. The result card shows the hex answer with decimal, binary and octal values; the tabs show the steps, the long addition and a column table.

    InteractiveLoad a hex sum

    Each button fills the calculator and runs it.

    1. Type the numbers

      One per line or separated by spaces, commas or +. Prefixes like 0x are fine.

    2. Pick the operation

      Add all, or Subtract to take the 2nd and later numbers away from the 1st.

    3. Set a width (optional)

      8, 16, 32 or 64 bits shows what a register keeps and whether a carry left it.

    4. Check the carries

      The Long addition tab marks each carry or borrow in orange.

    Real-Life Uses of Hex Sums

    Hex sums appear wherever computers show raw bytes. There are 5 common uses:

    • Memory addresses: base 0x1000 + offset 0x24 = 0x1024 gives the address of a field in a struct.
    • Web colors: CSS colors such as #3366CC store red, green and blue as 2 hex digits each; additive blending adds the channels.
    • Checksums: Intel HEX files end each record with a checksum byte computed from the sum of the record's bytes.
    • Network addresses: Internet Protocol version 6 (IPv6) addresses are 8 groups of 4 hex digits; adding 1 gives the next host.
    • Debugging: debuggers such as GDB print registers in hex, so stack offsets are added in hex.
    InteractiveAdd 2 web colors channel by channel

    Hex Sum Examples

    Common hexadecimal additions and subtractions with the decimal check.

    Hex Sum Examples
    ProblemHex resultDecimal checkCalculator
    9 + 7109 + 7 = 16
    3A7 + 1C9570935 + 457 = 1,392
    FFFF + 11000065,535 + 1 = 65,536
    BEEF + CAFE189ED48,879 + 51,966 = 100,845
    A9 + 7D + 3C162169 + 125 + 60 = 354
    7F3 − 2A954A2,035 − 681 = 1,354
    C8 + 64 (8-bit)2C, carry out200 + 100 = 300 = 256 + 44

    Popular Hex Sum Problems

    Solve each one by hand, then reveal the answer or check it in the calculator.

    1. Add 4B and 3F.

      \text{4B}_{16} + \text{3F}_{16}
      Show answer\text{8A}_{16} = 138
    2. Add 1F4 and 2EE.

      \text{1F4}_{16} + \text{2EE}_{16}
      Show answer\text{4E2}_{16} = 1250
    3. Add FF and FF.

      \text{FF}_{16} + \text{FF}_{16}
      Show answer\text{1FE}_{16} = 510
    4. Add ABC and DEF.

      \text{ABC}_{16} + \text{DEF}_{16}
      Show answer\text{18AB}_{16} = 6315
    5. Subtract 1 from 1000.

      1000_{16} - 1_{16}
      Show answer\text{FFF}_{16} = 4095
    6. In a 32-bit register, add FFFFFFF0 and 20. What does the register hold?

      \text{FFFFFFF0}_{16} + 20_{16}\ (32\text{-bit})
      Show answer00000010_{16}\ \text{with a carry out}

    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 hex sum calculator?

    A hex sum calculator is an online tool that adds or subtracts hexadecimal (base-16) numbers and shows each carry or borrow. This hex sum calculator handles 2 to 50 numbers and gives the result in hex, decimal, binary and octal.

    How do you add hex numbers?

    Add hex numbers column by column from the right: convert the digits to decimal, add them with the carry, and when the total is 16 or more write total − 16 and carry 1. 7 + 9 = 16 writes 0 and carries 1.

    What is F + 1 in hex?

    F + 1 in hex is 10. F equals 15, and 15 + 1 = 16, which is written as 10 in base 16.

    What is FF + 1 in hex?

    FF + 1 in hex is 100, which equals 256 in decimal. In an 8-bit register the result wraps to 00 with a carry out.

    Can the hex sum calculator subtract?

    Yes, the hex sum calculator subtracts. Pick Subtract and the calculator computes the 1st number minus all the others, with every borrow shown; 7F3 − 2A9 = 54A.

    Is hex addition the same as decimal addition?

    No, hex addition carries at 16 instead of 10. The steps are the same, but 8 + 8 = 10 in hex (16 in decimal) and 9 + 1 = A.

    Why do programmers use hex sums?

    Programmers use hex sums to keep memory addresses, byte offsets and colors short: 1 hex digit equals 4 bits. 0x1000 + 0x24 = 0x1024 is easier to read than the 13-bit binary equivalent.

    How many digits does a hex sum have?

    A hex sum of 2 numbers has at most 1 more digit than the longer number. FFFF + FFFF = 1FFFE, 5 digits from two 4-digit numbers.

    Conclusion

    A hex sum adds base-16 numbers column by column, carrying 1 whenever a column reaches 16, and the hex sum calculator does this for up to 50 numbers with each carry and borrow shown. Use unlimited width for math, a fixed register width for programming, and the decimal and binary rows to check every answer.

    Not sure which setting fits your problem? Answer the questions below.

    InteractiveWhich hex sum setting do you need?