Fraction Calculator
Add, subtract, multiply and divide fractions with simplified results.
Reviewed by Aygul Dovletova · Last reviewed
Using the Fraction Calculator
- Fill in the first fraction - numerator on top, denominator on the bottom. Negative numerators are allowed (for example -3/4); a zero denominator shows a validation error because division by zero is undefined.
- Pick the operator with the + / - / × / ÷ buttons. Only one operation is performed at a time; for longer expressions run the output back through the tool as the first operand.
- Fill in the second fraction the same way. If you only need to simplify a single fraction, leave the second one as 1/1 and pick multiplication.
- Press Calculate. The output appears as a simplified fraction with the sign on the numerator, alongside the decimal expansion to six places and a mixed-number form when the magnitude is ≥ 1.
- Reuse the result by copying it and pasting the numerator and denominator back into the first fraction for the next step.
What is mixedNumberForm in Mathematica?
MixedNumberForm[expr] is a Wolfram Mathematica typesetting wrapper that displays a rational number as an integer plus a proper fraction instead of as an improper fraction. Evaluating MixedNumberForm[7/4] prints 1 3/4; MixedNumberForm[11/3] prints 3 2/3; MixedNumberForm[-11/3] prints -3 2/3. The wrapper only changes how the value is shown, not what it is - the underlying rational is still 7/4, so subsequent symbolic arithmetic in Mathematica behaves identically. This fraction calculator produces the same mixed-number display next to every improper-fraction result without requiring a Mathematica licence or kernel: enter 7/4 and you get 7/4 = 1 3/4 = 1.75 in one go. The two tools are complementary - Mathematica is the right answer for symbolic algebra and exact rationals embedded in larger expressions; this page is the right answer for a quick numeric check or a homework verification.
What the Calculator Actually Does
The tool models fractions as an integer pair { n, d } and computes in exact rational arithmetic, not floating-point. Addition uses n1*d2 + n2*d1 over d1*d2; subtraction flips the sign on the second numerator; multiplication is componentwise; division multiplies by the reciprocal. After every operation the numerator and denominator are divided by their greatest common divisor (GCD) computed with the Euclidean algorithm, and the sign is normalised so the denominator is always positive. This keeps the displayed form canonical and avoids the surface bug where 2/4 and 1/2 look like different answers.
Because inputs and intermediates stay as JavaScript numbers, the safe upper bound before integer precision loss is 253-1 (Number.MAX_SAFE_INTEGER). For normal schoolwork that is plenty. If you feed in numerators or denominators above this bound, the cross-multiply step may silently round, which is why the calculator flags unusually large inputs rather than pretending they are accurate.
Where Fraction Arithmetic Matters
- Scaling a cooking recipe by 2/3 without converting to awkward decimal teaspoons.
- Calculating drill bit sizes, wood lengths, or fabric widths in imperial measurements that are natively fractional.
- Reducing a music-theory rhythm ratio like 6/8 versus 3/4 to see that they are genuinely different.
- Homework help for a child learning mixed numbers and common denominators.
- Probability problems where the exact form (for example 13/52) is more informative than the decimal approximation.
- Computing gear ratios or pulley ratios on a mechanical drawing where exact integers matter.
Common Mistakes the Tool Catches For You
- Zero denominator is blocked at input time; there is no silent NaN or Infinity result.
- Double negatives are normalised:
-3 / -4displays as3/4, with sign moved to the numerator. - Already-simplified inputs like 7/11 pass through unchanged because GCD(7, 11) = 1.
- Integer operands work: enter 3/1 + 1/2 to get 7/2. The calculator does not require strict proper fractions.
- Improper fractions such as 5/3 stay as 5/3 by default; the mixed-number display (1 2/3) is shown beside it for readability.
- Very long decimals like 1/7 = 0.142857142857... are truncated to six decimals for display, but the exact fraction result is always preserved for subsequent operations.
Fractions in a Nutshell
A fraction a/b with a integer and b a non-zero integer represents the rational number a ÷ b. Two fractions are equal if and only if a·d = b·c, which is why reducing by GCD gives a canonical form. The Egyptians wrote only unit fractions (1/2, 1/3, 1/5, and so on) and decomposed everything else into sums of unit fractions, a system documented in the Rhind Mathematical Papyrus around 1650 BCE. The horizontal-bar notation came from Arab mathematicians in the twelfth century and was popularised in Europe by Fibonacci's Liber Abaci (1202). ISO 80000-2 now fixes the standard notation: the fraction bar can be horizontal or slanted, and the normalised form has a positive denominator.
When Decimals Are Better (and When They Aren't)
Decimals beat fractions when you need to compare magnitudes at a glance, feed numbers into engineering software, or measure with a digital instrument. Fractions beat decimals when exactness matters (1/3 is not 0.333 but exactly 1/3), when the domain is naturally discrete (half inches, thirds of a pie, sixteenth notes), or when you want to preserve structure for downstream reasoning (13/52 makes it obvious the probability is 1/4, while 0.25 hides the combinatorial origin). Symbolic math tools like SymPy, Maxima, or Mathematica represent rationals exactly by default, which is the same principle this tool applies in a smaller package. Spreadsheet users can get some of the way with Excel's FRACTION format, but spreadsheets compute in floating point under the hood, so the display is cosmetic rather than exact.
Frequently Asked Questions
Why is the result always shown in lowest terms?
Canonical form - numerator and denominator coprime, denominator positive - makes fractions uniquely representable. If 4/8 and 1/2 displayed as different things, a user doing repeated calculations could not tell when two intermediate results are actually equal. The tool reduces after every operation using the Euclidean algorithm, which runs in <em>O</em>(log min(a, b)) and is fast even for eight-digit operands.
Can I enter mixed numbers like 1 3/4?
Not directly; the inputs are two integer fields per fraction (numerator and denominator). Convert a mixed number to an improper fraction first: 1 3/4 becomes 7/4 by computing <code>1 * 4 + 3</code> over <code>4</code>. The tool displays results in mixed form automatically when the value is greater than one in absolute magnitude, so the reverse direction is handled for you.
Does the tool upload my inputs anywhere?
No. The Preact component runs entirely inside your tab and contains no fetch calls, no WebSocket, and no telemetry that carries the numbers you typed. A network-tab trace during a full calculation shows zero requests with your values attached.
How are negative fractions handled?
A minus sign can be attached to either numerator or denominator, and the tool normalises by moving it onto the numerator. So -3/4 and 3/-4 both display as -3/4. Two negatives cancel: -3/-4 becomes 3/4. The rule matches the standard mathematical convention and keeps the output in a single canonical shape.
What algorithm does the GCD step use?
Euclid's algorithm from Book VII of the <em>Elements</em> (around 300 BCE). It repeatedly replaces <code>(a, b)</code> with <code>(b, a mod b)</code> until the second element is zero, at which point the first element is the GCD. It is one of the oldest algorithms in continuous use and is provably the fastest approach for integer GCD in the standard model: the number of steps is bounded by <em>O</em>(log min(a, b)), which Gabriel Lamé proved in 1844 using Fibonacci numbers as the worst case.
Is the decimal expansion exact or truncated?
The decimal display is truncated to six places for readability, so 1/3 shows as 0.333333 and 1/7 as 0.142857. The underlying fraction is kept exactly, so further calculations propagate without loss. If you need more decimals, divide numerator by denominator in a higher-precision tool or use the fraction form directly.
Why do I get a validation error on zero denominator?
Division by zero is undefined in the rationals; any fraction with a zero denominator is not a valid number. Rather than silently propagating NaN or Infinity, the tool rejects the input at the source so the downstream steps can assume a well-formed fraction. If you are trying to express infinity or undefinedness, use a different tool - fraction arithmetic is the wrong framework.
Can I chain multiple operations in one go?
The current UI evaluates one operator between two fractions at a time. For longer expressions such as <code>(1/2 + 1/3) × 4/5</code>, run the parenthesised sum first, then use its output as the left operand of the multiplication. This is more keystrokes than a formula engine but has the advantage that you see every intermediate fraction in simplified form.
What is the largest numerator or denominator I can safely use?
Any absolute value below <code>Number.MAX_SAFE_INTEGER</code> (2<sup>53</sup>-1, about 9.007 * 10<sup>15</sup>) is safe because every intermediate in the cross-multiply and GCD steps stays in that range. Beyond that JavaScript's <code>number</code> type rounds silently. If your real problem involves 20-digit numerators you want a BigInt-based rational library like <code>big-fraction</code> on npm or a CAS.
How do I simplify a fraction without doing an operation?
Enter the fraction as the first operand, leave 1/1 as the second operand, and pick multiplication. The identity 1 is a no-op on the value but forces the simplification path. Alternatively pick division by 1/1 - same outcome. The canonicalisation step runs regardless of which operator you chose.
What is mixedNumberForm in Mathematica?
<code>MixedNumberForm[expr]</code> is a Wolfram Mathematica typesetting wrapper that displays a rational number as a whole integer plus a proper fraction instead of as an improper fraction. For example <code>MixedNumberForm[7/4]</code> renders as <code>1 3/4</code>, and <code>MixedNumberForm[-11/3]</code> renders as <code>-3 2/3</code>. It changes only the display, not the value. This calculator produces the same mixed-number display next to its simplified-fraction output for any improper fraction you enter, without needing Mathematica installed.
More Math & Calculators
Age Calculator
Calculate exact age in years, months and days from a birthdate.
Open toolArea & Volume Calculator
Calculate area of 2D shapes and volume of 3D solids.
Open toolBMI Calculator
Calculate your Body Mass Index and find your weight category.
Open toolByte / Bit Converter
Convert between bits, bytes, KB, MB, GB, TB and PB.
Open toolDiscount Calculator
Calculate discount amount, sale price, savings, and discounted value with optional sales tax. Supports stacked coupons.
Open toolFibonacci Sequence Generator
Generate Fibonacci numbers up to any length.
Open tool