Basic Calculator

Basic Calculator

0

0

You can type on your keyboard: digits, + - * /, Enter or = to calculate, Backspace to delete and Esc to clear. Ctrl+V pastes a number.

Result

Enter a calculation and press =.

History

Your calculations appear here after you press =.

Your history stays in this browser and is never sent anywhere.

About this tool

An everyday calculator for shopping, bills, recipes and quick sums. Tap the keys or type on your keyboard, then press = to see the result and keep it in your history. Decimals add up exactly, so 0.1 + 0.2 gives 0.3, and multiplication and division come before addition and subtraction, as on a phone calculator. For sin, log and powers, use the scientific calculator.

How it works

Enter a number, an operator and the next number, then press == or Enter. The line above the number shows the whole calculation. Multiplication and division are worked out before addition and subtraction, so 2 + 3 × 4 gives 14. Pressing == again repeats the last step: after 2 + 3, a second press adds 3 once more and gives 8.

CE clears only the number you are entering; C clears the whole calculation, and the delete key removes the last digit. ± changes the sign of the number on the display, and √, x² and 1/x work on that number straight away.

The memory keys keep one number while you work. M+ adds the number on the display to memory and M− subtracts it. MR brings the stored number back and MC empties memory; an M next to the calculation shows that memory holds a number.

A+B%=A+A×B100,A×B%=A×B100A + B\% = A + \frac{A \times B}{100}, \quad A \times B\% = A \times \frac{B}{100}

Example

A jacket costs 80 and is 25% off. Type 80 − 25 % and press ==: 25% of 80 is 20, so the price is 60. To add 8% sales tax, type + 8 % and press == again for 64.8.

To total a receipt and take one item off, use memory: 12.5 M+, 7.25 M+, 3.4 M−, then MR shows 16.35.

Keys and keyboard shortcuts

KeyWhat it doesKeyboard
0–9 .Digits and the decimal point0–9 . ,
+ − × ÷Add, subtract, multiply and divide+ - * /
=Calculate; press again to repeat the last stepEnter =
%Percentage: 200 + 10% is 220, 200 × 10% is 20%
±Change the signF9
√ x² 1/xSquare root, square and reciprocal of the number on the display@ q r
CEClear the number being enteredDelete
CClear the whole calculationEsc
⌫Delete the last digitBackspace
MC MR M+ M−Memory clear, recall, add and subtract—
—Paste a numberCtrl+V, ⌘V

Open-source parts: the keypad logic and exact decimal arithmetic come from @examind/calculator-core and decimal.js, both under the MIT license.

Assumptions and limits

Results show up to 15 significant digits, and the calculator keeps 40 digits behind the display, so 1/3 × 3 gives exactly 1. A number you type can have up to 15 digits. Results of 10¹⁵ or more, or smaller than 0.000001, switch to E notation, such as 2e+16. Dividing by zero and the square root of a negative number show an error until you press C or CE. Memory lasts until you leave the page; your history stays in this browser.

Frequently asked questions

Does it multiply before it adds?

Yes. Multiplication and division are worked out before addition and subtraction, so 2 + 3 × 4 gives 14, as in written math and on phone calculators. Windows Calculator in Standard mode works one step at a time and gives 20. To add first here, press == after the addition: 2 + 3, ==, × 4, == gives 20.

How does the percent key work?

After + or −, % takes a percentage of the total so far, as on a shop calculator: 200 + 10% gives 220, 200 − 10% gives 180, and 2 + 3 × 4 + 10% adds 10% of 14. After × or ÷, and on its own, % divides by 100, so 200 × 10% is 20 and 50% is 0.5.

What do MC, MR, M+ and M− do?

They keep one number while you calculate. M+ adds the number on the display to memory, M− subtracts it, MR puts the stored number back on the display and MC empties memory. Memory is empty when the page opens and lasts until you leave or reload it.

What is the difference between CE and C?

CE clears only the number you are typing, so you can fix it without losing the rest: 25 + 17, CE, 18, == gives 43. C clears the whole calculation. After an error, either key starts again.

Why does 0.1 + 0.2 give exactly 0.3 here?

Many programs store numbers in binary, where 0.1 has no exact value, and show 0.30000000000000004. This calculator works in decimal, with 40 digits behind the display, so sums of prices and measurements come out exact.

Link with your values

Add these parameters to this page’s address to open it with the values filled in, for example to share a calculation or to link to it from an AI assistant. The result is calculated in the browser: the page HTML shows an example for the default values, and the tool sets the data-url-params attribute once the link’s values are applied.

ParameterValueIf omitted
expressionCalculationtext in the tool's notation, see the examplesrequired

Examples

  • ?expression=200*10%25
  • ?expression=1250*1.08
  • ?expression=0.1%2B0.2
  • ?expression=12.5*8-10%25

Write decimals with a point. Encode a space as %20, + as %2B, # as %23 and & as %26.

Result elements: [data-result-block="basic_calculator"]