Decimal Calculator – Add, Subtract, Multiply and Divide Decimals Exactly

0.1 + 0.2 = 0.3 exactly — digit-by-digit maths, no floating-point drift.

100% FreeNo sign-up neededInstant results

Your two decimals

Decimal places apply to division only — addition, subtraction and multiplication are always exact to the last digit.

Trailing zeros are trimmed from answers: 40.00 is written as 40, and 2.50 as 2.5 — the value is identical, just tidier. Negative numbers are welcome.

🔒 Everything is calculated in your browser — your numbers never leave your device.

Advanced options — percent, power, square root, chained operations, rounding modes

—

—

—

—

—

Evaluated strictly left to right, as written: (first operation second) operation third. Division steps are shown to 10 places.

—

The Advanced figures below are worked out with the same exact whole-number arithmetic as the main calculator where an exact answer exists — open Advanced options to use them.

Percent, power, square root, chained operations, rounding modes are already included in the result with their default values — open Advanced options to change them.

Your exact answer

Result
0.3
0.1 + 0.2 = 0.3 — exact, digit for digit.
Status
Exact
Counted with whole digits, so nothing was rounded away.
Decimal places shown
1
Digits after the decimal point in the answer above.
Ordinary float maths
0.30000000000000004
What a typical floating-point calculator makes of the same sum — close, but not exact.
Copied ✓

Most calculators quietly round behind your back — that is how 0.1 + 0.2 turns into 0.30000000000000004. This one counts digit by digit with whole-number maths, so addition, subtraction and multiplication are exact to the last digit, division shows its remainder honestly, and the long-arithmetic working is laid out step by step.

Key takeaways

  • Addition, subtraction and multiplication here are exact, digit for digit, because the calculator works in whole numbers behind the decimal point.
  • Division is the honest exception: a repeating decimal is shown to your chosen places with its remainder stated, never silently rounded away.
  • Rounding is a choice, not a default: half-up, half-even and truncation disagree on ties, and the Advanced panel lets you pick.

The working, step by step — and the float trap

On the left, the long arithmetic behind your answer, exactly as it would be done on paper: the decimal points are lined up, the numbers are scaled into whole digits, and the point is put back at the end. On the right, the trap this page avoids.

Long-arithmetic steps
  0.1
+ 0.2
─────
  0.3

Scaled to 1 decimal place: 1 + 2 = 3, then the decimal point goes back 1 place — the answer is exact, digit for digit.

⚠ The float trap

Ask most computers to add the two decimals in the classic test case and they answer 0.1 + 0.2 = 0.30000000000000004 — because 0.1 has no exact binary form, the stored values are already slightly off before the adding even starts.

This calculator never stores your numbers that way. It counts whole digits, so the same sum comes out as it should:

0.1 + 0.2 = 0.3

Your current sum in ordinary floating point: 0.30000000000000004

Keep exploring

Decimals rarely travel alone — these neighbours handle the rounding, the fractions and the very large and very small.

How it works in three steps

1

Hide the decimal points

Every decimal is a whole number wearing a point: 0.1 is 1 tenth, 12.5 is 125 tenths. The calculator scales both numbers into whole digits by the same power of ten.

2

Do whole-number maths

Whole digits can be added, subtracted and multiplied with no rounding at all, however long they get. Division is done by long division, digit by digit, with the remainder tracked openly.

3

Put the point back

The point returns to its proper place and trailing zeros are trimmed. If a division still has a remainder at the places you chose, the page says so instead of pretending the answer is exact.

How exact decimal arithmetic is worked out

0.1 + 0.2 = 1 tenth + 2 tenths = 3 tenths = 0.3 exactly

The anchor example: 0.1 + 0.2. Scaled to one decimal place, both numbers become whole: 1 + 2 = 3, and the point goes back one place to give 0.3. A floating-point calculator stores 0.1 as a binary fraction that is already a hair too big, which is where its famous 0.30000000000000004 comes from. Counting tenths as whole digits leaves no room for that error.

Multiplication, by partial products: 12.5 × 3.2 is counted as 125 × 32. The partial products are 125 × 2 = 250 and 125 × 3 = 3750 (the 3 is worth ×10 in its place), which add to 4000. The two numbers carry 1 + 1 = 2 decimal places between them, so 4000 becomes 40.00 — written as 40 once the trailing zeros are trimmed.

Subtraction with a negative answer: 5.55 − 7.7. Scaled to two decimal places the sum is 555 + (−770) = −215, and the point goes back two places: −2.15. Aligning the columns to the longer of the two scales is what keeps tenths from being subtracted from hundredths.

Numbers too big for ordinary calculators: 99999999999999999999 + 1 = 100000000000000000000. Floating point cannot even store the +1 at that size — the smaller number simply vanishes into the bigger one — while whole-digit counting handles all twenty digits, and up to a hundred digits per number on this page.

Division and remainders: 1 ÷ 3 never terminates: each step divides 10 by 3, writes a 3, and leaves a remainder of 1, so the digit repeats forever. Shown to 10 places it is 0.3333333333, and the page notes the leftover remainder rather than dressing the answer up as exact. Divisions that do terminate, like 10 ÷ 4 = 2.5, are shown exactly with no note needed.

Going deeper

A division terminates when the denominator, once the fraction is in its simplest form, is built only from 2s and 5s — the factors of ten. That is why 1 ÷ 8 ends cleanly at 0.125 (8 = 2 × 2 × 2) while 1 ÷ 3 and 1 ÷ 7 repeat forever: their denominators carry a prime factor that ten can never absorb, so every long-division step leaves a remainder and the pattern cycles.

When a division repeats, choosing more decimal places gives a closer approximation but never the exact value — the exact value is the fraction itself. This page shows the digits you asked for, rounds the last one honestly, and prints the remainder it was left holding, so you always know which kind of answer you are looking at.

Computers store most numbers in binary, as sums of halves, quarters, eighths and so on. Some decimals fit that system perfectly — 0.5 and 0.25 do — but 0.1 does not, just as 1 ÷ 3 does not fit neatly into decimal places. The stored version of 0.1 is a fraction of a hair above the real 0.1, and 0.2 is a hair above the real 0.2, so their sum lands a hair above 0.3 and the computer reports 0.30000000000000004.

For most everyday sums that last-digit wobble never matters, which is why floating point is everywhere. It matters when you are checking money to the cent, testing whether two figures match exactly, or working with numbers so large that small additions disappear entirely. Whole-digit counting — the method on this page — avoids the problem for addition, subtraction and multiplication, and keeps division honest by showing its remainder.

Counted digit by digit — never rounded behind your back. 🧮

Repeating decimals: why some divisions never end

Division is the one operation on this page that cannot always be exact in decimal form, and the reason is arithmetic, not a limitation of the tool. A fraction terminates exactly when its denominator, reduced to lowest terms, contains only the prime factors 2 and 5, because the decimal system is built on 2 × 5 = 10. Denominators with any other prime factor produce a repeating block, and the calculator shows that honestly: it prints the result to your chosen places and states that a remainder is left, instead of pretending the decimal ends.

FractionDecimalPattern
1 ÷ 30.3333333333…Digit 3 repeats forever; the long division always leaves remainder 1
1 ÷ 60.1666666666…1, then 6 repeats; denominator 6 = 2 × 3, so one non-repeating digit first
1 ÷ 70.142857142857…Block 142857 repeats, period 6; every seventh is a rotation of the same digits
1 ÷ 90.1111111111…Digit 1 repeats; ninths are the simplest repeating family
1 ÷ 110.0909090909…Block 09 repeats, period 2
2 ÷ 30.6666666666…Digit 6 repeats; twice one third, so the same remainder story
5 ÷ 60.8333333333…8, then 3 repeats; the 2 in the denominator gives one clean digit first

Notation matters because a repeating decimal cannot be written out in full. Mathematicians put a bar over the repeating block, writers use an ellipsis, and this page uses words: it tells you the result is rounded to your chosen places and that the exact value continues past the last digit. The ellipsis and the bar mean the same thing, and neither is an approximation in disguise: 0.333… with the bar is exactly one third, while 0.3333333333 without it is an approximation that is short by one part in ten billion. The long-division working the main calculator shows makes the mechanism visible: dividing 1 by 3, every step is 10 ÷ 3 = 3 with remainder 1, so the next digit is always 3 and the remainder never clears. Dividing 1 by 7 cycles through six remainders before returning to 1, which is why its period is six digits long, and the same six digits, rotated, give two sevenths, three sevenths, and so on.

Choosing decimal places for a repeating result is a judgement, not a correction. Ten places, the default in the example above, is ample for money, measurement and school work, and the remainder note is what keeps it honest: it says the printed digits are the first ten of an unending sequence, not the whole number. For engineering work that needs more, the exact fraction is the right object to carry forward, and the decimal is only its display form.

Rounding modes: three ways to settle a tie, and where each belongs

Rounding to a chosen number of places is unambiguous except on an exact tie, when the digit to be dropped is 5 followed by nothing. Three conventions settle ties differently, and the Advanced options panel lets you apply each one to any number, so the table below is not a claim to take on trust: every cell can be reproduced there.

NumberHalf up, 0 placesHalf even, 0 placesTruncate, 0 places
2.5322
3.5443
−2.5−3−2−2
1.005 to 2 places1.011.001.00
2.675 to 2 places2.682.682.67

Half up is the school rule: on a tie, round away from zero, so 2.5 becomes 3 and −2.5 becomes −3. It is easy to teach and slightly biased upward in absolute value, because ties always move away from zero rather than splitting evenly. Half even, also called banker’s rounding, rounds a tie to the nearest even digit, so 2.5 becomes 2 and 3.5 becomes 4: over many ties the ups and downs cancel, which is why statistics, banking systems and the IEEE floating-point standard use it. Truncation is not rounding at all: it simply drops the extra digits, moving toward zero always, so 2.9 becomes 2 and −2.9 becomes −2, and it systematically understates magnitude. The precision select on the main calculator controls how many places division shows; the rounding mode in Advanced options controls how a number you supply is settled to a chosen places count, and the two settings answer different questions.

One caution belongs with the 1.005 row, because it is the classic trap. In binary floating point, 1.005 is stored as slightly less than 1.005, so a floating-point rounder can return 1.00 where decimal arithmetic returns 1.01 under half up. The Advanced panel here parses the digits you typed, not a binary approximation of them, so 1.005 half-up to two places is 1.01, as the table states. The same digit-exact parsing is what makes the main calculator’s 0.1 + 0.2 equal 0.3: the digits are the data, and no binary detour is allowed to corrupt them.

Percent, power and square root, worked exactly where exactness is possible

Percent is a division by one hundred in disguise, and the Advanced panel does it with the same exact arithmetic as the main calculator. Fifteen percent of 240 is 36, because 15 × 240 = 3,600 and 3,600 ÷ 100 = 36, with no rounding anywhere. Forty-five as a percentage of 180 is 25%, because 45 ÷ 180 = 0.25 and 0.25 × 100 = 25. A price rise works the same way: a $80 item raised by 20% gains $16 and costs $96, and a $96 item reduced by 20% loses $19.20 and costs $76.80, which is why a rise and a fall by the same percentage do not cancel: the second percentage acts on the new, larger or smaller base.

Power with a whole-number exponent is repeated multiplication, and for exponents from 0 to 20 the Advanced panel computes it exactly, digit for digit. Two point five cubed is 15.625, because 2.5 × 2.5 = 6.25 and 6.25 × 2.5 = 15.625. One point two to the tenth power is 6.1917364224, the factor by which a quantity growing 20% per period grows over ten periods, and the exact decimal is worth having because a rounded growth factor, compounded ten times, drifts far from the true one. Negative and fractional exponents are deliberately outside the panel’s range: a negative exponent is a reciprocal, and a fractional exponent is a root, and both deserve their own tools rather than a silently rounded answer.

Square root is the opposite case: an exact decimal answer usually does not exist, so the panel says so and gives ten places. The square root of 2 is 1.4142135624 to ten places, and the digits continue without repeating, because 2 is not a perfect square. The square root of 0.25 is exactly 0.5, because 0.5 × 0.5 = 0.25, and perfect squares and perfect-square decimals are the exception that proves the rule. Use the root for geometry, for the diagonal of a square, for standard deviation inputs, and wherever a squared quantity must be undone, and remember that the tenth place is a display choice, not the value itself.

Chained calculation, left to rightStepsResult
0.1 + 0.2 + 0.30.1 + 0.2 = 0.3, then 0.3 + 0.3 = 0.60.6, exact
2.5 × 4 ÷ 22.5 × 4 = 10, then 10 ÷ 2 = 55, exact
1.5 × 2.4 − 0.61.5 × 2.4 = 3.6, then 3.6 − 0.6 = 3.03.0, exact
(2.5 + 1.5) ÷ 0.82.5 + 1.5 = 4, then 4 ÷ 0.8 = 55, exact, with the bracket done first

Chained operations in the Advanced panel are evaluated strictly left to right, as written, except where brackets group a step first, as in the last row. That order is a stated convention, not the usual precedence rule: ordinary algebra would do multiplication before addition, so 0.1 + 0.2 × 0.3 under precedence is 0.16, while left-to-right it is 0.09. The panel’s convention matches how a running total is built on a simple calculator, keystroke by keystroke, and the panel says so on its face. For anything where precedence matters, group with brackets and evaluate each group with the main calculator, which is exact at every step, rather than trusting a chain to guess your intent.

Decimal places in money, measurement and school work

How many places to show is a decision about the reader, not about the mathematics. Money is shown to two places in most currencies, because the smallest coin is a hundredth of the main unit, and a price computed to more places must be rounded to cents before it can be paid: a bill of $19.995 cannot be settled in cash, and the half-up rule settles it to $20.00 while truncation settles it to $19.99, a difference the customer notices. Measurement follows the instrument: a ruler marked in millimetres justifies one decimal place in centimetres, and quoting a length to four places from such a ruler invents precision the measurement never had. School work follows the question: if the inputs carry two significant figures, an answer carried to ten places is not more accurate, it is merely longer, and the honest answer matches the precision of its inputs.

The precision select on the main calculator is about division display, and it defaults to a sensible middle: enough places to see the pattern of a repeating decimal, few enough to read at a glance. For addition, subtraction and multiplication the places take care of themselves, because exact arithmetic keeps every digit the inputs supplied: 1.20 plus 1.30 is 2.50, and trailing zeros are kept in the working even when a display might trim them, because 2.50 and 2.5 are the same value with different claims about precision. When a result must be shortened for a report, a price or a label, use the rounding panel in Advanced options and say which mode you used: a rounded number without its mode is a claim without its method, and two people rounding the same tie by different modes will honestly disagree by one in the last place.

Comparing decimals: place value decides

Two decimals are compared one place at a time, from the left. The first place where they differ decides, whatever follows it.

Line the numbers up by their decimal points and compare digit by digit, starting with the largest place. For 0.45 and 0.5, the tenths differ at once: 4 tenths against 5 tenths, so 0.5 is larger, and the 5 hundredths in 0.45 cannot rescue it, because one tenth outweighs any number of hundredths. The same rule orders 0.59, 0.6, and 0.605: write them as 0.590, 0.600, and 0.605, and the order reads off the thousandths — 0.59, then 0.6, then 0.605. Adding trailing zeros to the shorter number changes nothing about its value; it only makes the comparison visible, which is why it is the first step in every comparison done by hand.

Trailing zeros are the most common source of false comparisons. The number 0.5, the number 0.50, and the number 0.500 are the same number, because zeros after the last non-zero digit in the fractional part add no value, just as zeros before the first non-zero digit in the whole part add none. The zeros matter only as a statement of precision: 0.50 claims measurement to the hundredth, while 0.5 claims only the tenth, and in money, measurement, and school work the number of places stated is part of the answer, which is why this page keeps the places you choose rather than trimming them. For value alone, strip the trailing zeros and compare what remains; for a reported result, keep the places the setting requires, and let the trailing-zero behaviour described in the rounding section above guide how the result is shown.

On a number line, the rule is visible rather than verbal: 0.45 sits halfway between 0.4 and 0.5, 0.5 sits on the 0.5 mark, and 0.59 sits just short of 0.6, and the left-to-right order on the line is the order of the numbers. The line also shows why a decimal between 0 and 1 is always less than 1 however many digits it carries: 0.9999 is still short of 1, because every place after the point is a fraction of the place before it, and no finite string of them sums to a whole. Comparing decimals is therefore a place-value exercise, not a digit-counting one: the number with more digits is not the larger number, the number with the larger digit in the leftmost differing place is, and the calculator above settles any close call exactly, without the floating-point approximation that makes some calculators report 0.1 plus 0.2 as 0.30000000000000004.

Frequently asked questions

Why do some calculators say 0.1 + 0.2 = 0.30000000000000004?

Because most calculators store numbers in binary floating point, and 0.1 has no exact binary form — the stored value is a tiny amount more than a true tenth. Adding the equally approximate 0.2 gives a result a tiny amount more than 0.3, printed as 0.30000000000000004. This calculator counts in whole digits instead: 0.1 is treated as exactly 1 tenth, so the sum is exactly 3 tenths, or 0.3.

How does this decimal calculator add decimals exactly?

It removes the decimal points by scaling: 0.1 and 0.2 become the whole numbers 1 and 2, in tenths. Whole numbers are added, subtracted or multiplied exactly, with no rounding however long they grow, and then the decimal point is put back in the correct place. The steps panel on this page shows that working for your own numbers, aligned columns and all.

What does the remainder note mean when I divide?

It means the division had not finished at the decimal places you chose. Dividing 1 by 3 leaves a remainder of 1 at every step, so the 3s repeat forever and 0.3333333333 is the answer cut at 10 places, not the exact value. When a division does finish — the remainder reaches zero, as with 10 ÷ 4 = 2.5 — the answer is exact and no note appears.

Why is 12.5 × 3.2 shown as 40 and not 40.00?

Because the trailing zeros carry no value: 40.00 and 40 are the same number. The exact product is 125 × 32 = 4000 with two decimal places put back, giving 40.00, and this page trims trailing zeros from every answer for tidiness. The value is untouched — only the decoration is removed. The same rule turns 2.50 into 2.5 and 0.10 into 0.1.

How many decimal places should I choose for division?

Two places suits money, since cents are hundredths. Three to six places suit most measurements and unit conversions. Choose more when you are feeding the result into another calculation, because each rounding discards a little accuracy. Remember that extra places only help when the division terminates or you genuinely need the precision — for a repeating decimal, no number of places makes the answer exact, and the remainder note will tell you so.

How big a number can this calculator handle?

Each number can be up to 100 digits long, and the arithmetic stays exact at any size that fits — 99999999999999999999 + 1 gives the full 100000000000000000000, where an ordinary floating-point calculator loses the +1 entirely. That headroom covers money totals, long measurements and textbook big-number exercises with room to spare.

How do I write a repeating decimal?

Put a bar over the repeating block, or use an ellipsis: one third is 0.333… with the bar over the 3, and one seventh is 0.142857142857… with the block 142857 repeating. The bar or ellipsis means the digits continue forever, so 0.333… is exactly one third, while 0.3333333333 without it is an approximation short by one part in ten billion.

Which rounding mode should I use?

For school and everyday work, half up is the usual rule: ties round away from zero, so 2.5 becomes 3. For statistics and banking systems, half even (banker’s rounding) is standard, because ties round to the nearest even digit and cancel out over many roundings: 2.5 becomes 2 and 3.5 becomes 4. Truncation just drops digits toward zero and systematically understates magnitude. The Advanced options panel applies all three to any number you enter.

What is 15 percent of 240, and what is 45 as a percentage of 180?

Fifteen percent of 240 is 36, because 15 × 240 ÷ 100 = 36, and 45 as a percentage of 180 is 25%, because 45 ÷ 180 × 100 = 25. Both are worked exactly in the Advanced options panel, with no rounding anywhere in the arithmetic.

Can this calculator do powers and square roots?

The Advanced options panel does whole-number powers from exponent 0 to 20 exactly, digit for digit: 2.5 cubed is 15.625 and 1.2 to the tenth is 6.1917364224. Square roots are given to ten places and labelled approximate, because most roots are irrational: the square root of 2 is 1.4142135624 to ten places, while the square root of 0.25 is exactly 0.5.

How do you compare two decimals to tell which is larger?

Line them up by the decimal point and compare digit by digit from the left, starting with the largest place. The first place where the digits differ decides: 0.45 against 0.5 is decided at the tenths, 4 against 5, so 0.5 is larger. Adding trailing zeros to the shorter number, 0.45 against 0.50, makes the comparison visible without changing either value. The number with more digits is not automatically larger; the leftmost differing digit decides.

Is 0.5 the same number as 0.50?

Yes, in value. Trailing zeros after the last non-zero digit in the fractional part add no value, so 0.5, 0.50, and 0.500 are the same number. The zeros matter only as a statement of precision: 0.50 claims measurement to the hundredth, while 0.5 claims only the tenth. In money and measurement, keep the places the setting requires; for value alone, strip the trailing zeros and compare what remains.

Why does dividing by a decimal smaller than 1 give a larger answer?

Because division asks how many times the divisor fits into the dividend, and a divisor smaller than 1 fits more than once into a whole. Dividing 6 by 0.5 asks how many halves are in 6, and the answer is 12, which is larger than 6. The same logic runs the other way: multiplying by a decimal smaller than 1 gives a smaller answer, because it takes a fraction of the number. The calculator above works both exactly; the surprise is in the meaning of the operation, not in the arithmetic.

Related calculators

Related guides

Please note: This calculator performs exact decimal arithmetic on the numbers you type. Where a real-world figure is involved — money owed, a dose, a measurement — the rules of that setting (how many places to round to, which way to round) still apply, so check them before relying on the figure. Nothing you type is stored.