Fraction Calculator
ConvertEverything runs locally in your browser — nothing is uploaded
Four kinds of input, detected automatically with no mode to pick: `24/36` is a simplification, `24 36` is a pair of integers for GCD and LCM, `0.75` is a decimal to convert, and `1/2 + 1/3` is arithmetic. These look easy, but two things bite: least common multiples grow extremely fast (a few ten-digit numbers take the result past 2^53), and in fraction arithmetic the denominators multiply just as quickly. Ordinary JavaScript numbers lose the low digits without raising an error, so everything here goes through BigInt and stays exact at any size. Decimal-to-fraction conversion is exact too — 0.1 really is 1/10, not an approximation of it.
Features
- Simplify a fraction, with the GCD that was used
- GCD and LCM for two integers, plus whether they are coprime
- Decimals to fractions — an exact conversion, not an approximation
- Fraction arithmetic (add, subtract, multiply, divide) with automatic simplification
- Improper fractions also shown as mixed numbers
- Decimal values to 12 places for fractions that have one
- Optional continued-fraction approximation: π converges to 355/113
- BigInt throughout, so large integers keep every digit
How to use
- Paste a fraction, two integers, a decimal or an expression — the type is detected
- The result appears as you type
- Turn on the continued-fraction option if you want a simple approximation
- Copy any single line with its own button
FAQ
- Why does the LCM need BigInt?
- Because it grows fast: the LCM of 21 and 6 is 42, but two adjacent ten-digit numbers give a 20-digit result. Past 2^53 ordinary JavaScript numbers drop the low digits without complaining, leaving a number that looks fine and is wrong. GCD and LCM exercises land on exactly that size.
- Is 0.1 to a fraction exact here?
- Yes. Converting a decimal literal to a fraction is exact by definition: 0.1 means one tenth. (Separately, 0.1 is a repeating fraction in binary floating point — a different matter; this tool parses the string and never goes through floats.)
- What is the continued-fraction approximation?
- A way of approximating any real number by simple fractions in which each step is the closest fraction whose denominator is within a given bound. π is approached as 3, 22/7, 333/106, 355/113 — the last accurate to six decimal places with a three-digit denominator. Handy for engineering estimates.
- Are negatives and mixed numbers supported?
- Negatives are: `-24/36` and `1/-2` both work, and the result is normalised to a single form (the sign moves to the numerator). Mixed numbers like `2 1/3` have to be written as an improper fraction first (`7/3`), because the "two integers" form is already taken by GCD/LCM and the two cannot be told apart.
Related tools
Number Base Converter
ConvertConvert numbers between binary, octal, decimal, hex, base 36 and base 64, with long IDs converted digit for digit. Runs in your browser.
Unit Converter
ConvertConvert between 26 categories of units — length, weight, temperature, energy, pressure, flow, force, density and more. All in your browser.
Chinese Amounts
ConvertTurn a number into the formal Chinese amount used on invoices and the everyday reading, with zeros handled per the financial rules.
Timestamp Converter
ConvertConvert Unix timestamps into dates and back, telling seconds, milliseconds, microseconds and nanoseconds apart, with Windows FILETIME and decimals.
Date Calculator
ConvertCount the days, weeks or months between two dates, or shift a date by any of those. Dates can be picked from a calendar or pasted in — nothing is uploaded.
Cron Parser
ConvertExplain a cron expression field by field and list the next and previous run times, saying plainly when a schedule can never fire.