TTKTheTextKit

Rounding Calculator

Paste one number per line, choose how to round and pick a rule. You can round to a number of decimal places, where a negative number rounds to tens or hundreds, or to the nearest multiple such as 0.05 or 25. The ten rules cover half away from zero, half to even, half up, half down, half toward zero, half to odd, ceiling, floor, truncate and away from zero. Each result shows the exact change, and the sum of the rounded numbers is compared with the true sum. Everything runs in your browser.

0 gives a whole number. A negative number rounds to tens (-1), hundreds (-2) and so on.

A tie goes to the number with the larger size: 2.5 becomes 3 and -2.5 becomes -3.

Result
NumberRoundedChange
2.6752.68+0.005tie
1.0051.01+0.005tie
0.50.500.00
1.51.500.00
2.52.500.00
-2.5-2.500.00
3.141593.14-0.00159

Sum of the numbers 8.82159, sum of the rounded numbers 8.83000, difference +0.00841.

The numbers are read as exact decimals and rounded with whole number arithmetic, so 2.675 is a tie at two places, as it is on paper, and not 2.67499999 as it is stored in a computer's floating point. A tie is a number exactly halfway between two choices. Half away from zero sends every tie to the larger size, which is the rule taught at school. Half to even sends it to the even choice, which has no bias up or down and so keeps the sum of many rounded numbers close to the true sum, and it is the default rounding mode of IEEE 754 floating point. The other rules are listed so you can match a program or a form that uses them. A comma such as 1,234.5 is read as a thousands separator, and a single comma such as 2,5 as a decimal point. Everything runs in your browser.

Related Tools

[5 suggestions]

About the Rounding Calculator

The numbers are read as exact decimals and rounded with whole number arithmetic, so 2.675 is a tie between 2.67 and 2.68, as it is on paper. In floating point it is stored a little below 2.675, which is why Python gives round(2.675, 2) as 2.67 and JavaScript gives (2.675).toFixed(2) as 2.67, and why (1.005).toFixed(2) gives 1.00. A tie is a number exactly halfway between two choices, and the rule decides where it goes. Half away from zero, the rule taught at school, sends 2.5 to 3 and -2.5 to -3. Half to even sends 2.5 to 2 and 3.5 to 4, and it is the default rounding mode of IEEE 754 floating point. It has no bias up or down, so it keeps the sum of many rounded numbers close to the true one: 0.5, 1.5, 2.5 and 3.5 add up to 8, half away from zero rounds them to 1, 2, 3 and 4, which add up to 10, and half to even gives 0, 2, 2 and 4, which add up to 8. Python rounds half to even, and JavaScript Math.round rounds ties toward positive infinity, so it gives 3 for 2.5 and -2 for -2.5. Rounding to a multiple works the same way on the quotient: 1.37 to the nearest 0.05 is 1.35, and 12.5 to the nearest 5 is 15. A comma such as 1,234.5 is read as a thousands separator, and a single comma such as 2,5 as a decimal point.

How do I round to the nearest 0.05 or 0.25?▾

Choose Nearest multiple and type 0.05 or 0.25. The calculator divides each number by the multiple, rounds the quotient by your rule and multiplies back, so 1.37 becomes 1.35 and 2.6 becomes 2.50 at the nearest quarter.

What is round half to even?▾

It is the rule that sends a tie to the nearest even digit, so 2.5 becomes 2 and 3.5 becomes 4. Because ties go up as often as down, the sum of many rounded numbers stays close to the true sum. It is also called banker's rounding.

Why does 2.675 round to 2.67 in my program?▾

Most programs store 2.675 as a binary fraction slightly below 2.675, so it is not a tie. This calculator reads the number as typed, treats it as a tie, and with half away from zero gives 2.68.

Can I round to tens or hundreds?▾

Yes. Choose Decimal places and type -1 for tens or -2 for hundreds. 1234.5 rounded to -1 places is 1230, and 15 is 20 with half away from zero.

Is my data uploaded?▾

No. The numbers are rounded in your browser and nothing you enter is sent anywhere.