Rounding Calculator
Round exact decimal text by places, significant figures, named values, or custom increments with explicit tie rules and error traces.{{ summaryTitle }}
{{ summaryLine }}
{{ primaryCopyAnnouncement }}
The chart renderer is unavailable. The same distances remain available in the trace and decision ledger.
- {{ row.label }}
- {{ row.display }}
Decision method:
- {{ row.label }}{{ row.value }}
{{ row.note }}
| Signal | Value | Meaning | Copy |
|---|---|---|---|
| {{ row.label }} | {{ row.display }} | {{ row.detail }} |
Rounding replaces a detailed value with the nearest or directionally chosen value on a coarser numeric grid. That grid may represent cents, measurement resolution, significant digits, package quantities, or any other reporting step. The result is easier to communicate, but it is an approximation unless the original value already lies on the grid.
| Precision target | What stays fixed | Typical use |
|---|---|---|
| Decimal places | Digits after the decimal point | Prices, displayed percentages, worksheet answers |
| Significant figures | Meaningful digits from the first nonzero digit | Measurements and values spanning different magnitudes |
| Named place value | A power-of-ten position such as hundreds or thousandths | Budgets, counts, estimates, large-number summaries |
| Custom increment | A chosen step such as 0.05, 0.125, or 5 | Tick sizes, fractional measures, package quantities |
Choosing the precision does not settle every case. A value exactly halfway between two allowed results needs a tie rule. Ties away from zero sends 1.005 to 1.01 at two decimal places. Half-even instead chooses the result whose kept digit is even, which sends the same value to 1.00.
Negative values reveal why rule names matter. Ceiling always moves toward positive infinity, so rounding -12.5 to an integer by ceiling gives -12. Floor moves toward negative infinity and gives -13. Truncation moves toward zero, while away-from-zero always increases magnitude when any remainder exists.
Written precision can carry information even when numeric values are equal. 15.5 and 15.50 represent the same number, but the second form can signal hundredth-place reporting. Keep the precision target and rule with the rounded value when another reader may need to reproduce the choice.
Round at the reporting boundary whenever possible. Reusing rounded intermediate values in sums, averages, rates, or conversions can accumulate error and may move a later result across a threshold that the full-precision calculation would not cross.
How to Use This Tool:
Enter the exact decimal text, choose the spacing between allowed results, and then choose how ties or discarded amounts should move.
- Enter Number to round as an integer, decimal, or scientific-notation value such as
1.005,-12.5, or6.022e23. - Choose Decimal places, Significant figures, Named place value, or Custom increment, then set the corresponding target.
- Select the Rounding rule. Check the rule carefully for negative values and exact halves, where common conventions differ.
- Read the rounded value and inspect the trace for the target quantum, remainder position, signed difference, and error. Correct rejected increments or out-of-range precision before using the result.
Interpreting Results:
The target quantum is the gap between adjacent allowed values. A smaller quantum keeps more detail but cannot add accuracy that was absent from the source. The signed difference is rounded value minus input; its sign describes the direction of the change, not the sign of the original number.
Relative error is unavailable when the input is zero because division by zero has no finite percentage meaning. Thousands separators and retained trailing zeros change the copied text, not the underlying rounded number or decision.
- Rounding cannot improve measurement quality or restore digits that were never reliable.
- Custom increments such as
1/3are rejected because they do not terminate in decimal form. - Very large or small exact decimal inputs are rejected when their numeric display projection is not finite.
- All entered values and calculations remain in the browser.
Technical Details:
Supported input is parsed as an integer coefficient plus a decimal scale. This exact decimal representation avoids the binary floating-point surprise that can occur when a value such as 1.005 is first approximated in base 2. Commas and underscores are ignored before parsing.
Formula Core:
Every precision target becomes a positive quantum q. The magnitude of the input is then divided into a whole number of quanta n and a remainder r.
| Target | Quantum | Supported range |
|---|---|---|
| Decimal places p | q = 10−p | 0 to 12 places |
| Significant figures s | q = 10e−s+1, where e is the adjusted base-10 exponent | 1 to 16 figures |
| Named place | The power of ten represented by millions through millionths | 106 through 10−6 |
| Custom increment | The entered positive terminating decimal step | At most 12 decimal places |
The rule decides whether the magnitude remains at nq or increases to (n + 1)q. For nearest rules, a remainder below half stays at the smaller magnitude and a remainder above half selects the larger magnitude. Exact halves follow the chosen tie policy.
Rule Core:
| Rule | Decision when a remainder exists |
|---|---|
| Nearest, ties away from zero | Choose the nearest target; an exact half increases magnitude. |
| Nearest, half-even | Choose the nearest target; an exact half selects the even whole-quantum count. |
| Nearest, ties toward +∞ | Choose the nearest target; an exact half selects the value toward positive infinity. |
| Ceiling | Move toward positive infinity. |
| Floor | Move toward negative infinity. |
| Truncate | Move toward zero. |
| Away from zero | Increase magnitude. |
The displayed error measures compare the selected result y with the exact parsed input x.
Inputs may contain at most 90 significant digits and an exponent from −120 to 120. A custom fraction is accepted only when its reduced denominator contains no prime factors other than 2 and 5, which makes its decimal expansion terminate within 12 places.
Rounded text, the target quantum, and signed and absolute differences come from exact decimal arithmetic. Relative error is a finite numeric projection of those values and can carry ordinary floating-point display noise.
Worked Examples:
Exact half at two decimal places
For 1.005, the quantum is 0.01 and the remainder is exactly half a quantum. Ties away from zero selects 1.01, with a signed difference of +0.005. Half-even selects the value 1; enabling retained trailing zeros displays that same result as 1.00.
Negative tie toward positive infinity
Rounding -12.5 to ones with ties toward positive infinity gives -12. The signed difference is +0.5, even though the selected result has smaller magnitude, because -12 is numerically greater than -12.5.
References:
- NIST SP 811, Guide for the Use of the International System of Units, National Institute of Standards and Technology, 2008 Edition.
- RoundingMode, Oracle Java SE 26 API documentation.