Audited 05 Jun 2026·Last updated 28 Oct 2026·8 citations·Tier 1·0 uses

Rounding Calculator

Round any number to decimal places or the nearest 0.05, 0.25 or 1,000 using half-up, banker's half-even, half-down, ceiling, floor or truncation.

Rounding Calculator

The number you want to round. Negative numbers and very small decimals are supported via arbitrary-precision arithmetic.
How many digits to keep after the decimal point. 0 returns an integer; 2 is standard for currency. Ignored when Round to nearest N is not 1: the result is then a multiple of N.
Rounding mode
Round to the nearest multiple of this value. Use 0.05 for Swiss-rappen 5-cent rounding, 5 for nearest 5, 15 for quarter-hour time in minutes (0.25 in decimal hours), or leave at 1 for no scaling.
Rounded value
3.15
The input rounded to your decimal places, or to the nearest multiple of your step, under the chosen mode.
Difference from original
0.005
Original value
3.145
Percent difference
0.16%

Background.

Round 2.5 to a whole number. Most people say 3, and so does Excel's ROUND function. Python's built-in round() says 2. Neither is broken: they follow different rules for the one case that needs a rule at all, a value sitting exactly halfway between two candidates. Every other value rounds to its nearer neighbour under any sensible scheme. Ties are where the conventions part company, along with the deliberately one-directional modes used for capacity, budgets and cash.

Six modes are offered. Half-up breaks a tie away from zero; it is school rounding, and the rule behind the IRS instruction that $2.50 becomes $3 on a whole-dollar return. Half-even sends a tie to the neighbour whose last digit is even — banker's rounding, and the default in IEEE 754 floating-point arithmetic. Half-down sends a tie toward zero. Ceiling always moves toward positive infinity, floor always toward negative infinity, and truncate simply drops the extra digits, which moves toward zero.

You can round to a number of decimal places, or to the nearest multiple of any step — 0.05 for Swiss cash, 0.25 for quarter-hours written in decimal hours, 1,000 for headline figures — and see how far the rounding moved the number, both in absolute terms and as a percentage of the original. The value is rounded as the decimal digits you typed, so 2.675 rounded half-up to two places gives 2.68, not the 2.67 that some programming languages return.

What is rounding calculator?

Rounding replaces a number with a nearby value on a coarser grid. Two choices define it. The first is the grid: a number of decimal places, where two places means steps of 0.01, or any step you name, such as 0.05 or 1,000. The second is the rule for choosing between the two grid points that bracket the value. For most values the nearer point is obvious, and all three half- modes agree; they differ only at an exact tie. Ceiling, floor and truncate ignore which point is nearer and always go one way, so their error can approach a whole step, while the half- modes never move a number by more than half a step. Decimal places are not the same as significant figures. Rounded to two decimal places, 0.0004567 becomes 0 — a 100 percent change — whereas two significant figures would keep 0.00046. For measured quantities spanning many orders of magnitude, significant figures are usually what you want. One more rule saves trouble: round once, from the original number. Rounding in stages can change the answer. Rounded half-up to one decimal, 2.45 becomes 2.5, and 2.5 rounded again to a whole number becomes 3 — yet 2.45 rounded straight to a whole number is 2, because it was never past the halfway point.

How to use this calculator.

  1. Enter the value to round. Anything from −1,000,000,000 to 1,000,000,000 is accepted, negative numbers included.
  2. Set the decimal places, a whole number from 0 to 10: 0 for whole numbers, 2 for cents, more for measurements.
  3. Choose a mode. Half-up matches school arithmetic and most spreadsheets; half-even avoids drift when many rounded values are added together; ceiling and floor are for answers that must not fall short or must not overshoot.
  4. To round to a step other than a power of ten, enter it as Round to nearest N and leave it at 1 otherwise. Once N is not 1, the Decimal places setting is ignored and the result is always an exact multiple of N, so a step of 0.125 gives answers such as 3.125 whatever the decimal places say.
  5. Read the rounded value with the difference beside it: a positive difference means the number was pushed up, a negative one that it was pulled down. The percent difference shows whether a small absolute change is large relative to the number.

The formula.

Call the grid step q: 10 to the power of minus the decimal places when the step N is 1, otherwise N itself. The value x lies between a lower grid point L and an upper grid point L + q. Half-up, half-even and half-down all pick whichever point is nearer; they differ only when x sits exactly in the middle, where half-up picks the point further from zero, half-down the point nearer zero and half-even the point whose last digit is even. Ceiling always takes the upper point unless x is already on the grid, floor always the lower, and truncate whichever is nearer zero.

With a step other than 1, the value is divided by N, that quotient is rounded to a whole number under the chosen mode, and the result is multiplied back by N. That product is the answer and is not rounded again, so it always lies exactly on the step and the decimal places setting plays no part: 3.14159 to the nearest 0.125 is 25.13272 steps, 25 under half-up, and 25 × 0.125 = 3.125 at any decimal-place setting.

The difference is the rounded value minus the original. The percent difference divides that by the size of the original and multiplies by 100; for an original of zero it is reported as 0.

The reason half-even exists is arithmetic. Half-up moves every tie upward, so a column of tied values drifts high when summed: 0.5, 1.5, 2.5 and 3.5 add up to 8, but rounded half-up they become 1, 2, 3 and 4, which add up to 10. Half-even rounds them to 0, 2, 2 and 4, which still add up to 8, because the ties go up and down in turn. That balance assumes even and odd neighbours occur about equally often among the ties, which is true of most real data.

No mode guarantees that rounded parts add up to the rounded whole. Three equal shares of a total are each 33.333… percent; rounded to one decimal they read 33.3, 33.3 and 33.3, which sum to 99.9. Published tables handle this either by noting that figures may not sum because of rounding or by adjusting the largest share so the column totals correctly.

A worked example.

Example

Round 3.145 to two decimal places with half-up. The two candidates on the 0.01 grid are 3.14 and 3.15, and 3.145 sits exactly 0.005 from each, so the tie rule decides. Half-up moves away from zero, giving 3.15. The difference is 3.15 − 3.145 = +0.005, and the percent difference is 0.005 ÷ 3.145 × 100, about 0.159%. The same number under the other modes shows which rules actually differ. Half-even gives 3.14, because 4 is the even neighbour. Half-down also gives 3.14, moving toward zero. Ceiling gives 3.15, while floor and truncate both give 3.14. For a value such as 3.1452 there would be no tie at all: every nearest mode returns 3.15, and only floor and truncate would still give 3.14. Turn the sign around and the directed modes split. For −3.145, half-up gives −3.15 (away from zero), half-even and half-down give −3.14, ceiling gives −3.14 (toward positive infinity, which for a negative number means toward zero), floor gives −3.15, and truncate gives −3.14. A single cent separates the answers, which is nothing on one invoice and a visible bias on a ledger of thousands of tied amounts.

modehalf-up
nearest N1
decimal Places2
value3.145

Frequently asked questions.

Why does Python round 2.5 down to 2?
Python's built-in round() uses round-half-to-even, so round(2.5) is 2, round(0.5) is 0 and round(3.5) is 4. Excel's ROUND, by contrast, rounds a tie away from zero, so ROUND(2.5, 0) is 3. NumPy's rounding also sends ties to the even neighbour, while Python's decimal module lets you ask for ROUND_HALF_UP explicitly when commercial rounding is required. Choose half-even here to reproduce Python's behaviour, or half-up to match the spreadsheet.
Why does my code round 2.675 to 2.67, and 1.005 to 1.00?
Because the computer never stored the tie. In binary floating point, 2.675 is held as 2.67499999999999982236…, just below the halfway point, so a correct rounding goes down. JavaScript's (1.005).toFixed(2) returns 1.00 for the same reason. Here the value is rounded as the decimal digits you typed, so 2.675 becomes 2.68 and 1.005 becomes 1.01 with half-up.
When should I use banker's rounding instead of ordinary rounding?
Use half-even whenever rounded figures will be added up or averaged and exact ties are common. They are more common than they look: a 2.5 percent fee on any odd whole-dollar amount lands exactly on half a cent — $0.025 on $1, $0.075 on $3, $0.125 on $5. Half-up nudges every tie upward, so the total drifts high; half-even sends ties up and down in turn. For a single number shown once, such as a price tag or a homework answer, the choice makes no practical difference beyond matching convention.
How does each mode treat negative numbers?
The nearest modes behave symmetrically: half-up rounds −2.5 to −3, and half-even and half-down round it to −2. The directed modes follow the number line, not the size: ceiling takes −2.7 to −2, and floor takes −2.3 to −3. JavaScript's Math.round is an odd one out, sending ties toward positive infinity, so Math.round(−2.5) returns −2 while Math.round(2.5) returns 3.
How do I round a cash total to the nearest 5 cents or 10 cents?
Enter the total, choose half-up and type 0.05 as the step; the decimal places setting is ignored once a step is used. 27.43 becomes 27.45 and 27.42 becomes 27.40. This is the rounding used for cash payments in Swiss francs, where the smallest coin is 5 rappen, and in Australia; New Zealand rounds cash to 10 cents, so use 0.10 there. In those systems card payments are usually charged to the exact cent.
How do I round work time to the nearest quarter hour?
In decimal hours, use a step of 0.25: 7.38 hours becomes 7.5. In minutes, use a step of 15: 37 minutes becomes 30. US Department of Labor rules allow employers to round recorded time to the nearest 5 minutes, tenth of an hour or quarter hour, provided the rounding averages out over time rather than consistently shortchanging employees.
Which mode gives a whole number of buses, boxes or tiles?
Ceiling, because any fraction means you need one more. 130 students in 50-seat buses is 2.6, which ceiling turns into 3 buses; half-up would also give 3 here, but it would turn 2.4 into 2 and leave twenty students behind. Use floor for the opposite question, such as how many whole units a fixed budget can buy.
What is the difference between truncating and rounding down?
For positive numbers there is none: truncate and floor both turn 2.7 into 2. They part ways for negatives. Floor moves toward negative infinity, so −2.7 becomes −3. Truncate simply drops the digits, so −2.7 becomes −2. Truncation always moves a number toward zero, which is why it suits quantities that should not show a whole unit before it has passed, such as a stopwatch reading or a person’s age in years.
How should amounts on a US tax return be rounded?
Form 1040 lets you round to whole dollars: drop amounts under 50 cents and raise amounts from 50 to 99 cents to the next dollar, so $1.39 becomes $1 and $2.50 becomes $3. That is half-up at 0 decimal places. If you round any amount on the return, you round all of them, rather than mixing whole dollars with cents.
What does the IEEE 754 standard say about rounding?
IEEE 754, the standard behind floating-point arithmetic in almost all modern processors and languages, defines five rounding directions: ties to even (the default), ties away from zero, toward positive infinity, toward negative infinity and toward zero. They correspond to half-even, half-up, ceiling, floor and truncate here. Half-down, which sends ties toward zero, has no counterpart among the standard’s rounding directions.

References& sources.

  1. [1]IEEE Std 754-2019, IEEE Standard for Floating-Point Arithmetic, §5.4.1 — definitions of the five standard rounding-direction attributes including roundTiesToEven (the default).
  2. [2]Knuth, D. E. The Art of Computer Programming, Volume 2: Seminumerical Algorithms, §4.2.1 — floating-point arithmetic, the statistical bias of half-up versus half-even, and the convergent (banker's) rounding argument.
  3. [3]ANSI/IEEE Std 754-2008 — predecessor standard, §4 on rounding-direction attributes; widely cited in numerical-analysis literature and still referenced by most language specifications.
  4. [4]Swiss National Bank — "Notes and coins: Withdrawal of the 1- and 2-rappen pieces" — official background on Swiss 5-rappen cash rounding, the regulatory basis for nearest-0.05 rounding on cash payments in CHF.
  5. [5]IETF RFC 7159, The JavaScript Object Notation (JSON) Data Interchange Format, §6 — discussion of number precision and the recommendation to limit interoperable JSON numbers to IEEE 754 double-precision range, which is why language-native rounding is unreliable for high-precision values.
  6. [6]Internal Revenue Service Publication 1220 — Specifications for Electronic Filing of Forms 1097, 1098, 1099, 3921, 3922, 5498, and W-2G — Part C on amount fields and the rounding rules accepted for aggregated information returns.
  7. [7]Mozilla Developer Network — Math.round() reference — documents that JavaScript's built-in Math.round rounds halves toward positive infinity rather than away from zero, the canonical "JavaScript rounding bug" that motivates arbitrary-precision libraries.
  8. [8]NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6 — discussion of rounding conventions in statistical reporting and the preference for unbiased (banker's) rounding when totals are reported alongside individual values.

How this page was produced

Published by
Quanta Calculator
Primary sources
8 cited below
Published
Last verified

Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 1560 calculators remain free
  • No billing is enabled
Coming soon