Rounding Calculator
Enter a number, choose where to round, and pick the rule: school rounding, banker’s rounding, ceiling, floor, truncation and six more. The digits are handled exactly, so 1.005 rounds to 1.01 and not to the 1.00 that floating-point arithmetic gives, and a table shows what every rule does to your number. Free, no sign-up.
Any number, with up to 120 digits. Digits are kept exactly as typed.
Results
2.68
2.675 rounded
+0.005
Change from the original
Yes
Exactly halfway?
The working
- Keep 2.67. The digits that follow are 5.
- 5 is exactly half a unit in the hundredth place: a tie. The rounding mode decides which neighbour wins.
- The last kept digit goes up by one: 2.68.
Why a calculator or spreadsheet can disagree
In binary floating point, 2.675 is stored as 2.67499999999999982236431605997495353221893310546875. JavaScript’s toFixed(2) therefore returns 2.67, while rounding the decimal digits you typed gives 2.68.
Every rounding mode on your number
| Mode | Result | Rule |
|---|---|---|
| Half away from zero (school rounding) | 2.68 | A tie goes to the larger magnitude. Excel ROUND, Java HALF_UP and Python’s decimal ROUND_HALF_UP. |
| Half up, toward +∞ | 2.68 | A tie goes toward +∞, so −2.5 becomes −2. JavaScript’s Math.round. |
| Half down, toward −∞ | 2.67 | A tie goes toward −∞, so 2.5 becomes 2 and −2.5 becomes −3. |
| Half toward zero | 2.67 | A tie goes to the smaller magnitude. Java HALF_DOWN. |
| Half to even (banker’s rounding) | 2.68 | A tie goes to the neighbour whose last digit is even. IEEE 754’s default, Python’s round() and NIST’s rule. |
| Half to odd | 2.67 | A tie goes to the neighbour whose last digit is odd. |
| Ceiling, toward +∞ | 2.68 | Always up, toward +∞, whatever the dropped digits. |
| Floor, toward −∞ | 2.67 | Always down, toward −∞, whatever the dropped digits. |
| Truncate, toward zero | 2.67 | The dropped digits are simply cut off. |
| Away from zero | 2.68 | Up in magnitude whenever any non-zero digit is dropped. |
How to Use the Rounding Calculator
- 1. Enter the number. Type it with as many digits as you have; they are used exactly as typed, with no conversion to floating point. Negative numbers work.
- 2. Choose where to round. Pick a place from the nearest thousand down to ten decimal places, or switch to “A multiple of” to round to the nearest 0.05, 5 or 0.25.
- 3. Choose the rule. School rounding (half away from zero) is the default. The other nine rules differ on ties and on direction.
- 4. Read the result and the table. You get the rounded value, the exact change, whether the number was exactly halfway, and what all ten rules would give.
The Basic Rule and the Tie Problem
To round to a place, keep the digits up to it and look at what follows. If the dropped part is less than half a unit in that place, the last kept digit stays; if it is more than half, it goes up by one. The one case the basic rule does not settle is a tie: a dropped part of exactly 5 followed by nothing, as in 2.5 rounded to a whole number or 2.675 rounded to two decimal places. Both neighbours are equally close, so a rounding mode has to choose.
| Rule | 23.5 | −23.5 | 24.5 |
|---|---|---|---|
| Half away from zero | 24 | −24 | 25 |
| Half up (toward +∞) | 24 | −23 | 25 |
| Half down (toward −∞) | 23 | −24 | 24 |
| Half toward zero | 23 | −23 | 24 |
| Half to even | 24 | −24 | 24 |
| Half to odd | 23 | −23 | 25 |
| Ceiling (toward +∞) | 24 | −23 | 25 |
| Floor (toward −∞) | 23 | −24 | 24 |
| Truncate (toward zero) | 23 | −23 | 24 |
| Away from zero | 24 | −24 | 25 |
Who Uses Which Rule
- Half away from zero is the school rule, Excel’s ROUND function, Java’s HALF_UP and Python’s decimal ROUND_HALF_UP.
- Half to even, often called banker’s rounding, is the default rounding of IEEE 754 binary floating point, the rule of Python’s built-in round(), and the rule NIST gives for rounding numbers in its Guide to the SI (SP 811, section B.7.1).
- Half up toward +∞ is JavaScript’s Math.round: 2.5 becomes 3 but −2.5 becomes −2.
- Floor, ceiling and truncation are directed rules: they ignore which neighbour is nearer and are used for safe bounds, such as rounding a price down or a count of boxes up.
Why Half to Even Exists
Always sending ties up pushes totals upward. Round 0.5, 1.5, 2.5 and 3.5 half away from zero and you get 1, 2, 3 and 4, a total of 10 against a true total of 8. Half to even sends them to 0, 2, 2 and 4, which totals exactly 8: ties are equally likely to go either way, so errors cancel. That is why statistics software and standards bodies prefer it, and why a sum of rounded values stays close to the rounded sum.
Worked Example: 2.675 to Two Decimal Places
- Keep 2.67; the dropped digit is 5, exactly half a unit in the hundredth place — a tie.
- Half away from zero, half up, ceiling and away from zero give 2.68. Half down, half toward zero, floor and truncation give 2.67. Half to even looks at the last kept digit, 7, which is odd, and goes up to the even 2.68; half to odd stays at 2.67.
- A spreadsheet or program that stores 2.675 in binary floating point holds 2.67499999999999982236431605997495353221893310546875, which is below the tie, so it may round to 2.67. Python’s documentation uses this very example: round(2.675, 2) gives 2.67.
1.005 is the classic trap
Rounded to two places with school rules, 1.005 is 1.01. In floating point it is stored as 1.00499999999999989…, so (1.005).toFixed(2) returns “1.00” and Math.round(1.005 * 100) / 100 returns 1. This calculator works on the digits you type, and flags the disagreement when it happens.
Common Mistakes
- Rounding twice. 2.4445 rounded to two places is 2.44, because the dropped part 0.0045 is below half. Rounding first to three places (2.445) and then to two (2.45) gives the wrong answer.
- Rounding in the middle of a calculation. Keep every digit until the last step, then round once.
- Treating negatives as mirror images. Half up and half down are not symmetric about zero; half away from zero and half to even are.
- Confusing decimal places with significant figures. 0.00123 has five decimal places but three significant figures; use the Significant Figures Calculator for the latter.
Frequently Asked Questions
- How do you round to the nearest tenth?
- Keep one digit after the decimal point and look at the next digit. If it is 5 or more (and not a tie you want to treat differently), add 1 to the tenths digit; otherwise leave it. 3.14 becomes 3.1, and 3.16 becomes 3.2.
- What is banker’s rounding?
- It is another name for round half to even: a tie goes to the neighbour whose last digit is even, so 0.5 and 2.5 both round to 0 and 2, and 1.5 rounds to 2. It avoids the upward bias of always rounding ties up.
- Why do Excel, Python and JavaScript round the same number differently?
- They use different tie rules. Excel’s ROUND goes away from zero, Python’s round() goes to even, and JavaScript’s Math.round goes toward +∞. On top of that, binary floating point cannot store most decimal ties exactly, so a value like 2.675 is often already below the tie when it is rounded.
- How do you round 5?
- By the usual school rule a 5 rounds up: 15 to the nearest ten is 20, and 2.5 to the nearest whole number is 3. Under half to even, 15 still goes to 20 but 25 also goes to 20, because the even neighbour is chosen.
- What is the difference between rounding and truncating?
- Truncating cuts off digits without looking at them, always moving toward zero: 2.99 truncates to 2. Rounding to a whole number gives 3. Truncation is rounding with a fixed direction, one of the ten modes here.
- How do I round to the nearest 5, 10 or 0.25?
- Choose “A multiple of” and type the step. The calculator divides by the step, rounds that quotient to a whole number with your rule, and multiplies back: 2.37 to the nearest 0.05 is 2.35, and 12.5 to the nearest 5 is 15 (half away) or 10 (half to even).