Integer Sum Calculator

Add positive and negative integers exactly, or sum every integer from a to b.

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

Enter integers or a range

Enter your values below to get started.

Examples:
Find
Separate with commas, spaces or new lines. (−3) and +5 are fine.
Reset restores the default values.

Tips for this calculator

Same signs: add the absolute values and keep the sign. Different signs: subtract and keep the sign of the larger absolute value.

The sum of the integers from a to b is n(a + b)/2, where n = b − a + 1.

The integers from −n to n always add up to 0.

Huge integers stay exact: the calculator uses arbitrary-precision BigInt arithmetic.

An integer sum calculator adds whole numbers that can be positive, negative or zero, so 12 + (−7) + 30 + (−15) + (−4) + 9 = 25. Paste a list of up to 100,000 integers of any length, or enter a range a to b to get the sum of all, even or odd integers between them, with every step, a running-sum table and a number line.

What is an Integer Sum?

An integer sum is the result of adding 2 or more integers, the whole numbers …, −3, −2, −1, 0, 1, 2, 3, …. The sum of 5, −8, 3, −2 and 6 is 4.

Z={…,−2,−1,0,1,2,…}\mathbb{Z} = \{\ldots, -2, -1, 0, 1, 2, \ldots\}
S=∑i=1nxi,xi∈ZS = \sum_{i=1}^{n} x_i, \quad x_i \in \mathbb{Z}

The symbol ℤ comes from the German word Zahlen (numbers). Indian mathematician Brahmagupta wrote the first known rules for adding negative numbers, which he called debts, in the Brāhmasphuṭasiddhānta in 628 AD. An integer sum is always an integer: adding integers never produces a fraction or a decimal.

On a number line, adding a positive integer moves right and adding a negative integer moves left, so the sum is the final position after all the moves, starting at 0.

InteractiveHop along the number line

How Does the Integer Sum Calculator Work?

The integer sum calculator reads every integer in your list, adds the positive integers and the negative integers in 2 separate totals, then combines the 2 totals. The arithmetic uses arbitrary-precision integers (JavaScript BigInt), so a sum such as 99,999,999,999,999,999,999 + 1 = 100,000,000,000,000,000,000 keeps all 21 digits.

InteractivePositives, negatives and the net sum
  1. Read the list

    Commas, spaces, new lines and brackets separate the integers; −, – and - all mean minus.

  2. Total the positives

    12 + 30 + 9 = 51.

  3. Total the negatives

    (−7) + (−15) + (−4) = −26.

  4. Combine

    51 + (−26) = 25. The table lists the running sum after each integer.

Integer Sum Formula

The sum of all integers from a to b is S = n(a + b)/2, where n = b − a + 1 is the number of integers. The formula pairs the first and last integers, the second and second-to-last, and so on: every pair adds up to a + b.

Sum of Consecutive Integers from a to b

S=(b−a+1)(a+b)2S = \frac{(b - a + 1)(a + b)}{2}

Sum of the First n Positive Integers

1+2+⋯+n=n(n+1)21 + 2 + \cdots + n = \frac{n(n+1)}{2}

Carl Friedrich Gauss is said to have found 1 + 2 + … + 100 = 5,050 this way as a schoolboy in Braunschweig in the 1780s.

Sum of Even or Odd Integers

2+4+⋯+2n=n(n+1)2 + 4 + \cdots + 2n = n(n+1)
1+3+⋯+(2n−1)=n21 + 3 + \cdots + (2n-1) = n^2

Symmetric Range

∑k=−nnk=0\sum_{k=-n}^{n} k = 0
InteractiveWrite the range forwards and backwards

Rules for Adding Integers

There are 4 rules for adding integers: same signs, different signs, opposites and zero. The rules decide whether you add or subtract the absolute values and which sign the answer takes.

InteractiveCounter model: zero pairs cancel

Same signs

Add the absolute values and keep the sign: (−8) + (−13) = −21; 8 + 13 = 21.

Different signs

Subtract the smaller absolute value from the larger and keep the sign of the larger: 6 + (−4) = 2; (−9) + 4 = −5.

Opposites

An integer plus its opposite is 0: 17 + (−17) = 0.

Zero

Adding 0 changes nothing: (−5) + 0 = −5.

How to Calculate an Integer Sum by Hand

To calculate an integer sum by hand, add all the positive integers, add all the negative integers, then combine the 2 totals with the different-signs rule. Here is −15 + 22 + (−9) + 4:

  1. Positives: 22 + 4 = 26.
  2. Negatives: (−15) + (−9) = −24.
  3. Different signs: 26 − 24 = 2.
  4. 26 has the larger absolute value, so the sign is +.
  5. The sum is 2.
InteractiveStep through integer sums by hand

    Properties of Integer Addition

    Integer addition has 5 properties: closure, commutativity, associativity, an identity element (0) and an additive inverse for every integer. Together these properties make the integers an abelian group under addition, named after Norwegian mathematician Niels Henrik Abel.

    • Closure: the sum of 2 integers is an integer.
    • Commutative: a + b = b + a, so the order of a list never changes its sum.
    • Associative: (a + b) + c = a + (b + c), so a list can be added in any grouping.
    • Identity: a + 0 = a.
    • Inverse: a + (−a) = 0.

    The commutative and associative properties are what allow the calculator to total the positives and negatives apart and still return the same sum as adding left to right.

    InteractiveTest the 5 properties with live integers

    Common Mistakes with Integer Sums

    • Adding absolute values with different signs: 6 + (−4) is 2, not 10.
    • Taking the sign of the first number: (−3) + 8 = 5 takes the sign of 8, the larger absolute value.
    • Off-by-one counts: the integers from 1 to 100 number 100, but the integers from −10 to 15 number 26, not 25.
    • Dropping a minus sign in a list: write negatives in brackets, (−7), to keep the sign visible.
    • Rounding big integers: spreadsheets store numbers as IEEE 754 doubles with about 15–16 significant digits, so 253 + 1 = 9,007,199,254,740,993 is stored as 9,007,199,254,740,992.
    InteractiveTrue or false: adding integers
    1. (−9) + 4 = −5.

    2. The sum of 2 negative integers can be positive.

    3. The integers from −50 to 50 add up to 0.

    4. There are 25 integers from −10 to 15.

    5. Changing the order of a list of integers changes the sum.

    Score: 0 / 5

    How to Use the Integer Sum Calculator

    Pick Sum of a list or Sum of integers from a to b, enter the integers or the 2 endpoints and press Calculate. The result card gives the sum, the totals of positives and negatives (list) or the count and endpoints (range); the tabs show the steps, a number line or running-sum chart and a table.

    InteractiveLoad a ready-made integer sum

    Each button fills the calculator and runs it.

    1. Choose the mode

      Sum of a list for any integers; Sum of integers from a to b for consecutive integers.

    2. Enter the numbers

      Paste a list such as 12, -7, 30, or set a = −10 and b = 15.

    3. Filter the range

      Range only: all integers, even integers or odd integers.

    4. Read the working

      Steps show the grouping or the formula; the table lists every running total.

    Real-Life Uses of Integer Sums

    Integer sums track any quantity that goes up and down in whole steps. There are 5 common uses:

    • Bank balances: deposits are positive and withdrawals negative; 250 − 80 − 45 + 1,200 − 900 − 60 + 35 leaves $400.
    • Temperature: daily changes in °C (or °F) add up to the net change.
    • Elevation: climbs and descents in metres (m) or feet (ft) give the height gained on a hike.
    • Golf: scores relative to par (−1 birdie, +1 bogey) add up to the round's total.
    • Inventory: stock received (+) and sold (−) give the units on hand.
    InteractiveRunning totals in 4 real scenarios

    Integer Sum Examples

    Lists and ranges with their sums.

    Integer Sum Examples
    IntegersCountSumCalculator
    12, −7, 30, −15, −4, 9625
    −8, −13, −213−42
    1 to 1001005,050
    −10 to 152665
    Even integers 1 to 100502,550
    Odd integers 1 to 100502,500
    −50 to 501010

    Popular Integer Sum Problems

    Try each one, then reveal the answer or solve it in the calculator.

    1. Find −15 + 22 + (−9) + 4.

      Show answer2
    2. Find the sum of all integers from 1 to 200.

      Show answer20,100
    3. Find the sum of all integers from −20 to −1.

      Show answer−210
    4. Find the sum of the even integers from 2 to 50.

      Show answer650 (25 terms)
    5. Find the sum of the odd integers from 1 to 99.

      Show answer2,500 = 50²
    6. Daily temperature changes are −3, 5, 4, −2, −9, −6 and 3 °C. What is the net change?

      Show answer−8 °C

    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 an integer sum calculator?

    An integer sum calculator is an online tool that adds positive and negative whole numbers exactly. This calculator adds a list of up to 100,000 integers of any size, or sums all, even or odd integers from a to b.

    How do you add positive and negative integers?

    Add the positive integers, add the negative integers, then subtract the smaller absolute value from the larger and keep the sign of the larger. 12 + (−7) + 30 + (−15) + (−4) + 9 = 51 − 26 = 25.

    What is the sum of all integers from 1 to 100?

    The sum of all integers from 1 to 100 is 5,050: 100 × 101 / 2.

    What is the formula for the sum of integers from a to b?

    The sum of the integers from a to b is (b − a + 1)(a + b)/2. From −10 to 15: 26 × 5 / 2 = 65.

    Is the sum of 2 negative integers always negative?

    Yes, the sum of 2 negative integers is always negative: (−8) + (−13) = −21.

    Can the sum of integers be zero?

    Yes, a sum of integers is zero when the positives and negatives cancel, such as 17 + (−17) or every integer from −50 to 50.

    What is the sum of all even integers from 1 to 100?

    The sum of the even integers from 1 to 100 is 2,550: 50 terms from 2 to 100, 50 × 102 / 2.

    Does the calculator handle very large integers?

    Yes, the calculator uses arbitrary-precision BigInt arithmetic, so integers with hundreds of digits add exactly with no rounding.

    Who discovered the formula 1 + 2 + … + n = n(n + 1)/2?

    The formula 1 + 2 + … + n = n(n + 1)/2 was known to ancient Greek and Indian mathematicians; the popular story credits Carl Friedrich Gauss, who is said to have used it at age 8 to add 1 to 100.

    Conclusion

    An integer sum adds positive and negative whole numbers, and the integer sum calculator returns that sum exactly for lists of any length or for every integer between a and b. Use the same-signs and different-signs rules for short sums, and the formula n(a + b)/2 for consecutive integers.

    Not sure which mode to use? Answer 2 questions below.

    InteractiveWhich integer sum do you need?