CalcTrace

Rounding Calculator

Round a number to a set number of decimal places or significant figures, or to the nearest ten, hundred, quarter, eighth or any step you choose. Five rounding rules are compared side by side. The arithmetic is done on the decimal digits you type, so awkward cases such as 1.005 come out right.

Last updated .

Number and method

Round to

The table in the result compares all five rules, whichever you pick here.

Result

Rounded value

–

Show the working

    How rounding works

    Rounding replaces a number with the nearest value on a coarser grid. Every method on this page is the same calculation with a different grid spacing, called the step.

    rounded value = step × round(number ÷ step)

    Here step is the spacing of the allowed values and round( ) turns its argument into a whole number using the chosen rule. For two decimal places the step is 0.01. For the nearest hundred it is 100. For the nearest eighth it is 1/8. Significant figures work the same way, except the step depends on the size of the number: it is the place value of the last digit you keep.

    The five rounding rules

    The rules only disagree about what happens to the part left over after dividing by the step.

    RuleWhat it does2.5−2.5
    Half upNearest value; an exact half goes away from zero3−3
    Half evenNearest value; an exact half goes to the even neighbour2−2
    UpAlways to the larger value (ceiling)3−2
    DownAlways to the smaller value (floor)2−3
    Towards zeroDrops the extra digits (truncation)2−2

    “Half up” is the rule taught at school: look at the first digit being dropped, and if it is 5 or more, raise the last kept digit. For negative numbers this page applies it to the size of the number, so −2.5 becomes −3. Some software instead sends every half towards positive infinity, giving −2; the comparison table makes the difference visible.

    Worked example: 1.005 to two decimal places

    1. Find the step. Two decimal places means a step of 0.01.
    2. Find the two neighbours. 1.005 lies between 1.00 and 1.01.
    3. Look at the digit being dropped. The third decimal is 5 with nothing after it, so 1.005 is exactly halfway.
    4. Apply the rule. Half up raises the last kept digit, giving 1.01. Half even looks at the two neighbours’ last digits, 0 and 1, and picks the even one, giving 1.00.

    Most calculators, spreadsheets and programming languages get this one wrong under the half-up rule and return 1.00. They store numbers in binary, where 1.005 cannot be written exactly; the nearest value they can hold is 1.00499999999999989…, which is just below halfway. The same thing turns 2.675 into 2.67 instead of 2.68. This calculator works on the decimal digits themselves, so it gives 1.01 and 2.68.

    Significant figures and “nearest” rounding

    Significant figures count from the first non-zero digit, wherever the decimal point is. 12,345 to two significant figures is 12,000, and 0.004567 to two significant figures is 0.0046. Leading zeros are never counted; they only position the decimal point.

    Rounding to the nearest ten or hundred is the same idea with a fixed step: 1,234 is 1,230 to the nearest ten and 1,200 to the nearest hundred. Fraction steps are useful for measurements: 17.3 to the nearest quarter is 17.25, and 2.37 to the nearest eighth is 2.375, or 2 3/8. In Australia, cash totals are rounded to the nearest 5 cents because 1 and 2 cent coins are no longer in circulation: $17.83 becomes $17.85 and $17.82 becomes $17.80.

    Choosing a rule and avoiding errors

    Half up drifts upwards over many numbers

    Because every exact half is pushed the same way, totals of half-up-rounded figures creep up. Take 0.5, 1.5, 2.5 and 3.5, which add to 8. Rounded half up they become 1, 2, 3 and 4, which add to 10. Rounded half even they become 0, 2, 2 and 4, which add to 8. That is why half even is the default in accounting systems, in the IEEE 754 standard for computer arithmetic and in many statistics packages.

    Round once, at the end

    Rounding a number that has already been rounded can give a different answer. 2.449 to the nearest whole number is 2. But round it in stages, first to 2.45, then to 2.5, then to a whole number, and half up produces 3. Keep full precision through a calculation and round only the final result.

    Up and down are not the same as away from and towards zero

    For positive numbers “down” and “towards zero” agree. For negative numbers they split: −2.5 rounded down is −3, but rounded towards zero it is −2. Use “up” when a shortfall is unacceptable, such as the number of tiles to buy, and “towards zero” when only completed units count, such as a person’s age in whole years.

    Keep the trailing zeros

    2.5 rounded to two decimal places is 2.50, not 2.5. The final zero says the value is known to the hundredths, so the calculator always shows the number of places you asked for.