Calculator

Rounding Numbers Correctly, Including the Tricky Cases

What rounding does

Rounding replaces a number with a simpler one that is close to it. You round when extra digits add nothing useful: a length measured with a ruler, a price shown in cents, a result shown to two decimal places. The key is to decide how precise the result should be, and then to round only once, at the end.

The usual rule: round half up

To round to a chosen position, look at the next digit to the right.

  1. If it is 0, 1, 2, 3 or 4, leave the kept digit alone (round down).
  2. If it is 5, 6, 7, 8 or 9, add one to the kept digit (round up).
  3. Drop everything after the kept position, or replace it with zeros for whole numbers.

Only the single next digit matters. 2.4999 rounds to 2 at the nearest whole number, even though it is very close to 2.5.

Rounding up and rounding down on purpose

Sometimes "nearest" is not what you need. Practical problems often force one direction.

Negative numbers

Negative numbers are where the different methods stop agreeing. "Down" means towards minus infinity, so rounding −2.7 down gives −3, not −2.

NumberNearest (half away from zero)Round down (floor)Round up (ceiling)Truncate
2.73232
−2.7−3−3−2−2
2.53232
−2.5−3−3−2−2

For −2.5, the school rule "round half away from zero" gives −3. Some software instead rounds halves towards positive infinity, which gives −2. Both are in real use, so if a temperature or a negative balance in a spreadsheet looks off by one, check which rule the program applies.

Round half to even

There is one more rule worth knowing. Always rounding halves upwards pushes totals slightly upwards over many numbers. To balance this, statistics and some software use round half to even (sometimes called banker's rounding): a value exactly halfway goes to the nearest even digit.

Half the halfway cases go up and half go down, so the errors cancel out on average. Only exact halves are affected; 2.51 still rounds to 3.

Decimal places versus significant figures

Decimal places count digits after the decimal point. Significant figures count digits from the first non-zero digit, wherever the decimal point is. They are different tools.

Number2 decimal places2 significant figures
0.0045670.000.0046
3.141593.143.1
123,456123,456.00120,000

Decimal places suit money and measurements on a fixed scale. Significant figures suit science, where numbers range from tiny to huge: 0.004567 to 2 decimal places loses everything, while 2 significant figures keeps the useful part. Leading zeros never count (0.0046 has 2 significant figures), but zeros after the point at the end do: writing 0.0500 says you measured to 3 significant figures.

Why rounding twice causes errors

Round once, from the full value, to the precision you need. Rounding in stages can move the result.

Rounding too early inside a calculation does similar damage. 1.26 × 40 = 50.4, but if you first round 1.26 to 1.3, you get 1.3 × 40 = 52, an error of 1.6 created by a "small" rounding. Keep full values on the calculator and round only the final answer.

Rounded parts also do not always add up to a rounded total. Split 100 three ways and each share is 33.33 to two decimal places, but 3 × 33.33 = 99.99. Survey charts that show 33%, 33% and 33% add up to 99% for the same reason. That is not a mistake; it is a side effect of rounding each part separately.

Why computers show 0.1 + 0.2 = 0.30000000000000004

Computers store numbers in binary (base 2). In binary, 0.1 cannot be written exactly, just as 1/3 cannot be written exactly in decimal (0.3333…). The computer stores the closest binary value it can, which is very slightly off. Add two slightly-off values and the tiny errors can show up in the 17th digit.

This is not a bug in a particular app; it is how standard computer arithmetic works. The same effect explains why some programs round 2.675 to 2.67 instead of 2.68: the stored value is really a hair below 2.675. The calculators on this site round every result to 12 significant digits before showing it, so 0.1 + 0.2 appears as 0.3, which matches the maths. You can try it in the basic calculator or the scientific calculator.

Common mistakes

Rounding and percentages often meet, so the percentage guide and the fractions and decimals guide are good next reads.

FAQ

Is 0.5 rounded to 0 or 1?
With the usual school rule it rounds up to 1. With round half to even it becomes 0, because 0 is even.

How many decimal places should I give?
Match the precision of your least precise input. If lengths were measured to the nearest millimetre, an answer to a thousandth of a millimetre suggests a precision you do not have.

Why does a total in a table differ from the sum of the rows?
Each row was rounded on its own. The total is usually calculated from the unrounded values, so small differences of one in the last digit are normal.

Open the calculator: Calculator →

Related guide