Inputs
Advanced options includedExample Data
Click "Recompute from current settings" to apply your denominator and mode.
| # | Input | Denominator | Mode | Rounded (mixed) | As decimal |
|---|---|---|---|---|---|
| 1 | 1 3/8 | 8 | half_even | ||
| 2 | -5/4 | 8 | half_even | ||
| 3 | 2.75 | 8 | half_even | ||
| 4 | 0.33 | 3 | half_up | ||
| 5 | -1.5 | 2 | half_down |
Formula Used
Goal: round a real number x to the nearest fraction with denominator n.
- Convert any input to a real number: for a fraction a/b, use x = a ÷ b. For a mixed number w a/b, use x = sign(w) × (|w| + a/b).
- Compute k = round_mode(x × n) where round_mode applies your selected rule (half up, half down, half even, toward/away from zero, ceiling, floor).
- The rounded fraction is k/n. Reduce by gcd(|k|, n) and optionally format as a mixed number: k/n = s × (q + r/n) where q = ⌊|k|/n⌋ and r = |k| mod n, sign s ∈ {−1, +1}.
For decimals, the same formula applies because decimals are real numbers.
How to Use
- Enter a value as a fraction (e.g., 5/4), mixed number (e.g., 1 3/8), or decimal (e.g., 2.75).
- Set your target denominator or pick a quick preset.
- Choose a rounding mode: nearest with tie rules, directed, or truncation.
- Select the output format. Use decimal places if decimal output is chosen.
- Click Calculate. Inspect the result chips and the optional step-by-step explanation.
- Use the example table to try common cases and export CSV/PDF.
FAQs
Rounding Modes Cheat Sheet
| Mode | Definition | Example (+1.25 to halves) | Example (−1.25 to halves) |
|---|---|---|---|
| Nearest, ties to even | Pick nearest; if tie, choose even neighbor. | 1.25 → 1.0 | −1.25 → −1.0 |
| Nearest, ties go up | Ties move away from zero on positives. | 1.25 → 1.5 | −1.25 → −1.5 |
| Nearest, ties go down | Ties move toward zero on positives. | 1.25 → 1.0 | −1.25 → −1.0 |
| Toward zero (truncate) | Drop fractional step toward zero. | 1.25 → 1.0 | −1.25 → −1.0 |
| Away from zero | Push fractional step away from zero. | 1.25 → 1.5 | −1.25 → −1.5 |
| Ceiling | Always round up (toward +∞). | 1.25 → 1.5 | −1.25 → −1.0 |
| Floor | Always round down (toward −∞). | 1.25 → 1.0 | −1.25 → −1.5 |
Tip: For measurements, “ties to even” reduces systematic bias across many readings.
Denominator Quick Reference & Typical Uses
Examples use nearest with ties to even and input x = 2.73.
| Denominator n | Step 1/n | Rounded value | As mixed | Typical uses |
|---|---|---|---|---|
| 2 | 0.5 | 2.5 | 2 1/2 | Carpentry rough cuts, quick estimates |
| 3 | 0.333… | 2.666… | 2 2/3 | Cooking thirds, tiling layouts |
| 4 | 0.25 | 2.75 | 2 3/4 | Woodworking quarters, fasteners |
| 5 | 0.2 | 2.8 | 2 4/5 | Finance tenths/fifths, machining |
| 8 | 0.125 | 2.75 | 2 3/4 | Cabinetry, pipe fittings |
| 10 | 0.1 | 2.7 | 2 7/10 | Metric approximations, decimals |
| 16 | 0.0625 | 2.75 | 2 3/4 | Fine woodworking, metalwork |
| 32 | 0.03125 | 2.71875 | 2 23/32 | Precision jigs, calibration |
- Maximum absolute error for nearest rounding ≤ 1/(2n).
- Reducing the fraction preserves the same numeric value, just simplified.
- Choose n based on your domain’s common increments and tolerances.