SwiftTools

Decimal to fraction calculator

Need 0.75 as a fraction for a recipe or a measurement? Type any decimal and this calculator converts it to a fully simplified fraction — or a mixed number when it’s bigger than one.

Decimal input

How decimal-to-fraction conversion works

The calculator finds the closest fraction within 0.000001 by testing denominators, then divides the top and bottom by their greatest common divisor (GCD) to simplify. So 0.75 becomes 75/100, and dividing by 25 gives 3/4.

Values bigger than one come back as mixed numbers: 2.5 is 2 whole units plus 1/2. Repeating decimals like 0.333… are matched to their exact fraction (1/3) within the tolerance.

find n/d with |x − n/d| < 10⁻⁶, then divide by gcd(n, d)

Decimal to fraction calculator FAQ

How do you turn a decimal into a fraction?

Write it over a power of ten and simplify: 0.75 = 75/100 = 3/4 after dividing top and bottom by 25.

What is 0.333 as a fraction?

Exactly 333/1000. If you mean the repeating decimal, enter 0.3333333 and you’ll get 1/3 — the calculator matches repeating decimals within 0.000001.

What is 2.5 as a fraction?

2½, shown as the mixed number 2 1/2.

How does the calculator simplify fractions?

It divides the numerator and denominator by their greatest common divisor — the largest number that divides both evenly.

What about repeating decimals like 0.666…?

Enter 0.6666667 and you’ll get 2/3 — the closest fraction within 0.000001.

Do negative decimals work?

Yes — the sign carries over, so -0.5 becomes -1/2.