Skip to main content
ponderloop

Rounding Calculator

Rounding 2.675 to 2 decimal places gives 2.68 with the usual “half up” rule: 2.675 is exactly halfway between 2.67 and 2.68, and half up sends a tie away from zero. Other modes disagree on a tie: half even (banker’s rounding) gives 2.68, half down 2.67, and floor, ceiling and toward zero always pick a side (2.67, 2.68, 2.67). Enter any number, then round it to a number of decimal places, to a place value such as tens or hundreds, or to the nearest multiple such as 0.05 or 5. The arithmetic is exact decimal, not floating point, so 1.005 rounds to 1.01 as it should.

Updated Runs in your browser: nothing you enter is uploadedHow this tool works

Up to 60 characters: digits, one decimal point and an optional minus sign. Rounding is done with exact decimal arithmetic, not floating point.

2.675 rounded to 2 decimal places, half up

2.68

Exactly halfway between 2.67 and 2.68; half up gives 2.68. Changed by +0.005.

The same number in every mode

Half up
2.68
Half even (banker’s)
2.68
Half down
2.67
Up (ceiling)
2.68
Down (floor)
2.67
Toward zero (truncate)
2.67

The working

  1. The step is 0.01: the result must be a multiple of it.
  2. 2.675 lies between the multiples 2.67 and 2.68.
  3. It is exactly halfway: 0.005 from each. This is a tie, so the mode decides.
  4. Half up: a tie goes away from zero (the school rule, and what spreadsheets do). Result: 2.68.

The six rounding modes compared

Each row is the calculator’s own answer for the number in the first column, rounded as the second column says.
NumberRounded toHalf upHalf evenHalf downUpDownToward zero
2.5whole number322322
3.5whole number443433
-2.5whole number-3-2-2-2-3-2
2.6752 decimal places2.682.682.672.682.672.67
1.0052 decimal places1.011.001.001.011.001.00

Rounding to a place value or a multiple

Half up unless the last column says otherwise.
NumberRound toResultNote
1234.5678Tens1230The digit in the ones place decides: 4 rounds down
1234.5678Hundreds1200Tens digit 3 rounds down
1250Hundreds1300Half up; half even gives 1200
1499.99Thousands1000Hundreds digit 4 rounds down
2.62Multiple of 0.052.60Nearest five cents
2.62Multiple of 0.05, up (ceiling)2.65Always to the larger multiple
17.5Multiple of 520Exactly halfway between 15 and 20
130Multiple of 25125Nearest quarter of a hundred

Rounding 3.14159265 to 0 through 6 decimal places

The number 3.14159265 rounded half up and half even to each number of decimal places; the two modes agree because no digit run is an exact tie.
Decimal placesHalf upHalf evenUp (ceiling)Down (floor)
03343
13.13.13.23.1
23.143.143.153.14
33.1423.1423.1423.141
43.14163.14163.14163.1415
53.141593.141593.141603.14159
63.1415933.1415933.1415933.141592

Rounding 1234.5678 to each place value

The number 1234.5678 rounded half up to the thousands, hundreds, tens, ones, tenths, hundredths and thousandths place.
Place valueStepResultDigit that decides
Thousands100010002
Hundreds10012003
Tens1012304
Ones112355
Tenths0.11234.66
Hundredths0.011234.577
Thousandths0.0011234.5688

Rounding to the nearest 0.05, 0.25, 0.5, 5 or 25

Six numbers rounded half up to the nearest of five multiples; the number is divided by the step, rounded to a whole number and multiplied back.
NumberNearest 0.05Nearest 0.25Nearest 0.5Nearest 5Nearest 25
2.622.602.502.550
7.137.157.257.050
19.9920.0020.0020.02025
43.543.5043.5043.54550
8787.0087.0087.08575
130130.00130.00130.0130125

Negative numbers and ties rounded to a whole number in all six modes

Negative numbers rounded to a whole number; half up and half down mirror each other around zero, while up and down depend on the sign.
NumberHalf upHalf evenHalf downUpDownToward zero
-0.40000-10
-0.5-1000-10
-1.5-2-2-1-1-2-1
-2.4-2-2-2-2-3-2
-2.5-3-2-2-2-3-2
-2.6-3-3-3-2-3-2

Why half even keeps a total from drifting

Five ties, 0.5, 1.5, 2.5, 3.5, 4.5, rounded to whole numbers; the last row adds up each column.
NumberHalf upHalf even
0.510
1.522
2.532
3.544
4.554
Total (exact total 12.5)1512

Exact decimal rounding against binary floating point, to 2 decimal places

The half up answer this calculator gives for numbers on or near a tie, beside what JavaScript’s toFixed(2) returns when the same text is read as a binary floating-point number.
NumberThis calculator (half up)JavaScript toFixed(2)Same answer?
0.1250.130.13Yes
1.0051.011.00No
1.2551.261.25No
2.6752.682.67No
8.3458.358.35Yes
0.6150.620.61No

Worked examples of rounding

Eight numbers, what is asked of each, the rounding mode and the calculator’s result.
NumberRounded toModeResult
4.5Whole numberHalf up5
4.5Whole numberHalf even4
0.1252 decimal placesHalf even0.12
-7.5Whole numberHalf down-7
18.3491 decimal placeUp18.4
65432ThousandsHalf up65000
0.7349Multiple of 0.05Half up0.75
99.9952 decimal placesHalf up100.00

How to round a number

  1. Enter the number. Type it with digits, one decimal point and an optional minus sign, up to 60 characters. The page starts with 2.675.
  2. Choose where to round. Pick decimal places (0 to 30), a place value from millions down to ten thousandths, or the nearest multiple of a number such as 0.05 or 5.
  3. Choose a rounding mode. Half up is the school rule and the default. Pick half even for banker’s rounding, half down, up (ceiling), down (floor) or toward zero.
  4. Read the result and the working. The big figure is the rounded number. Below it the same number is shown in all six modes, and the working lists the two neighbouring multiples and which one is nearer: 2.675 lies between 2.67 and 2.68, exactly halfway.

Frequently asked questions

How do you round a number to 2 decimal places?
Look at the third decimal digit. If it is 5 or more, add 1 to the second decimal digit; if it is 4 or less, keep it. For 2.674 that gives 2.67, for 2.676 it gives 2.68, and for the tie 2.675 the half up rule gives 2.68. If the third digit is 5 and only zeros follow, the number is exactly halfway and the rounding mode decides; the directed modes (up, down, toward zero) ignore which side is nearer.
Why do spreadsheets and JavaScript round differently?
They store numbers as binary floating point, where most decimals cannot be held exactly: 2.675 is really 2.674999999999999822364316…, a hair below the tie, so (2.675).toFixed(2) returns 2.67 and (1.005).toFixed(2) returns 1.00. Spreadsheets such as Excel, Google Sheets and LibreOffice round the 15 significant digits they display, so ROUND(2.675, 2) gives 2.68. JavaScript’s Math.round also treats ties differently from the school rule: Math.round(2.5) is 3 but Math.round(-2.5) is -2, because it sends ties toward positive infinity, while half up here goes away from zero and gives -3. This calculator reads the digits you type as an exact decimal, so none of these surprises occur.
What is banker’s rounding (round half to even)?
A tie is sent to the neighbour whose last digit is even, so ties round up half the time and down half the time. 2.5 gives 2 and 3.5 gives 4, where half up gives 3 and 4. Over many values the rounding errors cancel instead of drifting upward, which is why it is the default in IEEE 754 arithmetic, Python’s round(), .NET’s Math.Round and much financial and statistical software. Only exact ties are affected: 2.6 rounds to 3 in every half mode.
What is the difference between half up, half down and half even?
They differ only when the number is exactly halfway between two candidates. Half up sends the tie away from zero, half down sends it toward zero, and half even sends it to the even neighbour. For 2.5 they give 3, 2 and 2; for -2.5 they give -3, -2 and -2. Away from a tie all three agree.
What do up, down and toward zero mean?
They ignore which neighbour is nearer. Up (ceiling) always goes to the larger neighbour, down (floor) to the smaller one, and toward zero (truncate) drops the extra digits. They only differ for negative numbers: -2.5 rounded to a whole number is -2 with ceiling, -3 with floor and -2 toward zero, while 2.5 gives 3, 2 and 2.
How do I round to the nearest 0.05, 5 or 25?
Choose “The nearest multiple of…” and type the step. The calculator divides the number by the step, rounds that quotient to a whole number with your mode, and multiplies back. 2.62 to the nearest 0.05 is 2.60, 17 to the nearest 5 is 15, and 130 to the nearest 25 is 125. The step must be greater than zero and at most 30 characters.
How do I round to the nearest ten, hundred or thousand?
Choose “A place value” and pick it from the list. 1234.5678 rounds to 1230 at the tens place, 1200 at the hundreds and 1000 at the thousands. Rounding to a place value is the same as rounding to a multiple of 10, 100 or 1,000, so the result has no decimals.
Why is 1.005 rounded to 1.01 here but 1.00 in my code?
Because 1.005 is exactly halfway between 1.00 and 1.01 as a decimal, and half up sends it to 1.01. In binary floating point the stored value is slightly below 1.005, so (1.005).toFixed(2) returns 1.00. To get the decimal answer in code, do the arithmetic on integers or a decimal type, or round the digits as text, which is what this calculator does.
What is the result for a negative number that rounds to zero?
It is shown as plain 0 with no minus sign: -0.4 rounded to a whole number is 0, and -0.001 to 2 places is 0.00. A negative zero has no meaning in decimal arithmetic.
What does 0.5 round to?
It depends on the mode, because 0.5 is exactly halfway between 0 and 1. Half up gives 1, the school answer, and half even gives 0 because 0 is the even neighbour. For -0.5, half up gives -1 (away from zero) and half even and half down give 0. Any value below 0.5 rounds to 0 in every half mode, for example 0 for 0.4999.
Does rounding a list of numbers change their total?
It can. The five ties 0.5, 1.5, 2.5, 3.5, 4.5 add up to 12.5. Rounded half up to whole numbers they add up to 15, because every tie moves up; rounded half even they add up to 12, because the ties split between up and down. When many numbers have to add up to a stated total, round the total once at the end rather than adding rounded values, and say which rule you used.
Why is rounding in two steps a mistake?
Each rounding throws digits away, so a second one can land on the wrong side. Rounding 2.4999 to one decimal place gives 2.5, and rounding that to a whole number gives 3, but rounding 2.4999 to a whole number in one step gives 2, because 2.4999 is below the halfway point 2.5. Always round the original, unrounded number once, to the final place.
How do I round to one decimal place?
Look at the second decimal digit: 5 or more raises the first decimal digit by 1, 4 or less keeps it. 3.14159265 rounds to 3.1, 2.25 is an exact tie that gives 2.3 half up and 2.2 half even, and 18.349 gives 18.3 to the nearest tenth but 18.4 when you always round up. Choose 1 in the decimal places box of the calculator.
How do I round a price to the nearest 5 cents?
Choose “The nearest multiple of…” and type 0.05. A price of 2.62 becomes 2.60, 2.63 becomes 2.65 and 2.625, exactly between two multiples, becomes 2.65 half up or 2.60 half even. Use up (ceiling) to always go to the higher multiple: 2.65 for 2.61. Whether a shop or tax rule rounds a total this way is set by that rule, not by this calculator.
Is there a limit on the size of the number?
The number may be up to 60 characters, the decimal places up to 30 and a multiple up to 30 characters. Within that every digit is kept: 123456789012345678901234567890.5 rounds half up to 123456789012345678901234567891. Commas, exponents such as 1e5 and spaces are not accepted; write plain digits. Nothing you enter leaves your browser.

How it works

The number you type is read as exact decimal digits: a whole number made from every digit, and a count of how many sit after the point, so 2.675 is 2675 with 3 decimals and never a binary approximation. The target is turned into a step: 10^-n for n decimal places, 10^k for a place value such as tens (10) or hundreds (100), or the multiple you typed. The number is divided by the step as an exact fraction; integer division gives the lower multiple and the remainder says how far past it the number is. Comparing twice the remainder with the divisor tells whether the number is below, exactly at or above the halfway point. Half up sends a tie away from zero, half down toward zero, half even to the neighbour with an even quotient; ceiling goes to the larger multiple, floor to the smaller and toward zero drops the remainder. The magnitude is rounded first and the sign applied after, so the rules are symmetric around zero, apart from ceiling and floor, which look at the sign. The answer is the rounded quotient times the step, written with the target’s number of decimals (a multiple shows the decimals of the multiple). A result of zero never carries a minus sign. Input is limited to 60 characters, 30 decimal places and a 30-character multiple, which keeps every calculation instant. Everything runs in your browser and nothing you type is sent anywhere.

Sources

More: Percent, fractions and arithmeticAll math & numbersAll toolsHome & DIY calculators