Audited 05 Jun 2026·Last updated 27 Jul 2026·8 citations·Tier 1·0 uses

Rounding Calculator

Free rounding calculator with six modes: half-up, half-even (banker's), half-down, ceiling, floor, truncate. Round to decimal places or nearest N.

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.
Rounding mode
Round to the nearest multiple of this value. Use 0.05 for Swiss-rappen 5-cent rounding, 5 for nearest 5, 25 for quarter-hour time, or leave at 1 for no scaling.
Rounded value
3.15
The input rounded according to the chosen mode and precision. Computed with Decimal.js to avoid IEEE 754 binary-float surprises like 0.1 + 0.2 ≠ 0.3.
Difference from original
0.005
Original value
3.145
Percent difference
0.16%

Background.

The Quanta rounding calculator is the single page you need for every rounding question, from school-style "round to two decimal places" to the banker's rounding that quietly governs your tax return, your invoice totals, and almost every scientific paper published in the last forty years. Most people meet rounding in primary school as a one-line rule — if the next digit is 5 or more, round up; otherwise round down — and never revisit it. That works fine for a homework sheet, but the moment you step into finance, statistics, engineering, or any code that handles money, you discover there are at least six legitimate rounding modes, the choice between them is not an opinion, and using the wrong one can systematically bias every total you produce. This calculator implements all six modes that matter — half-up, half-even (banker's), half-down, ceiling, floor, and truncate — and runs them through Decimal.js arbitrary-precision arithmetic so the answer you get is the mathematically exact one rather than whatever IEEE 754 binary float happens to be nearby.

Why does the choice of mode matter so much? Half-up — the school version — is biased upward on average. Round a hundred thousand values that all end in .5 with half-up and the sum will be measurably larger than the true sum. For a school quiz that's irrelevant; for a bank totalling a hundred thousand interest accruals, or a national statistics office aggregating census data, the bias compounds into real money and real policy errors. Half-even, also called banker's rounding, fixes this by breaking ties to the nearest even digit, which makes the upward and downward rounds cancel out over large samples. It is the default rounding mode of IEEE 754, the floating-point standard that every CPU on Earth implements, and it is the only mode permitted in the IEEE specifications for decimal arithmetic. The US Internal Revenue Service, the European Central Bank's TARGET2 settlement system, and the IRS Publication 1220 reporting specification all either mandate or recommend banker's rounding for the same reason: it preserves the sum.

There is a second, equally important reason this page exists, which is rounding to the nearest N. Switzerland abolished its one- and two-rappen coins, so every cash transaction in CHF must be rounded to the nearest 0.05 — what locals call rappen rounding. Australia and New Zealand do the same with five-cent and ten-cent steps. Markets round share prices to ticks of 0.01, 0.05, or 0.25 depending on the exchange. Schedulers round meeting times to the nearest 15 minutes.

The nearestN field handles all of these in one input: type 0.05 for Swiss cash, 0.25 for quarter hours, 5 for nearest five, 1000 for nearest thousand. Every other rounding calculator on the web silently uses JavaScript's built-in Math.round, which has a well-documented bug — Math.round(-0.5) returns 0 rather than −1 because it rounds halves toward positive infinity instead of away from zero — and which inherits all of float's accumulated rounding noise. Quanta does not.

The intro below walks through what each mode actually does, when to reach for it, and why the seemingly-academic distinction between half-up and half-even is worth caring about every time you write a financial report or seed a spreadsheet column.

What is rounding calculator?

Rounding is the process of replacing a number with a nearby number that has fewer significant digits or fewer decimal places. It is the universal compromise between precision (which costs storage, attention, and arithmetic time) and usability (which demands a short, readable answer). Every printed dollar amount, every reported temperature, every survey percentage, and every measurement on a product label has been rounded somewhere along the chain. The two questions every rounding rule has to answer are: where do we cut the number off, and what do we do when the dropped portion is exactly halfway between two possible answers? The first question is settled by the decimal-places or nearest-N parameter — you pick the granularity. The second question is what the six modes are for. Half-up rounds ties away from zero (1.5 → 2, −1.5 → −2). Half-down rounds ties toward zero (1.5 → 1, −1.5 → −1). Half-even rounds ties to whichever side has an even last digit (1.5 → 2, 2.5 → 2, 3.5 → 4) and is the IEEE 754 default. Ceiling always rounds toward positive infinity (1.1 → 2, −1.1 → −1). Floor always rounds toward negative infinity (1.1 → 1, −1.1 → −2). Truncate simply chops off the unwanted digits (1.9 → 1, −1.9 → −1). Modern numerical standards strongly prefer half-even because it is the only common mode that is statistically unbiased — over a large sample of half-ties, half-even produces a sum equal to the true sum, whereas the other half-modes systematically drift. That property is why it ended up in IEEE 754 and why anyone working with money, large datasets, or accumulated totals is well advised to use it.

How to use this calculator.

  1. Type the number you want to round in the Value field. Negative numbers, decimals as small as 1e-10, and numbers up to a billion are all handled with full Decimal.js precision.
  2. Set Decimal places to control the precision of the answer. 0 gives an integer, 2 is standard for currency, 4 or 6 are common in engineering. The maximum is 10 places.
  3. Choose a Rounding mode. If you don't know which to pick: half-up matches the rule taught in school and the way most spreadsheets behave by default; half-even is the right choice for financial reports, scientific aggregations, and any code that has to preserve sums.
  4. If you need to round to a multiple other than a power of ten — nearest 5 cents, nearest 25 minutes, nearest $1,000 — type that step into the Round to nearest N field. Leave it at 1 for ordinary decimal-place rounding.
  5. Read the four outputs: the Rounded value is the answer, the Difference from original tells you which way and how far the rounding moved the number, and the Percent difference puts that move in relative terms so you can spot when a small absolute change is actually a meaningful proportion of the original value.

The formula.

Each rounding mode is a deterministic mapping from a real number x to one of the two representable values surrounding it at the chosen precision. Let q be the precision step (10^(−decimalPlaces) when nearestN is 1, otherwise nearestN itself). Define the two candidate values as L = floor(x / q) × q and H = L + q. The modes choose between L and H as follows. Half-up: if x − L < q/2 pick L, if x − L > q/2 pick H, on a tie pick the one farther from zero. Half-down: same, but on a tie pick the one closer to zero. Half-even: same, but on a tie pick whichever has an even last digit. Ceiling: always pick H (or x itself if x = L). Floor: always pick L. Truncate: pick L if x ≥ 0, otherwise pick H — i.e. always move toward zero. When nearestN ≠ 1, the engine scales by dividing by nearestN, applies the chosen mode at zero decimal places (producing an integer multiple), then multiplies by nearestN, then re-applies the decimal-places precision to clean up any binary-float noise from the multiplication. All of this runs through Decimal.js, whose internal representation is a coefficient plus a power-of-ten exponent, so values like 0.1 and 0.2 are represented exactly rather than as the IEEE 754 approximations 0.1000000000000000055... that JavaScript's native Number uses. The practical consequence is that 3.145 rounded to two decimal places with half-up genuinely returns 3.15 — what most people would call "the right answer" — whereas a naive (3.145).toFixed(2) in JavaScript returns 3.14, because the binary representation of 3.145 is actually slightly less than 3.145 and the half-up rule strictly rounds down. This is the canonical JavaScript Math.round bug, documented at length on MDN and in countless Stack Overflow posts, and it is the reason every serious financial calculator uses arbitrary-precision decimal arithmetic instead of the built-in float.

A worked example.

Example

Take the textbook tricky case: round 3.145 to two decimal places. With mode half-up, the third decimal is exactly 5, so the tie-breaker activates and pushes away from zero, yielding 3.15. Switch the mode to half-even and the same input returns 3.14, because the digit to the left of the tie (the 4 in 3.14) is even, so banker's rounding stays put rather than rolling up to an odd 5. That single decision — 3.14 versus 3.15 — is one cent on this transaction, but multiplied across a million transactions it is the difference between a balanced ledger and a slow upward drift that auditors will eventually flag. As a separate example, switch the value to 27.43, set the mode back to half-up, set decimal places to 2, and set Round to nearest N to 0.05. The engine scales 27.43 by 0.05 to get 548.6, rounds that to the nearest integer with half-up (549), then unscales by multiplying by 0.05 to get 27.45 — the Swiss-rappen cash rounding result. The difference from the original is +0.02, or about +0.073%, which is the small but real cost of cash rounding versus exact billing.

modehalf-up
nearest N1
decimal Places2
value3.145

Frequently asked questions.

When should I use banker's rounding (half-even) instead of normal rounding (half-up)?
Use half-even any time the rounded values will be summed, averaged, or otherwise aggregated. Half-up is biased upward on tie-breaks because every .5 always rounds up, which means a long column of half-up rounded numbers will systematically exceed the true total. Half-even alternates the direction (.5 → even neighbor), so over a large sample the rounding errors cancel and the sum is preserved. This is why IEEE 754 made it the default, why the US IRS uses it for Form 1099-DIV aggregations, why the European Central Bank's TARGET2 system mandates it for euro settlement, and why every serious statistical package (R, NumPy, pandas) defaults to it. Use half-up only when you are rounding a single value for display and the upward bias does not matter — a posted price tag, a homework answer, a one-off measurement.
Why does JavaScript's Math.round give wrong answers for negative halves?
Math.round in JavaScript rounds halves toward positive infinity rather than away from zero. So Math.round(0.5) returns 1 (which feels right), but Math.round(−0.5) returns 0 instead of −1 (which feels wrong). This breaks the symmetry that most people expect from "normal" rounding and is documented as standard behavior on MDN. The same function also suffers from binary-float precision: Math.round(1.005 * 100) / 100 returns 1 rather than 1.01 because 1.005 cannot be represented exactly in IEEE 754 binary. Quanta sidesteps both problems by using Decimal.js, which represents numbers as a coefficient and a base-10 exponent and applies the chosen rounding mode at the decimal-digit level. The result is the answer you would get by hand.
How does negative-number rounding work in each mode?
The rules are: half-up rounds −2.5 to −3 (away from zero, like its positive twin); half-down rounds −2.5 to −2 (toward zero); half-even rounds −2.5 to −2 (the even neighbor); ceiling rounds −2.7 to −2 (toward +∞ means less negative); floor rounds −2.3 to −3 (toward −∞ means more negative); truncate rounds −2.9 to −2 (chop toward zero). The two that surprise people most are ceiling and floor on negatives — ceiling makes a negative number less negative, floor makes it more negative — because the names invoke an intuitive "up" and "down" that does not match the mathematical sign axis. Whenever you are processing signed data, sketch one positive and one negative example through the chosen mode before trusting an entire pipeline.
What is the Swiss 5-cent (rappen) rounding rule and how do I model it here?
Switzerland withdrew its one-rappen and two-rappen coins, so any cash payment in Swiss francs is settled by rounding the total to the nearest 0.05 CHF — what merchants call rappen rounding. To model it on this page, set the Value to the unrounded total (e.g. 27.43), keep Decimal places at 2, choose half-up as the mode, and type 0.05 in the Round to nearest N field. 27.43 becomes 27.45; 27.42 also becomes 27.40 because it is closer to the lower step. The Swiss National Bank's guidance on cash payments is the authoritative reference. Australia, New Zealand, the Netherlands (pre-euro), Finland, and several other countries operate similar 5-cent or 10-cent cash-rounding regimes; the same input pattern handles all of them.
Why is half-even called banker's rounding?
Because nineteenth-century bankers, working long columns of interest accruals by hand, observed empirically that the always-up half-rule produced totals that drifted upward versus the true sum. By alternating the direction of tie-breaks they kept the column honest. The name stuck. Half-even is also called convergent rounding or unbiased rounding in older textbooks, and Knuth's TAOCP volume 2 §4.2.1 treats it as the canonical statistically-unbiased mode. Despite the name, it is now standard far beyond banking — it is the IEEE 754 default and appears in essentially every modern scientific computing library.
What is the difference between rounding and truncation?
Truncation simply chops off the unwanted digits, with no regard to the value of the dropped portion. 1.9 truncated to an integer is 1; −1.9 truncated to an integer is −1; 1.0001 truncated to one decimal place is 1.0. Rounding (in any of the half-modes, or ceiling or floor) considers the dropped portion and may carry into the kept portion. Truncation is biased toward zero — it always moves the value closer to zero, never further away — which is rarely what you want for an analytical result but is sometimes what you want for a display "5 minutes" countdown that should not round 5.9 up to 6. Programming languages typically expose truncation as Math.trunc, parseInt, or the | 0 idiom in JavaScript.
Does this calculator use floating-point or fixed-point arithmetic?
Neither, in the strict sense. It uses Decimal.js, an arbitrary-precision decimal library that stores every number as a coefficient (an array of digits) plus a power-of-ten exponent. That means values like 0.1, 0.2, and 0.3 are represented exactly, and 0.1 + 0.2 is exactly 0.3 — not the famous 0.30000000000000004 of IEEE 754 binary floats. Fixed-point arithmetic, by contrast, scales everything to integers (typically cents for money) and accepts a fixed precision throughout; it is faster but inflexible. Arbitrary-precision decimal is the standard tool in modern financial software, e.g. Python's decimal module, Java's BigDecimal, and .NET's System.Decimal.
How should I round amounts that I'm reporting on a tax form like a 1099?
The IRS allows two consistent options for any single tax return: round every amount to the nearest whole dollar, or keep every amount in dollars and cents. You cannot mix the two on the same return. For rounding, the IRS instructs filers to round 0.50 and above up to the next dollar and round 0.49 and below down — that is the half-up rule. For bulk reporting via Publication 1220 (the spec for filing 1099s electronically) the IRS additionally accepts banker's rounding because the totals it generates match the system-of-record totals more cleanly. If you are preparing a single personal return, use half-up; if you are operating payroll or brokerage software that produces a million 1099s, use half-even and document that choice in your reconciliation.
What does IEEE 754 say about rounding?
IEEE 754-2019, the current floating-point standard, defines five rounding-direction attributes: roundTiesToEven (the default — what we call half-even), roundTiesToAway (what we call half-up), roundTowardPositive (ceiling), roundTowardNegative (floor), and roundTowardZero (truncate). Half-down is not in the standard because it has no real statistical or numerical-stability justification — it is included on this page only because some legacy financial software requests it. Every CPU manufactured since the 1980s implements at least the first four IEEE 754 modes in hardware, accessible from C, C++, Rust, and so on via fesetround. The default in practice is always roundTiesToEven, which is why a freshly-compiled C program adding 0.5 + 0.5 + 0.5 + 0.5 across binary floats and rounding to integer produces 2, not 4 — every .5 rounds to the even neighbor.
When should I use ceiling or floor instead of one of the half-modes?
Use ceiling when overshooting is safe but undershooting is dangerous: estimating how many buses you need for a school trip (you cannot send 4.3 buses), allocating server capacity to peak load, computing how many full pages a document will take. Use floor for the opposite case: how many full $1,000 bonds you can afford with a given budget, how many complete laps you finished in a fixed time, how many integer days a deadline covers. Ceiling and floor are also the right tools when the operation is conceptually a quotient-and-remainder — they pair with the modulo operator to give you the integer part of a division. Both modes round in a single fixed direction regardless of how close the value is to the boundary, which is exactly what you want for capacity planning and exactly wrong for general-purpose precision reduction.

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.

In this category

Embed

Quanta Pro

Paid features are coming later.

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