Rounding Calculator
Round decimal text to places, significant figures, place values, or custom increments with exact tie-rule traces and error checks.| Step | Value | Precision note | Copy |
|---|---|---|---|
| {{ row.step }} | {{ row.value }} | {{ row.note }} |
| Check | Status | Detail | Copy |
|---|---|---|---|
| {{ row.check }} | {{ row.status }} | {{ row.detail }} |
Rounding turns a detailed numeric value into a value on a chosen grid. A measurement, price, score, ratio, or scientific value may contain more digits than the report, invoice, worksheet, chart, or label should carry. The rounded number is easier to read and compare, but it remains an approximation unless the original value already sits exactly on the chosen step.
The precision target controls the shape of that grid. Decimal places keep a fixed number of digits after the decimal point. Significant figures keep a fixed number of meaningful digits from the first nonzero digit, which works better when numbers vary from very small to very large. Named place values round to positions such as hundreds, ones, tenths, and thousandths. Custom increments round to a practical step such as 0.05, 0.125, or 5.
| Target idea | Typical use | Common mistake |
|---|---|---|
| Decimal places | Currency, percentages, worksheet answers, displayed measurements. | Treating more decimals as more accuracy when the original measurement was rough. |
| Significant figures | Scientific notation, lab values, ratios across different magnitudes. | Counting leading zeros before the first nonzero digit as significant. |
| Place value | Budgets, counts, distances, estimates, large-number summaries. | Forgetting that rounding to thousands can change the apparent size of a small difference. |
| Increment | Tick sizes, package quantities, fractional measurements, cash or pricing steps. | Using a step that cannot be written as a finite decimal when exact decimal reporting is required. |
Halfway cases need special care. A value such as 1.005 is exactly between 1.00 and 1.01 when the target is two decimal places. Some conventions move that case away from zero, some choose the even kept digit, and some move toward positive infinity. The same rule can feel different for negative numbers because -12 is closer to positive infinity while -13 is farther from zero.
Trailing zeros also carry meaning. The values 15.5 and 15.50 are numerically equal, but the second value signals hundredth-place precision. In measurement notes, invoices, engineering estimates, and classroom work, the rounded value should travel with the original precision target and the tie rule so another reader can reproduce the choice.
Rounding is usually safest at the reporting boundary. Rounding intermediate values in a longer calculation can stack small differences into a larger error, especially when the rounded values are added, averaged, converted, or compared later.
How to Use This Tool:
Start with the typed number, choose the target precision, then choose the rule before you copy or export the result.
- Enter
Number to round. Finite decimals, integers, and scientific notation work, including examples such as1.005,-12.5, and6.022e23. Commas and underscores are ignored. - Choose
Target type. The precision control changes toDecimal places,Significant figures,Place value, orIncrement. - Set the target. Decimal places accept 0 to 12, significant figures accept 1 to 16, place values run from millions through millionths, and increments accept positive decimal steps or terminating fractions.
- Pick the
Rounding rule. Use half-up for the common school rule, half-even for banker-style ties, ties toward positive infinity for JavaScript-style whole-number ties, or a directional rule when every nonzero discarded amount must move one way. - Open
Advancedwhen display precision matters.Keep trailing zerospreserves zeros implied by the selected target, while thousands separators change the display without changing the numeric payload. - Read the summary value, then check
Rounding Tracefor the target quantum, signed difference, absolute error, and relative error when it is defined. - Use
Rule Audit,Rounding Error Curve, or the JSON view when you need evidence for the rounding decision. Alerts point to input problems such as a missing number, an out-of-range exponent, or a non-terminating fraction increment.
Interpreting Results:
The summary shows the rounded value and badges for the precision target, rounding rule, and value change. exact target means the input already matched the selected grid. A delta badge means rounding changed the value, and the sign tells whether the rounded value is above or below the original input.
A surprising result is often a rule mismatch rather than an arithmetic error. Check negative numbers and exact halves first, because ceiling, floor, truncation, half-up, half-even, and ties toward positive infinity make visibly different choices there.
| Output cue | What it tells you | How to avoid a bad read |
|---|---|---|
Rounded value |
The final value after the selected target and rule are applied. | Do not treat it as the original value unless the trace says the input was already exact. |
Target quantum |
The grid spacing, such as 0.01, 1000, or 0.125. |
A smaller quantum keeps more digits, but it does not improve the source measurement. |
Signed difference |
Rounded value minus the original input. | A positive difference means the rounded value increased, not that the original number was positive. |
Absolute error |
The magnitude of the rounding change without its sign. | Use it to compare size of change, not direction. |
Relative error |
Signed difference divided by the original input, shown as a percentage when possible. | It is unavailable for zero because a percentage change from zero has no finite value. |
Rounding Error Curve |
Nearby precision targets and their signed and absolute errors. | Use it to choose a readable precision, not to make a rounded value more true than the input. |
When results are copied into a report, keep the rule and target alongside the rounded value. A value such as 2.38 is not fully reproducible unless the reader knows whether it came from two decimal places, an eighth-unit increment, or a different precision rule.
Technical Details:
A rounded value is selected from a grid. The grid spacing is the target quantum, written as q: 0.01 for two decimal places, 10 for tens, 0.0001 for four decimal places, or 0.125 for an eighth-unit increment. The original value is compared with the lower grid point and the next grid point. If it lands exactly between them, the tie rule chooses the side.
The sign changes how directional rules feel. Ceiling always moves toward positive infinity, so a negative value can move closer to zero. Floor always moves toward negative infinity, so the same negative value can become more negative. Truncation is different again because it moves toward zero for both positive and negative values.
Formula Core
The rounding decision starts by splitting the input magnitude into whole quanta and a remainder.
x is the input value, q is the target quantum, n is the lower whole-quantum count, and r is the discarded amount.
If r = 0, no movement is needed. For nearest-style rules, 2r < q keeps the lower magnitude and 2r > q moves to the next magnitude. The exact tie case 2r = q is where half-up, half-even, and ties toward positive infinity can diverge.
Significant-figure rounding chooses the quantum from the first nonzero digit. If p is the requested significant-figure count and e is the adjusted base-10 exponent of the value, the quantum is 10^(e - p + 1). For example, with 60220 and four significant figures, e = 4 and the quantum is 10. With 0.006022 and four significant figures, e = -3 and the quantum is 0.000001.
| Precision target | Quantum rule | Accepted range |
|---|---|---|
Decimal places |
Power of ten after the decimal point, such as 0.01. |
0 to 12 decimal places. |
Significant figures |
Power of ten based on the first nonzero digit and requested figure count. | 1 to 16 significant figures. |
Named place value |
Named power of ten, from 1000000 through 0.000001. |
Millions through millionths. |
Custom increment |
Positive decimal step or terminating fraction converted to a decimal quantum. | Up to 12 decimal places after conversion. |
| Rule | Remainder behavior | Example to ones |
|---|---|---|
Nearest, 5 rounds away from zero |
Less than half stays lower, more than half moves up, exactly half increases magnitude. | -12.5 becomes -13. |
Nearest, banker's half-even |
Exactly half chooses the candidate whose kept digit is even. | -12.5 becomes -12. |
Nearest, ties toward +infinity |
Exactly half chooses the candidate closer to positive infinity. | -12.5 becomes -12. |
Ceiling |
Any nonzero discarded amount moves toward positive infinity. | -12.1 becomes -12. |
Floor |
Any nonzero discarded amount moves toward negative infinity. | -12.1 becomes -13. |
Truncate, toward zero |
Discarded digits never increase magnitude. | -12.9 becomes -12. |
Away from zero |
Any nonzero discarded amount increases magnitude. | -12.1 becomes -13. |
Error Measures
The error fields compare the rounded value with the original input. Signed difference keeps direction, absolute error removes direction, and relative error expresses the signed difference as a percentage of the original value when that division is finite.
x is the typed input, y is the rounded value, and d is the signed difference. Relative error is not reported for zero input.
Decimal text is handled before display conversion, which prevents common binary floating-point surprises for values such as 1.005. The input accepts up to 90 significant digits, scientific-notation exponents from -120 to 120, and no more than 120 decimal places after applying scientific notation. These limits keep the result reproducible while covering ordinary measurement, finance, education, and data-cleaning cases.
A fraction increment is accepted only when it reduces to a denominator made from factors of 2 and 5. That is the finite-decimal test: 1/8 becomes 0.125, 3/25 becomes 0.12, and 1/3 is rejected because its decimal expansion repeats forever.
Limitations and Privacy Notes:
Rounding does not repair uncertain input. If a measurement is only reliable to the nearest tenth, showing four decimal places may make the value look more exact than it is. Keep the original value and the measurement context when the rounded number will drive a decision.
The relative error percentage is undefined when the input is zero, and it can look large when the original value is very close to zero. In those cases, the signed difference and absolute error are usually more useful than the percentage.
After the page assets load, the rounding calculation, trace, audit table, chart data, copied value, and downloads are produced in the browser. The tool does not need a server-side rounding request for the numbers you enter.
Worked Examples:
Enter 1.005, choose Decimal places, set places to 2, and use Nearest, 5 rounds away from zero. The target quantum is 0.01. The input is exactly halfway between 1.00 and 1.01, so the rounded value is 1.01 and the signed difference is +0.005.
Enter -12.5, choose the Ones place, and compare tie rules. Nearest, ties toward +infinity returns -12. Nearest, 5 rounds away from zero returns -13. Nearest, banker's half-even also returns -12 because 12 is the even kept digit.
For a fractional measurement, enter 2.37, choose Custom increment, and set the increment to 1/8. The step becomes 0.125, so the nearest half-up result is 2.375. The trace shows the increment quantum and the small positive difference from the original value.
If the increment is 1/3, the tool asks for a different increment because one third cannot be expressed as a finite decimal. Use a terminating fraction such as 1/8, 1/16, 1/20, or 3/25 when the rounded grid must be decimal-exact.
FAQ:
Why does 1.005 round to 1.01 here?
The entered decimal text is treated as exact decimal digits. With a 0.01 target and the half-up rule, 1.005 is exactly halfway between 1.00 and 1.01, so magnitude increases.
What is the difference between half-up and half-even?
Half-up sends exact halves away from zero. Half-even sends exact halves to the candidate whose kept digit is even, which can reduce repeated upward bias in long sets of rounded values.
When should I use significant figures instead of decimal places?
Use significant figures when the meaningful digit count should stay consistent across different magnitudes. Four significant figures treats 60220 and 0.006022 by their first nonzero digit, while decimal places only count positions after the decimal point.
Why is relative error unavailable for zero?
Relative error divides the signed difference by the original input. When the original input is 0, that division has no finite percentage result.
Why was my fraction increment rejected?
The increment must convert to a finite decimal with 12 decimal places or fewer. After reduction, denominators built only from 2s and 5s work, so 1/8 and 3/25 are accepted while 1/3 is rejected.
Can I export the rounding evidence?
Yes. The trace and audit tables can be copied or downloaded, the error curve can be downloaded as an image or CSV, and the JSON view includes the rounded value, target, rule, differences, trace rows, audit rows, and chart rows.
Glossary:
- Target quantum
- The spacing between allowed rounded values, such as
0.01,10, or0.125. - Significant figures
- The meaningful digits counted from the first nonzero digit.
- Halfway case
- A value exactly halfway between two adjacent rounding targets.
- Half-even
- A tie rule that chooses the rounded value whose kept digit is even.
- Ceiling and floor
- Directional rules that move toward positive infinity and negative infinity, respectively.
- Signed difference
- The rounded value minus the original input.
- Terminating fraction
- A fraction that converts to a finite decimal step, such as
1/8or3/25.
References:
- NIST Guide to the SI, Chapter 7, National Institute of Standards and Technology.
- RoundingMode, Oracle Java SE 25 API documentation.
- decimal rounding modes, Python documentation.
- Math.round, ECMAScript Language Specification.
- Rounding Modes, Unicode ICU Documentation.