The Util Box

Rounding Calculator

Free online rounding calculator. Round numbers to N decimal places. Accurate and easy to use.

Result

Original

3.14159

2 decimal places

3.14

Fraction form (original)

355/113

Fraction form (rounded)

157/50

Step: Half-way up → 314.159 → round to 314 → 3.14

Embed this tool

Copy and paste the code below into your website to embed this tool for free. An attribution link to The Util Box is required.

<iframe src="https://www.theutilbox.org/embed/rounding-calculator" width="600" height="500" frameborder="0" style="border: none; max-width: 100%;" title="Free Rounding Calculator tool from The Util Box"></iframe>
<!-- Free tool by The Util Box — https://www.theutilbox.org/tools/rounding-calculator -->
<a href="https://www.theutilbox.org/tools/rounding-calculator">Rounding Calculator by The Util Box</a>

Frequently Asked Questions about Rounding Calculator

Rounding Calculator — Five Methods and Significant Figures

This rounding calculator rounds a number five different ways and shows you exactly what each one does, because the choice of method is what decides the answer at the halfway point.

The methods are half-up, half-down, floor, ceiling and half-even — bankers' rounding — plus a separate mode for rounding to a number of significant figures. The result is given as a decimal and as a fraction, with a one-line explanation of the working.

The Five Methods

Method What it does at a halfway point
Half-up Rounds up. This is what most people mean by "round to nearest".
Half-down Rounds down, so 0.5 becomes 0 rather than 1.
Floor Always towards negative infinity.
Ceil Always towards positive infinity.
Half-even Rounds to the nearest even digit, so 2.5 becomes 2 and 3.5 becomes 4.

Half-even is worth explaining, because it is the one that surprises people. It exists because rounding every halfway case up biases a total upward — adding up a hundred values each ending in 0.5 gives a result half a unit too high. Rounding to even keeps the bias at zero, which is why it is the default in IEEE 754 arithmetic and in most spreadsheet software.

Significant Figures

The second mode rounds to a number of significant figures rather than a number of decimal places, which is the right measure for scientific values. 1234.5 to three significant figures is 1230, not 1234.50 — because the zeros in 1230 are placeholders, not significant digits.

The fraction form is found with a continued-fraction expansion, which finds the simplest rational close to the value: 0.75 comes back as 3/4, and 3.14159 comes back as a long fraction very close to π.

Honest Limits

  • "Half-up" here means away from zero for negatives, so −2.5 becomes −3. Some textbooks call that "round half away from zero" rather than "half up", and the distinction matters when you are rounding negative values.
  • Floor and ceiling are not symmetric for negatives. Floor(−2.5) is −3 while ceil(−2.5) is −2, which is the standard definition rather than a rounding error, but it surprises anyone expecting "down" and "up" to be mirror images.
  • The fraction form is an approximation, found to within a relative tolerance of about one part in a million, so it will not match the exact rational for most decimals — which is usually what you want anyway.
  • The decimal-places field is not clamped, so a value outside 0–10 is accepted even though the field suggests those bounds.

Related Calculators

The calculation runs entirely in your browser and works offline.