An integer calculator adds, subtracts, multiplies, and divides whole numbers, including negative numbers. This one also finds the remainder, modulo, powers, the greatest common divisor (GCD), and the least common multiple (LCM). Enter two integers, pick an operation, and get the exact answer.
What Is an Integer Calculator?
An integer calculator is a tool that does math with integers. An integer is a whole number with no fraction or decimal part. Integers can be:
- Positive: 1, 2, 3, and so on
- Negative: −1, −2, −3, and so on
- Zero: 0
Numbers like 2.5 or ¾ are not integers. If you enter one, the tool will ask you for a whole number.
How to Use the Integer Calculator
- Enter the first integer. Use a minus sign for a negative number, like −17.
- Pick an operation. Choose add, subtract, multiply, divide, modulo, power, GCD, or LCM.
- Enter the second integer.
- Press Calculate.
You will see the answer, whether it is even or odd, its sign, and how many digits it has. The tool also shows the rule it used, so you can learn as you go.
Rules for Adding and Subtracting Integers
Adding Integers
- Same signs: Add the numbers and keep the sign. (−4) + (−6) = −10.
- Different signs: Subtract the smaller size from the larger size. Keep the sign of the larger one. −8 + 5 = −3.
Subtracting Integers
To subtract, add the opposite of the second number.
- 7 − (−12) = 7 + 12 = 19
- −5 − 3 = −5 + (−3) = −8
Rules for Multiplying and Dividing Integers
The sign of the answer depends on the signs of the two numbers:
- Same signs give a positive answer. (−6) × (−4) = 24.
- Different signs give a negative answer. (−36) ÷ 4 = −9.
Division With Remainders
Some integers do not divide evenly. The tool then shows a quotient and a remainder. They always fit this check:
first number = second number × quotient + remainder
For example, 17 ÷ 5 = 3 with a remainder of 2, because 5 × 3 + 2 = 17. The tool also shows the exact answer as a fraction (17/5) and as a decimal (3.4).
With negative numbers, the quotient rounds toward zero. So −17 ÷ 5 gives a quotient of −3 and a remainder of −2.
Modulo vs Remainder
Modulo (mod) also finds what is left over after division. The difference is that modulo never gives a negative answer when you divide by a positive number. It always returns a value from 0 up to one less than the divisor.
- −17 mod 5 = 3
- The remainder of −17 ÷ 5 = −2
For positive numbers, modulo and remainder give the same answer. Modulo is common in coding, clocks, and calendars.
Powers, GCD, and LCM
Powers
A power multiplies a number by itself. For example, 25 = 2 × 2 × 2 × 2 × 2 = 32.
- A negative number to an even power is positive. (−3)2 = 9.
- A negative number to an odd power is negative. (−3)3 = −27.
The tool keeps large answers exact. For example, 264 = 18,446,744,073,709,551,616. A normal calculator would round this.
Greatest Common Divisor (GCD)
The greatest common divisor is the largest integer that divides both numbers with no remainder. GCD(48, 36) = 12. You use the GCD to simplify fractions. For example, 36/48 simplifies to 3/4 when you divide both parts by 12.
Least Common Multiple (LCM)
The least common multiple is the smallest positive number that both integers divide into. LCM(4, 6) = 12. You use the LCM to find a common denominator when you add fractions.
Quick Reference Table
| Operation | Example | Answer |
|---|---|---|
| Add | −8 + 5 | −3 |
| Subtract | 7 − (−12) | 19 |
| Multiply | (−6) × (−4) | 24 |
| Divide | (−36) ÷ 4 | −9 |
| Divide with remainder | 17 ÷ 5 | 3 remainder 2 |
| Modulo | −17 mod 5 | 3 |
| Power | (−3)3 | −27 |
| GCD | GCD(48, 36) | 12 |
| LCM | LCM(4, 6) | 12 |
Integer Calculator FAQs
Is This Tool Free?
Yes. It is free, and you do not need to sign up. It runs in your browser, so nothing you enter is sent or saved.
Can It Handle Very Large Numbers?
Yes. It uses exact whole-number math, so answers stay exact no matter how many digits they have. Powers are limited to answers of about 20,000 digits so your browser stays fast.
Is Zero an Integer?
Yes. Zero is an integer, and it is even. It is neither positive nor negative.
What Happens If I Divide by Zero?
Division by zero has no answer in math. The tool shows a message instead of a result.
Can I Use Decimals?
No. The tool only accepts whole numbers. If you need to work with fractions, our vertex form calculator accepts fractions and decimals for quadratic equations.
More Free Calculators
- 401k Distribution Calculator: plan monthly withdrawals from your 401(k).
- Monthly Savings Calculator: find how much to save each month for a goal.
- Vertex Form Calculator: convert a quadratic equation to vertex form with steps.
- Binomial Probability Distribution Calculator: find exact and cumulative probabilities.
Final Thoughts
An integer calculator gives you exact answers for whole-number math, including negative numbers. It also shows the sign rules, remainders, and modulo so you can check your own work. Use it for homework, coding, or any quick math with whole numbers.