Skip to main content

Decimal Calculator

Work with decimal numbers exactly: add, subtract, multiply and divide them, turn decimals into fractions and fractions into decimals (repeating ones included), round to any place, and compare or order a list of decimals. Every answer comes with a diagram and every step shown with your own numbers.

Background

A decimal is a number written in place-value shorthand: the digits after the point count tenths, hundredths, thousandths and so on. Because each place is worth ten times less than the one on its left, decimals behave just like whole numbers once their points are lined up. Adding, subtracting and comparing work column by column, multiplying is whole-number multiplication with the point put back at the end, and every fraction turns into a decimal that either stops or repeats forever.

Set up your calculation

Step 1 — What do you want to do?

Pick a task below.

Step 2 — Enter the two numbers

decimal; negatives allowed

decimal; not 0 when dividing

Step 2 — Enter the decimal

type repeating digits in parentheses: 0.(3) means 0.333…, 0.1(6) means 0.1666…

Step 2 — Enter the fraction

for a mixed number like 2 3/16; put a minus sign here for a negative

whole number; may be larger than the denominator

whole number above 0

Step 2 — Choose what to round and how

decimal; negatives allowed

the place value you want to keep

Step 2 — Enter the numbers to compare

separate with spaces, commas or semicolons; no thousands separators

Step 3 — Precision

only used when an answer never ends; every other answer is exact

Learning options

Result

No result yet. Enter your numbers above and click Calculate.

How to use this calculator

  • Choose Calculate to add, subtract, multiply or divide two decimals exactly. Division shows a repeating block when the answer never ends.
  • Choose Decimal → Fraction to turn a decimal into a simplified fraction, mixed number and percent. Type repeating digits in parentheses, like 0.(3) or 0.1(6).
  • Choose Fraction → Decimal to divide top by bottom. Add a whole-number part to enter a mixed number, like 2 3/16.
  • Choose Round to round to any place from hundreds to millionths, with standard, banker's, truncate, ceiling or floor rules.
  • Choose Compare & Order, then type several decimals separated by spaces to put them in order and see which place decides.
  • Click Calculate to see the result, a callout explaining what it means, a diagram for that task and every step with your numbers substituted. Use the quick examples to see interesting cases.

How decimals work

1

A decimal is a number written in place-value shorthand. Each digit after the point is worth ten times less than the one before it: tenths, hundredths, thousandths, and so on. 0.375 means 3 tenths + 7 hundredths + 5 thousandths.

2

Adding zeros to the right of the last decimal digit never changes the value: 0.5 = 0.50 = 0.500. This is the key to adding, subtracting and comparing, because it lets you give every number the same number of decimal places.

3

To add or subtract, line up the decimal points, pad with zeros, then work column by column exactly as you would with whole numbers. The point in the answer stays in the same column.

4

To multiply, ignore the points and multiply as whole numbers. Then count the decimal places in both factors and put the point that many places from the right of the product.

5

To divide, move both points right by the same number of places until the divisor is a whole number, then do long division. The quotient is unchanged because both numbers are scaled by the same factor.

6

A fraction becomes a decimal by dividing top by bottom. The long division either reaches a zero remainder (a terminating decimal) or meets a remainder it has seen before, after which the digits repeat in a cycle.

7

A decimal becomes a fraction by writing its digits over a power of ten and simplifying. For a repeating decimal, subtract two shifted copies of the number so the repeating tails cancel, then solve for the number.

8

To round, find the two neighbours at the chosen place, then pick the closer one. The shortcut is to look at the digit right after that place: 5 or more goes up, 4 or less stays. To compare decimals, pad to equal length and read from the left.

Formulas & Equations Used

Place value: 0.d₁d₂d₃ = d₁/10 + d₂/100 + d₃/1000

Add / subtract (same places): A ± B = (a ± b) / 10ˢ,   s = most decimal places in A or B

Multiply: A × B = (a × b) / 10^(s₁ + s₂)

Divide by moving the points: A ÷ B = (a × 10^s₂) ÷ (b × 10^s₁) = N / D,   then simplify by gcd(N, D)

Decimal to fraction (terminating): 0.d₁…dₙ = (d₁…dₙ) / 10ⁿ,   then divide by the gcd

Decimal to fraction (repeating): I.F(R) = (IFR − IF) / [10ᵃ(10ᵇ − 1)],   a = digits in F, b = digits in R

Fraction to decimal: long division: dᵢ = ⌊10 rᵢ / D⌋,   rᵢ₊₁ = 10 rᵢ mod D

Does it terminate? In lowest terms, N/D terminates exactly when D = 2ᵐ · 5ⁿ

Rounding to p places: round(x) = ⌊x · 10ᵖ + ½⌋ / 10ᵖ   (standard, for x ≥ 0)

Percent: x% = x × 100,   so 0.375 = 37.5%

Example Problems & Step-by-Step Solutions

Example 1 — Adding without rounding error

Add 0.1 + 0.2.

Step: Pad to the same places: 0.1 → 0.10 and 0.2 → 0.20. Add as whole numbers of hundredths: 10 + 20 = 30. Put the point 2 places from the right: 0.30.

Result: 0.3, exactly. A computer using binary floating point shows 0.30000000000000004, because 0.1 and 0.2 cannot be stored exactly in binary.

Example 2 — Subtracting different lengths

Subtract 12.5 − 3.875.

Step: Pad 12.5 to 12.500 so both have 3 places. Then 12500 − 3875 = 8625 thousandths. Put the point 3 places from the right.

Result: 8.625. Check: 12.5 − 4 = 8.5, and 8.625 is just a little more.

Example 3 — Multiplying decimals

Multiply 0.25 × 0.4.

Step: Ignore the points: 25 × 4 = 100. The factors have 2 + 1 = 3 decimal places, so the answer has 3: 0.100.

Result: dropping the trailing zeros, 0.25 × 0.4 = 0.1. In fractions: 25/100 × 4/10 = 100/1000 = 1/10.

Example 4 — Dividing by a decimal

Divide 7.2 ÷ 0.09.

Step: The divisor has 2 decimal places, so multiply both numbers by 100: 7.2 → 720 and 0.09 → 9. Now 720 ÷ 9 = 80.

Result: 80. The quotient is unchanged because both numbers were scaled by the same factor.

Example 5 — A division that never ends

Divide 1 ÷ 3.7.

Step: Multiply both by 10 to get 10 ÷ 37. Long division: 10 ÷ 37 = 0 r 10; 100 ÷ 37 = 2 r 26; 260 ÷ 37 = 7 r 1; 10 ÷ 37 = 0 r 10. The remainder 10 has come back.

Result: 0.270270… written 0.(270), with the block 270 repeating forever. To 4 places that is 0.2703.

Example 6 — Decimal to fraction

Write 0.375 as a fraction.

Step: 3 digits after the point means thousandths: 375/1000. gcd(375, 1000) = 125, so divide top and bottom by 125.

Result: 3/8, which is 37.5%.

Example 7 — Repeating decimal to fraction

Write 0.1666… = 0.1(6) as a fraction.

Step: Let x = 0.1666…. Then 10x = 1.666… and 100x = 16.666…. Subtract: 90x = 15, so x = 15/90.

Result: 1/6 after dividing top and bottom by 15.

Example 8 — Fraction to decimal

Write 1/7 as a decimal.

Step: 10÷7 = 1 r 3; 30÷7 = 4 r 2; 20÷7 = 2 r 6; 60÷7 = 8 r 4; 40÷7 = 5 r 5; 50÷7 = 7 r 1; and the remainder 1 is where we started.

Result: 0.142857142857…, a repeating block of 6 digits. 7 is not made of 2s and 5s, so it must repeat.

Example 9 — Rounding with a carry

Round 9.996 to the hundredths place.

Step: The neighbours are 9.99 and 10.00. The digit after the hundredths place is 6, which is 5 or more, so round up: 9.99 + 0.01.

Result: 10.00. The 9s turn into zeros and the carry reaches the ones place.

Example 10 — Ordering decimals

Order 0.5, 0.4999, 0.35 and 0.05 from smallest to largest.

Step: Pad to 4 places: 0.5000, 0.4999, 0.3500, 0.0500. Compare the tenths digit first: 0, 3, 4, 5.

Result: 0.05 < 0.35 < 0.4999 < 0.5. The longest decimal (0.4999) is not the largest.

Frequently Asked Questions

Why does a computer say 0.1 + 0.2 = 0.30000000000000004?

Most programming languages store decimals in binary floating point, and 0.1 and 0.2 have no exact binary form, so tiny errors creep in. This calculator works with whole numbers underneath and tracks the decimal point separately, so every answer is exact.

Do trailing zeros change a decimal?

No. 0.5, 0.50 and 0.500 are the same number. Zeros after the last non-zero digit on the right of the point can be added or dropped freely. Zeros between the point and the first non-zero digit (as in 0.05) do matter.

Why must decimal points line up when adding?

Digits can only be added when they are worth the same amount. Lining up the points puts tenths over tenths and hundredths over hundredths, so each column can be added on its own.

How many decimal places does a product have?

The sum of the decimal places of the two factors. 0.25 has 2 and 0.4 has 1, so the product has 3 places: 0.100, which is 0.1 once the trailing zeros are dropped.

Why does moving both points not change a quotient?

Multiplying the dividend and the divisor by the same power of ten is like multiplying the top and bottom of a fraction by the same number. The value is unchanged, but the divisor becomes a whole number, which is easier to divide by.

When does a fraction give a terminating decimal?

When, in lowest terms, the denominator has no prime factors other than 2 and 5. Those are the prime factors of 10, so the fraction can be written over 10, 100, 1000 and so on. Any other prime factor, such as 3 or 7, forces the decimal to repeat.

Is 0.999… really equal to 1?

Yes. If x = 0.999…, then 10x = 9.999…, and subtracting gives 9x = 9, so x = 1. Put differently, there is no number between 0.999… and 1, so they must be the same number.

How do I type a repeating decimal?

Put the repeating digits in parentheses after the point. Use 0.(3) for 0.333…, 0.1(6) for 0.1666…, and 0.(142857) for 0.142857142857…. Three dots on their own cannot show where the pattern begins.

What is banker's rounding?

It is the same as the usual rule except that an exact tie (a 5 with nothing after it) goes to the neighbour whose last digit is even. So 2.5 becomes 2 and 3.5 becomes 4. Over many numbers it avoids always nudging the total upward.

How does the calculator compare decimals?

It pads every number with zeros to the same number of decimal places, then compares them place by place from the left. The first place where they differ decides, which is why 0.5 is bigger than 0.4999 even though it is shorter.

Back to all calculatorsAll calculators