Rounding Calculator

About this calculator

The Rounding Calculator rounds a number to the precision you choose, from millionths to millions or to a fraction like 1/8, using any of nine rounding rules including half up, half even (banker's rounding), ceiling and floor. Calculations are exact, so there are no floating-point surprises on values like 1.005.

Embed this calculator

Paste this code into a Custom HTML block on your site. The calculator fits the width of the block. Adjust the height in the code if you want more room for results.

Find this widget in the publisher directory

What rounding does

Rounding replaces a number with a nearby one that is simpler, shorter or closer to the precision you need. You round when reporting measurements, splitting bills, setting prices or fitting a value into a fixed number of digits. The simplest rule, taught in school, looks at the first dropped digit: 5 or more rounds up and 4 or less rounds down. The trouble is exact halves, where the number sits precisely between two candidates. Different fields settle those ties differently, and this calculator supports each convention.

Choosing a precision

Precision names the place value you keep. Rounding 3.14159 to the hundredths place keeps two decimals and gives 3.14. A negative place such as tens or hundreds rounds to the left of the decimal point, so 1,284 to the nearest hundred is 1,300. You can also round to fractions of an inch, such as eighths or sixteenths, which is handy in woodworking: 15.65 rounded to the nearest eighth is 15 5/8, because 15.65 is closest to 15.625.

Rounding modes explained

ModeRule5.5-5.56.5
Nearest (default)Ties go away from zero, the way most people round by hand6-67
Half upTies go toward positive infinity6-57
Half downTies go toward negative infinity5-66
Half away from zeroTies go to the larger magnitude6-67
Half toward zeroTies go to the smaller magnitude5-56
Half to evenTies go to the even neighbor6-66
Half to oddTies go to the odd neighbor5-57
CeilingAlways toward positive infinity6-57
FloorAlways toward negative infinity5-66

Why half to even exists

Always rounding ties upward introduces a small upward bias when you add many rounded values. Half to even, also called banker's rounding, sends ties to the even neighbor so that roughly half go up and half go down, and the errors cancel. It is the default in the IEEE 754 floating-point standard and is common in accounting software and statistics.

Ceiling and floor

Ceiling and floor ignore the halfway point entirely. Ceiling always moves up, so 5.01 becomes 6. Floor always moves down, so 5.99 becomes 5. Use ceiling when you must have at least enough, such as ordering boards or boxes, and floor when you can only use whole units, such as counting full packages.

Negative numbers

Rounding rules that mention "up" and "down" refer to the number line, not to magnitude. Rounding -5.5 half up gives -5, because -5 is higher on the number line than -6. If you want the larger magnitude, choose half away from zero.

Worked example

Round 2.675 to two decimals. Because this calculator works with exact decimal values, 2.675 is treated as exactly 2.675, a tie between 2.67 and 2.68. Half up gives 2.68, half down gives 2.67 and half to even gives 2.68 (8 is even). Many programming languages show 2.67 for the same input because the binary floating-point value stored for 2.675 is slightly below the true tie.

Rounding and significant figures

Rounding to a decimal place is different from rounding to significant figures. Three significant figures of 0.0012345 is 0.00123, which is five decimal places. When you need a fixed number of significant digits, count from the first non-zero digit and pick the matching place in the precision list.

Frequently asked questions

How do I round to the nearest whole number?
Look at the digit right after the decimal point. If it is 5 or higher, add one to the whole part; otherwise keep the whole part.
What is banker's rounding?
Round half to even. A value exactly halfway between two numbers goes to the even one, so 2.5 rounds to 2 and 3.5 rounds to 4. It avoids a cumulative upward bias.
How do you round negative numbers?
It depends on the mode. Half up moves ties toward the higher number, so -2.5 becomes -2. Half away from zero moves them to the larger magnitude, so -2.5 becomes -3.
Can I round to a fraction?
Yes. Choose 1/2, 1/4, 1/8, 1/16, 1/32 or 1/64 as the precision and the result is shown as a mixed number with its decimal value.

Formulas and sample results on this page were checked against independent references. Page last reviewed or updated . How we verify calculators. Project led by Shaun Connell.