How Calculators Arrive at the Answer: The Math Behind the Button
How a calculator works out an answer: order of operations, the % key, square roots by repeated guessing, rounding, and why two calculators can disagree.
You press a few keys and a number appears. It looks instant, but the calculator has followed a fixed set of rules to get there: it has decided which operation to do first, turned your decimal numbers into a form its circuits can handle, run a short algorithm, and rounded the result to fit the screen.
Knowing those rules is useful. It lets you check an answer that looks wrong, explains why two calculators sometimes disagree, and shows you how to work the same problem by hand.
In this guide:
- What happens between pressing the keys and seeing the answer
- Order of operations (PEMDAS) and why basic calculators sometimes ignore it
- How the % key and square roots really work
- Why rounding can make a calculator look wrong
- Quick ways to check any calculator answer, with practice problems
Quick Answer
A calculator reads your keys as an expression, applies the order of operations (if it is a scientific calculator), converts the numbers into binary or binary-coded decimal, and runs a fixed procedure for each operation. Addition and subtraction work digit by digit with carries, as you learned at school. Multiplication is done by shifting and adding, division by shifting and subtracting (a form of long division), and square roots by repeated improving guesses. The result is then rounded to the number of digits the screen can show.
What happens when you press "="
Read the keys
The keypress sequence becomes an expression: numbers and operators in order.
Decide the order
A scientific calculator applies PEMDAS. A basic one usually works left to right as you type.
Run the algorithm
Each operation is a fixed procedure: carry, shift and add, shift and subtract, refine a guess.
Round and display
The result is rounded to the 8 to 12 digits the screen holds, so some answers are approximations.
Swipe sideways to compare columns.
| Operation | What happens inside | How you can do it by hand |
|---|---|---|
| Addition | Adds digit by digit, carrying into the next place | Column addition |
| Subtraction | Subtracts digit by digit, borrowing (or adds a complement) | Column subtraction |
| Multiplication | Shift-and-add: one partial product per digit, then add them | Long multiplication |
| Division | Shift-and-subtract: repeated subtraction, place by place | Long division |
| Percent | Divides by 100, then multiplies (some models also add or subtract) | Move the decimal point two places |
| Square root | Makes a guess and improves it until it stops changing | Estimate, then refine |
How Calculators Do the Four Basic Operations
Addition and subtraction
For 18 + 34 the calculator adds the ones (8 + 4 = 12, write 2, carry 1), then the tens (1 + 3 + 1 = 5), giving 52. That is the same column method you use on paper. Subtraction is handled the same way with borrowing, or by adding a complement, which lets one circuit do both jobs.
Multiplication: shift and add
A calculator does not add 7 to itself 4 times to get 28; that would be far too slow for 4,816 × 3,927. Instead it makes one partial product for each digit of the second number, shifts each one into place and adds them. In decimal, 47 × 23 = (47 × 20) + (47 × 3) = 940 + 141 = 1,081. The chip does the same thing in binary, where every partial product is either the number itself or zero, so each step is a shift and an add.
Division: shift and subtract
Division works the other way round: the calculator subtracts the divisor, shifted to the right place value, as many times as it fits, then moves one place to the right and repeats. That is long division. For 56 ÷ 8 it finds that 8 fits into 56 seven times with nothing left. If you want to see each subtraction written out, the long division calculator shows the full working, and the long division step-by-step guide explains the layout.
Order of Operations: PEMDAS
When an expression has more than one operation, a scientific calculator follows the order of operations, often remembered as PEMDAS (BODMAS or BIDMAS in the UK).
Swipe sideways to compare columns.
| Step | Letter | Operation |
|---|---|---|
| 1 | P | Parentheses (brackets): work inside them first, innermost first |
| 2 | E | Exponents and roots |
| 3 | M and D | Multiplication and division, from left to right |
| 4 | A and S | Addition and subtraction, from left to right |
Worked example 1: 6 × 5 + 3 ÷ 2 − 6
A scientific calculator turns this into a tree. The operations lower in the tree are done first, and each result feeds the operation above it.
How a scientific calculator reads 6 × 5 + 3 ÷ 2 − 6
Multiplication and division sit lowest in the tree, so they are worked out first. The subtraction at the top is done last.
Answer: 25.5. Working strictly left to right would give ((6 × 5 + 3) ÷ 2) − 6 = 10.5, which is wrong.
Worked example 2: 3 × (4 + 6 × (8 + 2))
- Innermost brackets: 8 + 2 = 10.
- Next brackets: 4 + 6 × 10 = 4 + 60 = 64 (multiply before adding).
- Outside: 3 × 64 = 192.
Worked example 3: 4 ÷ 3 × (4 × 10¹⁵)
- Brackets: 4 × 10¹⁵ = 4,000,000,000,000,000.
- Left to right: 4 ÷ 3 = 1.3333…, then 1.3333… × 4 × 10¹⁵.
- Answer: about 5.333 × 10¹⁵ (5,333,333,333,333,333). A 10-digit screen shows it in scientific notation, as 5.333333333 × 10¹⁵ or "5.333333333E15".
If the "E15" on the screen is unfamiliar, the scientific notation guide explains how to read it.
Why Two Calculators Can Give Different Answers
Type 2 + 3 × 4 into a basic four-function calculator and many will show 20. A scientific calculator shows 14. Neither is broken. They use different input logic.
The same keys, 2 + 3 × 4 =, on two kinds of calculator
Basic calculator (immediate execution)
Each operation is done as soon as you press the next operator key.
- 2 + 3 is worked out when you press ×, giving 5
- 5 × 4 = 20
- Common on simple desk and pocket calculators
Scientific calculator (algebraic logic)
The whole expression is read first, then PEMDAS is applied.
- 3 × 4 = 12 is done first
- 2 + 12 = 14
- This is the answer a maths teacher expects
On a basic calculator, press = after each step you want done first, or work the multiplication separately: 3 × 4 = 12, then 12 + 2.
Swipe sideways to compare columns.
| Cause | Example | What to do |
|---|---|---|
| Input logic | 2 + 3 × 4 gives 20 or 14 | Use brackets or a scientific calculator |
| Implied multiplication | 6 ÷ 2(1 + 2) gives 9 on some models and 1 on others | Write it with brackets: (6 ÷ 2) × (1 + 2) = 9 |
| Degrees vs radians | sin(30) gives 0.5 in degrees, −0.988 in radians | Check the DEG/RAD indicator |
| Rounding | 1 ÷ 3 × 3 can show 0.9999999 or 1 | Round the final answer, not the steps |
| The % key | 100 + 8% gives 108 on many models, 100.08 on others | Type 100 × 1.08 instead |
How Calculators Handle Percentages
A percent is a number out of 100, so the calculator divides by 100 and multiplies. 5% of 40 is 0.05 × 40 = 2. On most basic calculators, typing 40 × 5 % gives 2 directly.
Adding a percentage is where calculators differ. Many basic models treat 100 + 8 % as "add 8% of 100" and show 108. Others read 8% simply as 0.08 and show 100.08, and some scientific calculators have no % key at all. The method that works on every calculator is to multiply by 1 plus the rate: 100 × 1.08 = 108. That is exactly how sales tax is added to a price, as the sales tax guide for online sellers shows, and the percentage calculator handles every form of the question.
How Calculators Find Powers and Square Roots
Whole-number powers are repeated multiplication: 5³ = 5 × 5 × 5 = 125. For large powers a calculator saves time by squaring: 2¹⁶ is 2 squared four times (2, 4, 16, 256, 65,536) rather than fifteen separate multiplications.
Square roots of perfect squares are easy to check by hand: √144 = 12 because 12 × 12 = 144. For a number like 50, the calculator makes a guess and improves it. One common method, Newton's method, replaces a guess g with the average of g and 50 ÷ g. Starting from 7 (because 7² = 49):
Swipe sideways to compare columns.
| Step | Guess | Guess² | Correct digits |
|---|---|---|---|
| Start | 7 | 49 | 2 |
| 1 | 7.0714286 | 50.0001276 | 4 |
| 2 | 7.0710678211 | 50.0000000001 | 8 |
| 3 | 7.0710678118655 | 50.0000000000000 | 15 or more |
Correct digits of √50 after each step
Each round of Newton's method roughly doubles the number of correct digits, so three steps fill a calculator screen.
Many handheld calculators use related shift-and-add methods (often called CORDIC) for roots and trigonometry. The idea is the same: a short loop that homes in on the answer.
Powers that are not whole numbers, such as 1.08^7.5, are worked out with logarithms behind the scenes. You can try any of these with the exponent calculator or the scientific calculator.
Rounding: Why the Last Digit Can Look Wrong
A calculator screen holds a fixed number of digits, often 8, 10 or 12, and it stores only a few more internally. Numbers like 1 ÷ 3 = 0.3333… never end, so the calculator must cut them off. Multiply that stored value by 3 and some calculators show 0.9999999 while others show 1, depending on how many hidden digits they keep and how they round.
Computers have a related quirk. Most programming languages store numbers in binary floating point, where 0.1 cannot be held exactly, so 0.1 + 0.2 comes out as 0.30000000000000004. Spreadsheets and phone calculators usually hide this by rounding the display. The practical rule is the same everywhere: keep full precision through the working and round only the final answer. The rounding rules guide covers how to round correctly, and the rounding calculator does it for you.
How to Check a Calculator Answer
Swipe sideways to compare columns.
| Check | How | Example |
|---|---|---|
| Estimate first | Round the numbers and work it out in your head | 49 × 21 is about 50 × 20 = 1,000, so 1,029 is reasonable |
| Reverse the operation | Multiply to check a division, add to check a subtraction | 48 ÷ 6 = 8 because 8 × 6 = 48 |
| Check the decimal point | Count decimal places, or compare with your estimate | 0.4 × 0.3 = 0.12, not 1.2 |
| Check the sign | Two negatives multiplied give a positive | −4 × −5 = 20 |
| Use a second method | Work it by hand or on a different calculator | Long division to confirm 851 ÷ 3 = 283 R2 |
Practice Problems (With Answers)
Swipe sideways to compare columns.
| Problem | Working | Answer |
|---|---|---|
| 1. 6 × 5 + 3 ÷ 2 − 6 | 30 + 1.5 − 6 | 25.5 |
| 2. 3 × (4 + 6 × (8 + 2)) | 3 × (4 + 60) = 3 × 64 | 192 |
| 3. 5% of 80 | 0.05 × 80 | 4 |
| 4. √169 | 13 × 13 = 169 | 13 |
| 5. 2⁴ | 2 × 2 × 2 × 2 | 16 |
| 6. 15 + 20 × 3 − 10 | 15 + 60 − 10 | 65 |
| 7. 12 ÷ 3 × 2 | Left to right: 4 × 2 | 8 |
| 8. $250 increased by 6% | 250 × 1.06 | $265 |
Common Calculator Mistakes
Swipe sideways to compare columns.
| Mistake | Fix |
|---|---|
| Typing a long expression into a basic calculator | Use brackets on a scientific calculator, or press = after each part |
| Doing multiplication before division in every case | M and D share a rank: go left to right |
| Rounding in the middle of a problem | Keep full precision, round the final answer only |
| Typing 5 instead of 0.05 for 5% | Divide the percent by 100, or use the % key |
| Forgetting to clear | Press AC (all clear) before a new problem; C or CE only clears the last entry on many models |
| Trusting the screen without an estimate | Estimate first so a misplaced decimal point stands out |
Frequently Asked Questions
How does a calculator work?
It reads your keys as an expression, decides the order of operations, converts the numbers to binary or binary-coded decimal, and runs a fixed procedure for each operation: carrying for addition, shift-and-add for multiplication, shift-and-subtract for division, and repeated guessing for roots. It then rounds the result to fit the screen.
Do all calculators follow PEMDAS?
Scientific and graphing calculators do. Many basic four-function calculators do not: they work each operation as you type it, so 2 + 3 × 4 gives 20 instead of 14.
How do calculators find square roots?
They start with a guess and improve it with a short repeated calculation, such as Newton's method or a shift-and-add method. Each step roughly doubles the correct digits, so only a few steps are needed.
Why does my calculator give a different answer from my friend's?
The usual causes are different input logic (immediate execution vs PEMDAS), how implied multiplication is treated, degree vs radian mode, rounding, and how the % key works on each model.
What does the % key do?
It divides by 100. On many basic calculators it also adds or subtracts a percentage of the previous number, so 100 + 8 % = 108, but this varies by model. Typing 100 × 1.08 gives 108 on any calculator.
What is the difference between C, CE and AC?
On most calculators CE (clear entry) erases only the number you are typing, while AC (all clear) erases the whole calculation. On some models a single C key does both: press once to clear the entry, twice to clear everything.
Final Summary
- Calculators follow fixed procedures: carry for addition, shift-and-add for multiplication, shift-and-subtract (long division) for division.
- Scientific calculators apply PEMDAS; many basic ones work left to right as you type.
- Square roots come from a guess that is improved until it stops changing.
- The screen shows a rounded value, so round only the final answer.
- Estimate first and reverse the operation to check any result.
To see the shift-and-subtract method the way it is taught in school, read the 4th grade long division guide, which uses area models and the step-by-step layout. And for a real-world use of powers, the guide to which investment has the highest long-term ROI shows how (1 + r)ⁿ turns a steady return into large numbers over decades.
Written by
Do The Calculation Team
Do The Calculation
Do The Calculation is built by a small team of data analysts and spreadsheet developers. Where a guide depends on a published formula, standard, or government rule, the calculator it links to names that source directly so you can check the number yourself.
About the team