Fraction to decimal
Type in either field and the other fills in. The fraction is reduced automatically.
Type for example 3/8, 6/8 or 1 3/8.
A full stop or a comma both work as the decimal mark.
Exact.
- In lowest terms3/8
- As a mixed number3/8
- As a percentage37.5%
Common fractions
- 0.5
- 0.333333
- 0.666667
- 0.25
- 0.75
- 0.2
- 0.4
- 0.125
- 0.375
- 0.625
- 0.875
- 0.0625
How it works
A fraction is a division that has not been carried out. Writing 3/8 as a decimal is therefore the same as dividing 3 by 8, which gives 0.375.
A fraction is reduced by dividing the numerator and denominator by their greatest common divisor. 6/8 becomes 3/4, because both are divisible by 2.
Going the other way, the tool looks for the simplest fraction that matches your decimal. Type 0.3333333333 and you get 1/3 rather than 3333333333/10000000000, and the line below the fields says whether the answer is exact or an approximation.
Not every fraction can be written as a terminating decimal. 1/3 becomes 0.333… forever, while 3/8 stops after three decimals. A fraction terminates exactly when its denominator contains only the factors 2 and 5.
Mixed numbers are written with a space between the whole number and the fraction, for example 1 3/8.
How the fraction is found
Going from a decimal to a fraction, the tool uses a continued fraction. The whole-number part is taken off, the remainder is turned upside down, and the same is done to the new number. Each step gives an approximation, a convergent, whose numerator is built from the two before it by the recurrence Aₖ = bₖAₖ₋₁ + Aₖ₋₂, where bₖ is the whole-number part at step k. Denominators follow the same rule.
The calculation stops when the remainder is below 10⁻¹² or when the next denominator would exceed 1,000,000. The limit on the remainder is needed because the decimal is stored in binary and is seldom exactly what you typed. Even 0.1 cannot be stored exactly.
Example: 0.6875
The whole-number part is 0. 1 / 0.6875 is 1.4545…, whole-number part 1. The remainder 0.4545… turned over is 2.2, whole-number part 2. The remainder 0.2 turned over is 5. In floating point the remainder is then 7 × 10⁻¹⁵ rather than zero, but it is below the limit of 10⁻¹², so the calculation stops. The terms are therefore 0, 1, 2 and 5.
The convergents are 0/1, 1/1, 2/3 and finally 11/16, because 5 × 2 + 1 = 11 and 5 × 3 + 1 = 16. The tool answers 11/16 and marks it as exact.
Edge cases
The ceiling of a million on the denominator decides when a rounded decimal is read as a simple fraction. 0.333333, with six threes, gives 333333/1000000, because that denominator fits under the ceiling and matches exactly. With seven threes the next denominator would be ten million, so the tool stops at 1/3 and calls it an approximation.
A number that is not a fraction at all, such as pi, gets the last convergent under the ceiling: 3.141592653589793 becomes 1146408/364913, marked as an approximation. In the other direction the decimal is shown to at most twelve significant figures. 1/16 comes out as 0.0625 and is marked exact, but 1/3 is written 0.333333333333 and marked as an approximation, because twelve figures cannot hold the whole expansion. The fraction field accepts only whole numbers above and below the line, so 1.5/2 is rejected; write 3/4.