Appearance

Basic Calculator

/simple-calculator/

0

Related tools

Comments

0/500

About this tool

When an online calculator is the quickest option

Every phone has a calculator app, but when you are at a computer a browser tab is often faster. A quick total that does not justify opening a spreadsheet, double-checking how to split a bill before sending it in a chat, or adding up a shopping cart are typical cases where you chain a few numbers together. This calculator is built for those short calculations and behaves like a basic phone calculator.

Read moreShow less

Press the on-screen keys or type directly with the number row or numeric keypad. It accepts digits, the + - * / keys, Enter or = for the result, Backspace to delete one digit, Esc or Delete to clear everything, and % for percent. The decimal point can be typed with either the period or the comma key, so it works with keypads that use a different layout.

How the calculator works in the order you press keys

Internally it is a small state machine that updates with every key. It remembers the number on screen, the value calculated so far and the pending operator, and it evaluates the expression the moment you press a new operator. So 2 + 3 × 4 = first finishes 2 + 3 to make 5, then multiplies by 4 to give 20. Applying the multiplication-first rule from school would give 14, but phone calculators and most desktop calculators work left to right like this. The calculator never runs your input as code through eval or similar methods.

JavaScript, like most programming languages, stores numbers as IEEE 754 double-precision binary floating point. Because 0.1 has no exact binary form, 0.1 + 0.2 is 0.30000000000000004 and 1.1 × 1.1 is 1.2100000000000002. This calculator rounds results to 12 significant digits and shows 0.3 and 1.21. Conversely, 1 ÷ 3 = is cut off at 0.333333333333, and pressing × 3 = next gives 0.999999999999 rather than 1, because after = the number shown on screen is what carries into the next calculation. Pressing 1 ÷ 3 × 3 = in one go, without the intermediate =, keeps the internal value and gives 1.

Input accepts up to 16 digits, not counting the sign and decimal point. The largest integer that can be stored exactly is 2 to the power of 53 minus 1, or 9,007,199,254,740,991, so beyond that the last digits are not exact. The true answer to 99999999 × 99999999 is 9999999800000001, but the result shows 9999999800000000, and larger results switch to exponent notation such as 9.99999999998e+23.

Using the online calculator in everyday situations

To split a dinner bill, enter the total, then ÷ the number of people and =. Pressing an operator after a result continues from that value, so 50000 × 3 = followed by - 20000 = gives 130000. If you press the wrong operator, pressing another one right away replaces it, so 7 + × 3 = gives 21.

The % key simply divides the number on screen by 100. 200 × 15 % = means 200 × 0.15 and gives 30, which is the most natural order for finding a discount or fee. To add a rate to the original value, such as 10% VAT, multiply instead: 50000 × 1.1 = gives 55000. Students checking homework should remember that operator precedence is not applied, so enter expressions that need parentheses one part at a time. Copy puts the result straight on your clipboard.

Limits of the basic calculator

The most common surprise is expecting 10 + 5 % to give 10.5. Some phone calculators read this as adding 5% of 10, but here 5 % becomes 0.05, so the answer is 10.05. For percent changes and discounted prices, the percentage calculator on this site is the better tool.

Pasting several numbers at once is not supported; expressions are entered one key at a time. Dividing by 0 shows an error, after which only digits, the decimal point and clear are accepted. There are no parentheses, square root or memory (M+) functions, and no calculation history is kept. For large amounts that must be exact, such as tax returns or accounting records, double-check in dedicated software given the 16-digit limit and the rounding. All calculation happens in your browser and the numbers you enter are not sent to a server.

FAQ

Why does 2 + 3 × 4 give 20 instead of 14?

Like a basic phone calculator, it evaluates the previous expression as soon as you press an operator. 2 + 3 becomes 5 first and is then multiplied by 4. To multiply first, calculate 3 × 4 = and then press + 2.

Does 0.1 + 0.2 come out as exactly 0.3?

Yes. The computer calculates 0.1 + 0.2 as 0.30000000000000004, but the result is rounded to 12 significant digits and shown as 0.3. However, 1 ÷ 3 = followed by × 3 = gives 0.999999999999, because the rounded value on screen is reused.

How does the % key work?

It divides the number currently on screen by 100. 200 × 15 % = gives 30, and 10 + 5 % = gives 10.05. To add or subtract a percentage of a value, the percentage calculator is the right tool.

What keyboard shortcuts does the calculator support?

Digits, + - * /, Enter and = for the result, Backspace to delete one digit, Esc and Delete to clear all, %, and the decimal point with either period or comma. Combinations with Ctrl or Cmd are passed through to the browser as usual.

Can it handle very large numbers?

Input accepts up to 16 digits, and large results switch to exponent notation such as 9.99999999998e+23. Integers above 9,007,199,254,740,991 may not be exact in their last digits.

Are the numbers I enter saved or sent anywhere?

No. Calculation happens only in your browser, with nothing sent to a server and no history kept. Closing the page clears the numbers on screen.