🔢 Fraction Calculator – Exact Arithmetic for Fractions, Mixed Numbers & Decimals
The Fraction Calculator performs precise arithmetic on fractions, mixed numbers, whole integers, and decimal inputs using exact rational arithmetic. Unlike calculators that rely on floating-point math, this tool keeps every result as a true numerator/denominator pair—so you never see rounding errors like 0.3333333 when the answer is really 1/3.
What Can You Calculate?
Six operation modes cover the most common fraction tasks encountered in school, everyday life, and professional contexts:
Add
Combine two fractions by finding the Least Common Denominator (LCD) and adding numerators.
3/4 + 5/6 = 19/12Subtract
Find the exact difference between two rational values.
7/8 − 1/3 = 13/24Multiply
Multiply numerators together and denominators together, then simplify.
2/5 × 15/8 = 3/4Divide
Multiply the first fraction by the reciprocal of the second.
3/7 ÷ 9/14 = 2/3Compare
Determine which of two fractions is greater using exact cross-multiplication.
3/4 < 5/6Convert
Express a single fraction as a simplified fraction, mixed number, and decimal approximation.
9/4 → 2 1/4 → 2.25Accepted Input Formats
You can type values in any of the following formats and the calculator will parse them correctly:
- Fraction —
3/4,-5/8,22/7 - Mixed number —
1 3/4,-2 1/3(whole part, space, then fraction) - Decimal —
1.5,0.25,-3.75 - Integer —
3,-7,0
Core Calculation Formulas
The underlying engine uses standard rational arithmetic formulas, applied with BigInt precision so that intermediate results never lose accuracy:
Addition
a/b + c/d = (ad + bc) / bdSubtraction
a/b − c/d = (ad − bc) / bdMultiplication
a/b × c/d = (ac) / (bd)Division
a/b ÷ c/d = (a × d) / (b × c)Simplification
GCD(n, d) divides both n and dComparison
compare ad vs bc for a/b vs c/dSimplification to Lowest Terms
Every result is automatically reduced to its simplest form using the Euclidean algorithm to find the Greatest Common Divisor (GCD). For example, 8/12 becomes 2/3 because GCD(8, 12) = 4. The sign is always normalized so only the numerator carries it.
Mixed Number Output
When a result is an improper fraction (numerator larger than denominator), the calculator automatically shows the equivalent mixed number. For instance, 19/12 is also displayed as 1 7/12. This makes it easy to interpret results in real-world contexts such as cooking measurements or construction dimensions.
Step-by-Step Educational Explanations
Enabling the Show Steps toggle reveals a numbered breakdown of every stage: finding the LCD, converting each fraction, performing the operation on numerators, and simplifying by the GCD. This feature is designed for students learning fractions and for anyone who wants to verify their manual work.
Decimal Precision Control
The decimal approximation output can be shown with 0 to 10 decimal places. This is useful when you need a fraction to interact with a decimal-based system (such as a spreadsheet or engineering specification) at a specific precision.
Practical Applications
- Students & educators — verify homework, explore arithmetic properties, and understand each simplification step.
- Cooking & baking — scale recipes involving cup, tablespoon, and teaspoon fractions exactly.
- Construction & carpentry — add or subtract measurements given in fractional inches or feet.
- Finance & ratios — compare fractional interest rates or proportional splits without rounding errors.
Limitations & Tips
The calculator handles very large integers with BigInt precision, but the decimal approximation display is limited to JavaScript's native Number type, which may lose precision for extremely large fractions. Mixed number input requires a space between the whole part and the fraction (e.g., 1 3/4, not 1+3/4). Division by zero is detected and rejected with a clear error message.