Rounding Calculator
Round a number to decimal places or to the nearest step, choosing half-up, half-even, up or down — and the mode is printed with the answer.
What the rounding calculator does
It rounds one number to a unit you choose and prints the mode it applied. A mode alone is not an answer — “round half-up” means nothing until you name the place — so the unit is one of two controls: a number of decimal places from 0 to 12, or a step such as 0.25 for the nearest quarter.
The modes are half-up (ties away from zero, the everyday rule), half-even (ties to the even neighbour, also called banker's rounding), up (toward positive infinity) and down (toward negative infinity). A non-empty step wins over the decimal-places control, and the result line says which unit was used.
The arithmetic is double precision, cleaned to 12 decimal places after the mode has chosen a multiple; the page says so rather than promising exact decimal arithmetic. Numbers above 1e15, a step of zero or below, a step smaller than 0.000000001, and more than 12 decimal places are refused with the value named.
How to use it
Enter the number to round in the text box. Choose the mode, then either a number of decimal places or a step — leave the step empty to use the decimal places.
Press Run. The result states the rounded value, the unit and the mode that was applied.
Worked example
Input with the defaults (half-up, 2 decimal places):
12.3456
Output:
12.3456 rounded half-up to 2 decimal places = 12.35
Mode applied: half-up (ties away from zero).
Why it runs in your browser
The rounding is local JavaScript arithmetic. The number you type is not sent to a server, and nothing is retained.
Round one number to a unit you choose and print the mode that was applied. A mode without a unit is not an answer, so the page asks for both.
The unit is decimal places from 0 to 12, or a step such as 0.25 for the nearest quarter. A step wins over the decimal count, and the result line says which one was used.
Half-up, half-even, up and down are the four modes. The tie case is where half-up and half-even disagree, and the page names the mode so the answer is never ambiguous.
The modes, and the tie that separates them
Half-up rounds a tie away from zero: 2.5 becomes 3 and -2.5 becomes -3. It is the rule most people learn at school. Half-even, also called banker's rounding, sends a tie to the even neighbour: 2.5 becomes 2, 3.5 becomes 4, and -2.5 becomes -2. That is the rule many accounting and floating-point systems use, because it does not bias a long column upward.
Up and down are the ceiling and the floor: up moves toward positive infinity and down toward negative infinity, whether or not the value is near a tie. They are not the same as half-up and half-down, which only decide ties.
The step control rounds to a multiple of a positive number, so 0.25 gives the nearest quarter and 10 gives the nearest ten. It takes precedence over the decimal-places control, which is why the result line names both the unit and the mode.
How to use Rounding Calculator
Enter the number to round in the text box, then choose a mode: half-up is the everyday default.
Set the decimal places from 0 to 12, or type a step when you want the nearest multiple. Leave the step empty to use the decimal places.
Press Run. The result prints the rounded value, the unit it used and the mode it applied.
What to Expect
Best for
- Rounding to a stated number of decimals without guessing the tie rule
- Rounding prices or measurements to the nearest step
- Seeing why 2.5 rounds to 2 in a spreadsheet but 3 at school
Not ideal for
- Exact decimal arithmetic: this is double precision, cleaned after the choice
- Rounding a whole column at once, which is a list tool
What this tool keeps
- The number you entered, printed before the result
- The mode and unit, printed with the answer
What may need cleanup
- Double-precision inputs can surprise at the 15th digit
- A step smaller than 0.000000001 is refused
Common errors
- Enter the number to round first.
- The step must be a positive number
- Decimal places must be a whole number from 0 to 12
Example use cases
- Rounding a measurement to two decimals
- Checking a banker's-rounding result from a spreadsheet
- Rounding to the nearest 0.05 for a price
Sample input
12.3456 with the defaults, half-up to 2 decimal places.
Sample output
12.35, with the mode and the unit printed beside it.
Who this is for
- Students checking a rounding rule
- Anyone reconciling a spreadsheet with an invoice
Frequently asked questions
What is the difference between half-up and half-even?
They agree except on an exact tie. Half-up sends 2.5 to 3 and -2.5 to -3. Half-even sends a tie to the even neighbour, so 2.5 becomes 2, 3.5 becomes 4 and -2.5 becomes -2.
Does the step or the decimal count win?
The step wins. If the step field is not empty, the page rounds to the nearest multiple of that step and ignores the decimal-places value; the result line says which unit was used.
Is the answer exact decimal arithmetic?
No. The input is a JavaScript double, and the result is cleaned to 12 decimal places after the mode chooses a multiple. That is precise enough for display, but it is not a decimal library and the page says so.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.