Rounding Bias Demonstrator
Almost everyone is taught to round a half upward. Over a single number that is fine; over thousands it is not, because every tie is pushed the same way and the errors accumulate instead of cancelling. Sending halves to the nearest even number splits them roughly evenly and the drift stays near zero. This rounds the same values both ways and measures the difference, rather than asking you to take it on faith.
What this generator does
Generates values deliberately heavy in exact halves — the only place the two rules differ — rounds them by both methods, and reports each rounded total against the exact one so the drift is directly visible.
How to use this tool
- Choose how many values to round and generate a set.
- Compare the two rounded totals against the exact one.
- Look at how many values landed exactly on a half — those are the only ones where the methods differ.
- Increase the count and watch the half-up drift grow while the half-even drift does not.
Understanding the controls
- How many values
- Between 100 and 20,000. The drift from rounding halves up grows roughly with the number of ties, so a larger set makes it unmistakable.
- Seed
- Any word reproduces exactly the same values and the same totals.
Common use cases
- Explaining why accounting standards specify round-half-to-even
- Teaching how small biases accumulate over many operations
- Settling an argument about which rounding rule to use
- Demonstrating the effect for a code review or a specification
- Setting the same value set twice from a seed
How this generator works
About half the generated values land exactly on a half, which is far more than real data would contain — the point is to make the difference visible rather than to model anything. Both methods agree everywhere except on those ties. The check confirms neither method ever moves a value by more than half a unit, and that every tie under half-even really does land on an even number.
Randomness and fairness
The values are random; both rounding rules are entirely deterministic. A seed reproduces the same set exactly and is therefore explicitly not cryptographically secure. Without a seed the browser's cryptographically secure generator is used.
For how randomness is produced across the whole site, see how Generate Random works.
Limitations and good to know
- Values are weighted heavily towards exact halves so the effect is visible. Real data has far fewer, and the drift is correspondingly smaller but still one-directional.
- Rounding to whole numbers only; rounding to a number of decimal places behaves the same way at a different scale.
- Two rules compared. Round-half-down, round-half-away-from-zero and stochastic rounding are not shown.
- Positive values only, which avoids the separate question of how a rule should treat negatives.
- Value sets are not stored between visits; seed one you want again.
Privacy and your data
Every value and total is computed on your own device. Nothing about them or your seed leaves the browser.
Related generators
- Floating Point Pitfall GeneratorWorked examples of the four ways decimal arithmetic goes wrong on a computer, each shown with the values actually stored.
- Rounding Question GeneratorRound-to-the-nearest questions, to tens, hundreds, thousands or decimal places, with worked steps.
- Interval Arithmetic GeneratorArithmetic on ranges rather than numbers, with thousands of sampled points confirming the true answer always lands inside.
- Condition Number GeneratorLinear systems with their condition number computed exactly, showing how far a tiny change to the inputs can move the answer.