How this rounding calculator works
Type any number, pick the place value you want (or switch to significant figures), and you get the rounded result along with a table showing that same number rounded to every common place at once: whole, tenth, hundredth, thousandth, ten, hundred, and thousand. That table is handy when you are not sure which precision you actually need, or when you want to compare a few side by side. Every result comes with the exact steps worked out using your number, not a generic example.
The rounding rule
This is round half up. For negative numbers, this calculator rounds by magnitude first (so -2.5 and 2.5 are treated the same at the halfway point) and then reattaches the sign, which means -2.5 rounds to -3, not -2. That is the convention nearly every math class, spreadsheet function, and calculator uses by default. A different convention, banker's rounding (round half to even), shows up in accounting and in the IEEE floating-point standard, because it does not bias a long run of numbers consistently upward; see the FAQ below for when that matters.
Worked example
Round 3.14159 to every common place value.
Nearest whole number: the tenths digit is 1, which is less than 5, so round down: 3.
Nearest tenth: the hundredths digit is 4, less than 5, round down: 3.1.
Nearest hundredth: the thousandths digit is 1, less than 5, round down: 3.14.
Nearest thousandth: the ten-thousandths digit is 5, which is 5 or more, so round up the thousandths digit from 1 to 2: 3.142.
Nearest ten, hundred, and thousand: 3.14159 is smaller than 5, so each of these rounds down to 0. Rounding to a coarser place than your number's own size is a legitimate answer, just not always a useful one.
Place value refresher
Every digit's position gives it a value ten times bigger than the digit to its right. Rounding always means: keep everything down to one chosen place, and replace (or drop) everything past it.
| Place | Value | Example digit in 4,321.567 |
|---|---|---|
| Thousands | 1,000 | 4 |
| Hundreds | 100 | 3 |
| Tens | 10 | 2 |
| Ones | 1 | 1 |
| Tenths | 0.1 | 5 |
| Hundredths | 0.01 | 6 |
| Thousandths | 0.001 | 7 |
Significant figures, done properly
Significant figures (sig figs) count meaningful digits rather than decimal places, which makes them a measure of precision instead of a measure of position. Three rules cover almost every case:
- Every nonzero digit is significant. 314 has 3 sig figs.
- Leading zeros never count, no matter how many there are. 0.0041 has 2 sig figs (the 4 and the 1); the zeros are just placeholders showing how small the number is.
- Trailing zeros after a decimal point do count. 3.10 has 3 sig figs, because writing that extra zero is a deliberate claim that you measured precisely enough to know the hundredths digit is exactly 0, not just "about 3.1."
Rounding to n significant figures means: find the first nonzero digit, count n digits from there (including that first one), and round at that place using the same 5-or-more rule. So 0.004052 rounded to 2 sig figs looks past the two leading zeros, keeps the 4 and the next digit, and rounds using the digit after that: 0.0041.
The floating-point honesty section
Computers store decimal numbers in binary, and most decimals cannot be written exactly in binary any more than 1/3 can be written exactly in decimal. That mismatch causes a famous bug: the obvious way to round in code, something like Math.round(x * 100) / 100, quietly turns 1.005 into 1.00 instead of 1.01. It happens because 1.005 is not actually stored as 1.005; it is stored as the closest binary approximation, which lands a hair below 1.005, so the multiply-and-round step never sees a true 5 to round up.
This calculator sidesteps the whole problem by never converting your number into that kind of binary math in the first place. It reads the digits you typed as text and rounds them the way you would on paper, one digit at a time. Try 1.005 to the nearest hundredth above: you will correctly get 1.01. Try 2.675, a case that trips up the naive approach even worse: you will correctly get 2.68.