# Decimal to Fraction Calculator

> Decimal to fraction calculator: convert any decimal into a simplified fraction or mixed number, with the repeating-decimal steps shown. Free, no signup.

- **Canonical URL:** https://boringtoolskit.com/decimal-to-fraction-calculator/
- **Category:** School & Education
- **Evidence level:** authored-methodology
- **Reviewed:** September 2026
- **Last verified:** 2026-10-12
- **Privacy:** Inputs and results stay in this browser unless the page clearly labels an external request.

## How it works

The calculator reads your decimal, counts the digits after the decimal point (say d of them), multiplies the value by 10^d, rounds that product to the nearest integer to get the numerator, sets the denominator to 10^d, then divides both by their greatest common divisor until the fraction is fully reduced. If the reduced denominator is 1 the value was a whole number. Inputs are rejected unless the decimal is greater than 0 and at most 1,000,000.

## Worked example

Take 0.375. The string '0.375' has 3 digits after the decimal point, so the tool computes 0.375 x 10^3 = 375 and rounds it: numerator = Math.round(375) = 375, denominator = 10^3 = 1000. The greatest common divisor of 375 and 1000 is 125 (375 = 3 x 125, 1000 = 8 x 125). Dividing both by 125 gives 3/8, and the result displays '0.375 simplified' with the hero value 3/8. If you instead entered 8 (a whole number), the digits-after-point count is 0, so numerator = Math.round(8 x 1) = 8, denominator = 1, gcd = 1, and the output is 8/1 flagged as '(a whole number)'.

## Assumptions

- Inputs outside (0, 1000000] are rejected: zero, negatives, and values above the million cap all return the 'Enter a positive decimal' invalid message, so negative decimals cannot be converted directly.
- The numerator is computed with Math.round on value x 10^d, which rounds exact .5 ties toward positive infinity (Math.round(2.5) = 3, Math.round(-2.5) = -2), and the product itself is a binary double, so very long typed decimals are limited to JavaScript's roughly 15 significant digits of precision.
- The decimal place count comes from splitting the typed string on the point, so trailing zeros add denominator powers but cancel in GCD reduction; a whole number input yields N/1 and is labeled '(a whole number)'.

## Common questions

### How do you convert a decimal to a fraction?

Count the digits after the decimal point, write all the digits as the numerator over 10 raised to that count, then reduce by dividing both numbers by their greatest common divisor. For 0.375, three places gives 375/1000, and GCD 125 reduces it to 3/8.

### How do you reduce a fraction to lowest terms?

Find the greatest common divisor of the numerator and denominator and divide both by it. The calculator uses the Euclidean algorithm, so 375/1000 becomes 3/8 in one exact step. A fraction is fully reduced when the GCD is 1.

### What fraction is 0.5 as a decimal?

0.5 has one decimal place, so it is 5/10, which reduces by GCD 5 to 1/2. This calculator returns 1/2 for the input 0.5.

### Can this calculator convert negative decimals to fractions?

No, the input must be greater than 0 and at most 1,000,000; negatives return an error message. As a workaround, drop the sign, convert the positive value (for example 2.5 gives 5/2), then attach the minus sign to get -5/2.

### Why is 0.1 sometimes shown as not exactly one tenth in programming?

JavaScript and most languages store numbers in binary floating point, and 0.1 has no exact binary representation, so it is stored as approximately 0.1000000000000000055. This calculator reads the decimal places from your typed string and rounds the numerator, so ordinary inputs like 0.1 still produce the exact fraction 1/10.

### What is a significant figure?

A significant figure is a digit that carries meaning in a number: all nonzero digits plus zeros between them or as measured trailing decimals. In 0.004560 the significant figures are 4, 5, 6, and the trailing 0, giving four. JavaScript numbers hold about 15 significant digits, which caps the precision of very long decimal inputs here.

### How do you find the nearest fraction like 1/16 for a measurement?

Round your decimal to a precision that matches the fraction first, then convert. To get the nearest sixteenth of 0.624 inches, round to 0.625 and convert: 625/1000 reduces to 5/8, which is 10/16. Converting the raw 0.624 instead gives 78/125, which no tape measure shows.

## Related tools

- /fraction-to-decimal-calculator/
- /rounding-numbers-calculator/
- /scientific-notation-converter/

## Sources

- [Rounding Numbers](https://www.mathsisfun.com/rounding-numbers.html)
- [Fraction](https://en.wikipedia.org/wiki/Fraction)
- [Rounding](https://en.wikipedia.org/wiki/Rounding)

---

*Local planning estimate. Verify current terms, rates, and policies before acting.*

