Skip to content
Math & Statisticsnotation

Rounding Calculator

Rounding under all four common rules at once, because they disagree on exactly the values people check. The difference only shows up on a tie, and a column of ties is where a total drifts.

Also called: round to decimal places, banker rounding.

Rounded
3

2.5 rounds to 3 at 0 decimal places. Ties go away from zero, which is the rule taught in school. The other rules would give half away 3, half even 2, up 3, down 2.

Half away from zero
3
Half to even (banker's)
2
Always up
3
Always down
2
What the other rules give
half away 3, half even 2, up 3, down 2
About this rule
Ties go away from zero, which is the rule taught in school.
Method and background

How this is calculated

Every rule agrees except when the digit being dropped is exactly five. Half away from zero is what school taught and what most people expect. Half to even, called banker's rounding, sends ties to the nearest even digit so a long column does not drift upwards; it is the default in most spreadsheet and floating-point standards, which surprises people. Always up and always down never look at the tie at all.

scale by ten to the decimal places, round, scale back; the tie rule is what varies
x
The number
d
Decimal places

Worked examples

Each of these is asserted on every build. If a change to the engine ever moved one of these answers, the build would fail before the page could print it.

the tie that separates the rules

Number
2.5
Decimal places
0
Rounding rule
Half away from zero (what most people mean)

Rounded3

The definitional disagreement between the two half rules

Open this example

negatives round symmetrically away from zero

Number
-2.5
Decimal places
0
Rounding rule
Half away from zero (what most people mean)

Rounded-3

boundary: JavaScript's own Math.round gives -2 here, which is the bug this avoids

Open this example

nothing to round is left alone

Number
2.4
Decimal places
0
Rounding rule
Half to even (banker's rounding)

Rounded2

degenerate case: away from a tie all rules agree

Open this example

Method and limits

What it assumes

  • Decimal rounding, not binary. Floating point can still show artefacts on values it cannot represent exactly.

What it deliberately does not model

  • A value such as 2.675 is not exactly representable in binary, so its stored value is slightly below the tie and every rule will round it down.

Formula version 1.0.0 · definition 1.0.0 · United States · Report a problem with this calculator

Frequently asked questions

What is banker's rounding for?
Rounding ties always upwards biases a long column of numbers upwards. Sending ties to the nearest even digit splits them roughly evenly, so the sum stays unbiased. It is the default in IEEE floating point and in most spreadsheets.
Why does my spreadsheet round 2.675 down?
Because 2.675 cannot be stored exactly in binary; the stored value is a fraction below the tie. No rounding rule can recover a tie that the number never quite reached.