Rounding Calculator

Type a number, choose what to round to and how ties are handled. Every method is shown side by side, and the digits are rounded exactly as you typed them.

How rounding works

Rounding replaces a number with a nearby, simpler one: a value with fewer decimal places, fewer significant figures, or a multiple of some step such as 0.25 or 100. Every kind of rounding comes down to the same question — which two multiples of the step does the number lie between, and which of the two do we keep?

rounded = k × step, where k is an integer chosen from ⌊x ÷ step⌋ or ⌈x ÷ step⌉

Rounding to 2 decimal places uses a step of 0.01; rounding to the nearest hundred uses 100 (or −2 decimal places); rounding to 3 significant figures uses a step set by the first non-zero digit, so 0.004520 rounds in steps of 0.00001 and 123,456 in steps of 1,000.

The digit just after the last kept place decides the direction. When it is below 5 the number is rounded down, above 5 it is rounded up, and exactly 5 with nothing after it is a tie — the case where the rounding methods differ.

The rounding methods compared

Method2.53.5−2.52.1−2.9
Half up (toward +∞)34−22−3
Half down (toward −∞)23−32−3
Half to even (banker's)24−22−3
Half away from zero34−32−3
Half toward zero23−22−3
Ceiling34−23−2
Floor23−32−3
Truncate23−22−2
Away from zero34−33−3

Half away from zero is the rule taught in most schools and used by spreadsheet ROUND functions; for positive numbers it is the same as half up. Half to even, also called banker's rounding, is the default in the IEEE 754 floating-point standard and in many programming languages. Because ties go up half the time and down half the time, it does not drift upward when thousands of values are rounded and added. Ceiling, floor and truncate ignore the half-way point entirely: ceiling is used when you must not run short (how many boxes or buses you need), floor and truncate when only complete units count.

Worked example: why 2.675 rounds to 2.68 here

With the default settings — 2.675, two decimal places, round half up — the step is 0.01. Dividing gives 2.675 ÷ 0.01 = 267.5, so the answer is either 2.67 or 2.68. The deciding digit is 5 with nothing after it, an exact tie, and round half up picks the larger value: 2.68. Banker's rounding also gives 2.68 because 8 is even, while half down, floor and truncate give 2.67.

Many programs get this wrong. The decimal 2.675 cannot be stored exactly in binary floating point; the nearest double is 2.67499999999999982236431605997495353221893310546875, so a naive round(2.675, 2) returns 2.67. This calculator never converts your number to binary: it rounds the exact decimal digits you typed, so 1.005 becomes 1.01 and numbers with 30 or more digits are handled without loss.

Tips for rounding correctly

  • Round only once, at the end. Rounding 2.45 to 2.5 and then to 3 gives a different answer from rounding 2.45 straight to a whole number (2).
  • Keep trailing zeros that are significant: 2.995 rounded to two decimals is 3.00, not 3, and 0.0999 to two significant figures is 0.10.
  • For prices to the nearest nickel or quarter, use the Nearest… option with 0.05 or 0.25. For rounding to sig figs in science, see the significant figures calculator.

Frequently asked questions

What is banker's rounding?

Banker's rounding (round half to even) rounds exact ties to the nearest even digit: 2.5 → 2, 3.5 → 4, 2.665 → 2.66. Other values round normally. It avoids the upward bias of always rounding 5 up.

How do I round to the nearest 10, 100 or 1,000?

Choose Nearest… and pick 10, 100 or 1000, or choose Decimal places and enter −1, −2 or −3. For example 1,234 to the nearest hundred is 1,200.

Why does my spreadsheet or code round 2.675 to 2.67?

Binary floating point stores 2.675 as slightly less than 2.675, so the tie is lost before rounding. This calculator rounds the decimal digits exactly as typed and gives 2.68.

What is the difference between rounding down and truncating?

They agree for positive numbers. For negatives, floor (round down) moves toward −∞, so −2.1 → −3, while truncating simply drops the digits, so −2.1 → −2.

Is 四舍五入 the same as round half up?

For positive numbers, yes. For negative numbers the everyday rule rounds by size, so −2.5 → −3; that is half away from zero. Strict half up (toward +∞) gives −2.

Sources & references

Last reviewed: