# Decimal to Fraction Calculator

URL: https://hifreetools.com/calculators/decimal-to-fraction-calculator

> Turn any terminating decimal into a fully reduced fraction and mixed number, with each simplification step shown so you can follow the math.

## Quick answer

To convert a terminating decimal to a fraction, write the decimal over 1, then multiply the top and bottom by 10 for each digit after the decimal point. Divide both numbers by their greatest common divisor (GCD) to reduce. For example, 0.75 = 75/100 = 3/4 after dividing both by 25.

## Formula

- x with d decimal places = (x × 10^d) ÷ 10^d
- Reduce: divide the numerator and denominator by GCD(x × 10^d, 10^d)
- Mixed number: whole = numerator ÷ denominator, remainder over the denominator

A terminating decimal has a finite number of digits after the point, so it can always be written as a fraction. Count the decimal places (d). Multiply the decimal by 10^d to clear the point — that product becomes the numerator, and 10^d becomes the denominator. Then find the greatest common divisor (GCD) of the numerator and denominator using the Euclidean algorithm and divide both by it to get the lowest terms. If the numerator is larger than the denominator, separate out the whole-number part to form a mixed number: the whole part is the integer division, and the remaining fraction uses the remainder over the denominator. A negative sign is carried through to the final result. For 2.5: there is 1 decimal place, so multiply by 10 to get 25/10; GCD(25, 10) = 5, giving 5/2; since 5 > 2, the mixed number is 2 1/2.

## Inputs

- Decimal value; default 0.75

## Worked examples (computed by the page's own function)

- Decimal value = 0.75 → As a fraction = 3/4, Over a power of 10 = 75/100, Greatest common divisor = 25  (0.75 = 75/100 = 3/4)
- Decimal value = 2.5 → As a fraction = 5/2, Mixed number = 2 1/2, Over a power of 10 = 25/10, Greatest common divisor = 5  (2.5 = 25/10 = 5/2)
- Decimal value = 0.125 → As a fraction = 1/8, Over a power of 10 = 125/1000, Greatest common divisor = 125  (0.125 = 125/1000 = 1/8)

## Verification

Checked against 18 reference cases (expected values computed independently). Reviewed 2026-10-27. Latest change 2026-10-28: Moved to the schema renderer with a sourced ledger. The fraction is now built from the typed digits in exact integers (BigInt), so long whole parts no longer round; up to 12 decimal places as before. The power-of-10 fraction and the GCD are shown as result rows.

## FAQ

**How do I convert a decimal to a fraction by hand?**
Count the digits after the decimal point. Put the decimal (with the point removed) over 1 followed by that many zeros — so 0.45 becomes 45/100. Then divide the top and bottom by their greatest common divisor to reduce. GCD(45, 100) = 5, giving 9/20.

**Can every decimal be written as a fraction?**
Every terminating decimal (one that ends, like 0.8 or 3.125) and every repeating decimal can be written as a fraction — these are the rational numbers. Non-terminating, non-repeating decimals such as pi or the square root of 2 are irrational and cannot be expressed as an exact fraction. This calculator handles terminating decimals.

**What is the difference between an improper fraction and a mixed number?**
An improper fraction has a numerator larger than its denominator, like 5/2. A mixed number expresses the same value as a whole number plus a proper fraction, like 2 1/2. This tool shows both forms whenever the value is greater than 1.

**How does this calculator handle repeating decimals?**
It is designed for terminating decimals. If you enter a rounded version of a repeating decimal — say 0.3333 — it will convert that exact, finite value (3333/10000), which is close to but not exactly 1/3. For true repeating decimals, use the algebraic method.

**Does it work with negative decimals?**
Yes. Enter a value like -0.6 and the calculator keeps the negative sign through every step, returning -3/5. The simplification of the digits works the same way as for positive numbers.

**What is the GCD and why does it matter here?**
The greatest common divisor (GCD) is the largest number that divides two integers evenly. Dividing both the numerator and denominator by their GCD reduces a fraction to its lowest terms in one step, so 75/100 becomes 3/4 directly instead of through several smaller divisions.


## Sources

- [Wikipedia — Decimal (decimal fractions)](https://en.wikipedia.org/wiki/Decimal)
- [Wikipedia — Greatest common divisor](https://en.wikipedia.org/wiki/Greatest_common_divisor)
- [Wikipedia — Fraction](https://en.wikipedia.org/wiki/Fraction)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "Decimal to Fraction Calculator", https://hifreetools.com/calculators/decimal-to-fraction-calculator
