Rounding Calculator

With the entered 3.14159 and two decimal places, the result is 3.14; the signed difference from the original is −0.00159. Keep intermediate values unrounded when calculating a final total. This tool reports a binary floating-point rounding result, so it does not certify a contractual decimal rounding rule.

Rounding Calculator: inputs

Calculated result
Rounded value3.1
Difference from original0.00159

Rounding Calculator: Value sensitivity

Rounding Calculator: Value and Rounded value5 calculations vary the “Value” input while holding the other entered inputs constant.2.52.52.82.83.13.13.53.53.83.8

Rounding: worked example

Value3.1
Decimal places2
Rounded value3.1
Difference from original0.00159

Rounding: formula

Rounded value = round(value × 10^places) ÷ 10^places

MDN: JavaScript Math.round

Enter a value and a whole-number count of decimal places. This implementation uses JavaScript Math.round after scaling by 10^places. Exact halfway cases go toward positive infinity: 2.5 goes to 3, but −2.5 goes to −2 at zero places.

Negative places round to tens or hundreds. This differs from both half-away-from-zero and half-to-even conventions.

Rounding: changing Value

ValueRounded valueDifference from original
2.52.50.003
2.82.8-0.003
3.13.10.002
3.53.5-0.004
3.83.80

Rounding: compare input ranges

InputTested fromToRounded value: low inputRounded value: high inputSwing
Value2.83.52.83.50.63 (20%)
Decimal places133.13.10.042 (1.3%)

Rounding: individual input comparisons

InputValueRounded valueDifference from original
Value2.52.50.003
2.82.8-0.003
3.13.10.002
3.53.5-0.004
3.83.80
Decimal places030.142
13.10.042
23.10.00159
33.1-0.00041
43.1-0.00001

Rounding: combined input changes

Value / Decimal places024
2.532.52.5
2.832.82.8
3.133.13.1
3.533.53.5
3.843.83.8

Rounding: which assumptions move the result?

Rounding: Rounded value as Value changesRounded value starts at 2.5. Moving Value from 2.5 to 3.8 changes it to 3.8, with Decimal places 2 kept fixed.2.52.52.82.83.13.13.53.53.83.8
Chart quantityDisplayed settings
Value2.5 → 3.8
Rounded value2.5 → 3.8
Decimal places2
Rounding: Rounded value as Decimal places changesRounded value starts at 3. Moving Decimal places from 0 to 4 changes it to 3.1, with Value 3.1 kept fixed.0313.123.133.143.1
Chart quantityDisplayed settings
Decimal places0 → 4
Rounded value3 → 3.1
Value3.1

Rounding: values and definitions

Quantity and definitionValue used
Value3.1
Decimal places2
Rounded value3.1
Difference from original0.00159

Rounding: half and double Value

ValueRounded value
1.61.6
3.13.1
6.36.3

Common error: Rounding a value early and then using the rounded figure in further math. A number rounded for a report is a display choice; feeding that shortened version back into another formula is a different, avoidable error.

A decimal input may have an inexact binary representation before scaling. Here 1.005 at two places produces 1.00, whereas 2.675 produces 2.68. Exact half ties follow Math.round toward positive infinity; decimal financial rules may require a different implementation.

Algebra & Arithmetic calculators: Weighted Average Calculator, 2x2 Matrix Determinant Calculator, 3x3 Matrix Determinant Calculator, Scientific Calculator, Fraction Calculator, Decimal to Fraction Calculator.

Rounding trades precision for readability, and that trade is invisible until it's chained. Round three intermediate results in a multi-step calculation and the final answer can drift measurably from what the same calculation gives using full precision throughout, because each rounding step introduces its own small error and those errors don't cancel: they usually stack.

Keep full, unrounded precision through every intermediate step of a calculation, and round only the final number that gets reported or displayed.

See scientific notation for expressing large and small numbers with significant figures, and the percent error page for measuring the effect of rounding. The mean and standard deviation calculators use unrounded data, and the sales tax calculator rounds to cents. The unit conversion pages need care with precision.

How do I round to two decimal places?

Look at the third decimal digit: if it is 5 or more, increase the second decimal by one, otherwise leave it unchanged, and drop the rest.

Should I round at each step of a calculation?

No. Keep full precision until the final answer, then round once, to avoid accumulating rounding error.

Why does 2.5 sometimes round to 2?

Some systems use round-half-to-even, sometimes called banker's rounding, to avoid bias, so 2.5 rounds to 2 and 3.5 rounds to 4.