HomeMath › Round to the Nearest Integer Calculator

Round to the Nearest Integer Calculator

Type any positive or negative decimal and get the nearest whole number, with the tie rule for .5 spelled out and the always-down (floor) and always-up (ceiling) alternatives shown alongside.

Example: with Number to round 7.5 → Nearest integer: 8.

  • WhyDecimal part is .5 — that is .5 or more, so round away from zero to 8.
  • Always down (floor)7
  • Always up (ceiling)8

Computed by the calculator below using its default values. Change any input to see your own numbers.

Nearest integer
Why
Always down (floor)
Always up (ceiling)

Schoolbook rounding: look at the decimal part — below .5 drops, .5 and above pushes to the next integer away from zero. Banker's rounding (half to even) differs only on exact .5 ties.

The rule, and the one case people argue about

Rounding to the nearest integer keeps whichever whole number is closest: 7.3 is nearer to 7, 7.8 is nearer to 8. The only genuine judgment call is the exact tie, .5, which is equally far from both neighbors. This calculator uses the convention taught in US schools — round half away from zero — so 7.5 becomes 8 and −7.5 becomes −8.

That is not the only convention. Banker's rounding (round half to even) sends 7.5 to 8 but 8.5 to 8, so ties alternate and long sums do not drift upward. Spreadsheets' ROUND() follows the schoolbook rule; Python's built-in round() and many statistics packages use banker's. If a spreadsheet and a script disagree by exactly one, a .5 tie is almost always the culprit.

How it’s calculated

Nearest integer = sign(x) × round(|x|), which implements round-half-away-from-zero: decimal part < .5 truncates, ≥ .5 pushes to the next integer away from zero. Floor is the greatest integer ≤ x; ceiling is the least integer ≥ x. For negatives, floor(−2.5) = −3 and ceiling(−2.5) = −2.

One convention among several — banker's rounding (half to even) gives different answers on exact .5 ties, so match the convention your class, bank, or software specifies.

Rounding in action

InputNearest integerFloorCeiling
7.49778
7.5878
−7.5−8−8−7
−2.3−2−3−2
0.5101

Computed with round-half-away-from-zero; floor always moves left on the number line, ceiling always right.

Common mistakes

  • Rounding −2.5 to −2: with the schoolbook rule, ties round away from zero, so −2.5 goes to −3 (some software rounds it to −2 — know your convention).
  • Confusing floor with 'toward zero' for negatives: floor(−2.3) is −3, not −2. Truncation and floor differ below zero.
  • Double rounding: 4.46 to one decimal is 4.5, then to an integer 5 — but 4.46 straight to an integer is 4. Round once, from the original.
  • Expecting round() in every language to match: Python 3's round(2.5) is 2 (banker's), while Excel's ROUND(2.5,0) is 3.

Frequently asked questions

What is the rule for rounding to the nearest integer?

Look at the decimal part. Less than .5, drop it (7.3 → 7). Half or more, go to the next whole number away from zero (7.5 → 8, −7.5 → −8). Formally: sign(x) × round(|x|).

What does 7.5 round to?

8 under the standard schoolbook rule, because ties round away from zero. Banker's rounding would also give 8 here (8 is even), but it sends 8.5 to 8 instead of 9.

How do negative numbers round?

Distance still decides: −2.3 rounds to −2 and −2.7 rounds to −3. The tie −2.5 rounds away from zero to −3 in this calculator.

What's the difference between rounding, floor, and ceiling?

Rounding picks the closest integer. Floor always goes down (7.9 → 7) and ceiling always goes up (7.1 → 8), regardless of distance. Floor and ceiling are one-directional; rounding is nearest-wins.

Why does Excel round 2.5 to 3 but Python says 2?

They use different tie rules. Excel's ROUND is half-away-from-zero (2.5 → 3); Python 3's round uses half-to-even (2.5 → 2). Both agree on everything except exact .5 ties.