Decimal to Fraction Calculator

A decimal of 0.125 is 125/1000, which reduces by 125 to 1/8 (12.5000%). Enter a decimal, a repeating decimal, a percent, or a fraction to convert it in lowest terms.

Last reviewed

Exact fraction, decimal, and shop approximations

Fraction (lowest terms)

1/8

Decimal expansion

0.125

As a percent

12.5000%

In lowest terms, 0.125 equals 1/8, reduced by a greatest common divisor of 125.

On a shop tape, the nearest 1/16-inch mark is 1/8 in and the nearest 1/64-inch mark is 1/8 in.

With a denominator of at most 1,000, the closest fraction is 1/8.

Need to add, subtract, multiply, or divide two fractions? Open the fraction calculator. Working with a tape measure or percentage? Try the inch fraction to decimal converter or the percentage calculator.

Decimal, percent, or fraction

Conversion and value
Type the number up to and including the first full repeating block: 0.83 for 0.8333…, 0.142857 for 0.142857142857…. Up to 15 digits are read exactly; a longer entry is refused, not rounded.
How many of the last decimal digits repeat forever. 0 for a terminating decimal; 1 for 0.83 → 0.8333…; 6 for 0.142857 → 0.(142857).
Rational approximation limit
Largest denominator allowed for the best rational approximation: 1,000 turns 3.14159265 into 355/113.
Worked sheet for Decimal to Fraction: how the fraction (lowest terms) of 1/8 is worked out, in 3 steps.Decimal to Fractionterminating (k places): x = digits / 10krepeating (p digits after k fixed): x = (all − fixed)/ (10k × (10p − 1))percent: divide the fraction by 100lowest terms: divide numerator and denominator by gcd(n,d)ruler mark (scale S): round(x × S) / Serror (mils) = (mark − x) × 1,000unreduced = 125/1000gcd(125, 1000) = 125lowest terms =1/8
  1. unreduced = 125/1000
  2. gcd(125, 1000) = 125
  3. lowest terms = 1/8
How 0.125 reduces to 1/8 by greatest common divisor

Decimals as fractions in lowest terms

From 0.05 (1/20) to 0.875 (7/8), each decimal has a finite number of places, so it reduces to a fraction whose denominator divides a power of 10.

ValueFraction (lowest terms)As a percent
0.051/205.0000%
0.11/1010.0000%
0.125 (closest to your input)1/812.5000%
0.21/520.0000%
0.251/425.0000%
0.3753/837.5000%
0.42/540.0000%
0.51/250.0000%
0.63/560.0000%
0.6255/862.5000%
0.753/475.0000%
0.8757/887.5000%

Nearest binary inch fractions (1/8 to 1/64 in)

Ruler scaleNearest mark (in)Mark decimal (in)Millimeters (mm)Error (in)Error (mils)
1/8 in1/80.1253.17500.0000000.00
1/16 in1/80.1253.17500.0000000.00
1/32 in1/80.1253.17500.0000000.00
1/64 in1/80.1253.17500.0000000.00

At 1/16 in, the closest mark is 1/8 in (3.1750 mm, error 0.00 mils); at 1/64 in, it is 1/8 in (3.1750 mm, error 0.00 mils).

Best rational approximations by denominator limit

Max denominatorBest fractionMixed numberDecimal (6 dp)Signed error
≤ 81/81/80.1250000.000000
≤ 161/81/80.1250000.000000
≤ 321/81/80.1250000.000000
≤ 641/81/80.1250000.000000
≤ 1001/81/80.1250000.000000
≤ 1,0001/81/80.1250000.000000
≤ 10,0001/81/80.1250000.000000

1/8 is the exact value, so it is the closest fraction at every limit from ≤ 8 to ≤ 10,000.

How to convert decimals, percents, and fractions

A terminating decimal is a fraction over a power of 10. OpenStax Prealgebra 2e (Section 5.1) says to convert a decimal by identifying the place value of the farthest right digit: in 0.03, the 3 is in the hundredths place, so the denominator is 100. Then divide top and bottom by their greatest common factor. Common Core standard 4.NF.C.6 gives the two-place case: "rewrite 0.62 as 62/100," which reduces by 2 to 31/50. To find that factor for any pair of whole numbers, open the GCF and LCM calculator.

A percent is a ratio over 100. OpenStax Prealgebra 2e (Section 6.1) defines it: "A percent is a ratio whose denominator is 100." NIST Special Publication 811 (Chapter 7, section 7.10.2) notes that the symbol % stands for the number 0.01. Dividing the decimal fraction by 100 turns 25% into 25/100 = 1/4, and 35% into 35/100 = 7/20.

A repeating decimal has a tail of digits that recurs without end. OpenStax Prealgebra 2e (Section 5.3) defines it: "A repeating decimal is a decimal in which the last digit or group of digits repeats endlessly." Suppose k fixed decimal digits sit before p repeating digits. Multiplying by 10^k and by 10^(k+p) and subtracting cancels the tail. That leaves x = (all digits − fixed digits) ÷ (10^k × (10^p − 1)). OpenStax Intermediate Algebra 2e (Section 12.3) reaches the same fraction by summing an infinite geometric series with S = a_1 / (1 − r).

Going the other way, OpenStax Prealgebra 2e (Section 5.3) notes: "To convert a fraction to a decimal, divide the numerator of the fraction by the denominator of the fraction." Common Core standard 7.NS.A.2.d states what happens next: "the decimal form of a rational number terminates in 0s or eventually repeats." In lowest terms, a fraction stops only when its bottom number has no prime factors other than 2 and 5, because a terminating decimal is a fraction over a power of 10 and 10 = 2 × 5. Otherwise the division repeats: it can leave only d − 1 different non-zero remainders, so one must come back within d − 1 steps. This follows from the steps above; it is not a quotation.

Shop fractions, ruler scales, and decimal style

Shop drawings, drill charts, and tape measures split an inch by powers of two: 1/8, 1/16, 1/32, and 1/64 in. In binary inch tables, 1/8 in is 0.125 in (3.175 mm), 3/8 in is 0.375 in (9.525 mm), and 1/64 in is 0.015625 in (0.396875 mm). NIST Handbook 44 (2026, Appendix C) and NIST SP 811 (Appendix B.8) give the exact metric link: 1 inch is 2.54 × 10^−2 m (25.4 mm), and 1 mil (0.001 in) is 2.54 × 10^−2 mm. For shop work or board lengths, try the inch fraction to decimal converter or the feet and inches calculator.

For numbers smaller than one, NIST SP 811 (Section 10.5.2) states: "The recommended decimal sign or marker for use in the United States is the dot on the line [3, 6]." It also requires a leading zero: "For numbers less than one, a zero is written before the decimal marker. For example, 0.25 s is the correct form, not .25 s." To check how many digits carry measurement precision before converting, use the significant figures calculator.

Video walkthrough

A 3-minute walkthrough of how a decimal becomes a fraction in lowest terms, how a repeating decimal and a percent are worked out, and what a shop tape and a chosen limit give.

Decimal to Fraction: How a Decimal Becomes a Fraction
Read the transcript

What a decimal is worth

0:00 What is a decimal worth as a fraction?

0:03 The page's own example comes out as 1/8, in lowest terms, and it shows the decimal it came from.

0:09 Type a decimal into the Decimal or percent box, and the page fills in the fraction, the decimal and the percent as you type.

0:18 It also writes down how it got there.

How the fraction is reduced

0:21 A decimal with a fixed number of places is a fraction over a power of 10.

0:26 OpenStax says to convert a decimal by identifying the place value of the farthest right digit.

0:32 The page writes the digits over a power of 10, then divides top and bottom by their greatest common divisor, 125, and what is left is 1/8.

0:43 The page shows that working line by line.

When the digits repeat

0:47 Some decimals never end.

0:49 OpenStax defines a repeating decimal as a decimal in which the last digit or group of digits repeats endlessly.

0:56 The page can work with one of those.

0:59 Set the repeating digits to 1, and the page reads the last digit as repeating forever.

1:04 It gives 5/6.

1:06 The page takes the fixed digits away from all the digits, which gives the top of the fraction.

1:12 Then it divides top and bottom by their greatest common divisor, 15, leaving 5/6.

Percent to fraction

1:19 A percent is a fraction over 100.

1:22 OpenStax defines a percent as a ratio with that denominator, and the page does the same work when you switch the setting.

1:30 Switch the page to percent, and type 25.

1:34 The page gives 1/4, and it shows the same lines of working.

What a shop tape measures

1:38 NIST's handbook gives the link to the metric, and it calls the conversion exact.

1:44 The page uses that link for every mark.

1:47 For 0.3, the nearest mark on the sixteenth scale is 5/16, and on the finest scale it is 19/64.

1:55 The page gives each mark in millimeters too.

1:59 As a fraction, 3/10 is exact.

2:01 The marks on a tape are rounded to the nearest one, so for this measurement they differ.

When the decimal is rounded

2:07 A long decimal can have a very long fraction.

2:10 Python's fractions guide describes the method the page uses: it finds the closest fraction whose bottom number is at most the limit you set.

2:19 With no repeating digit, the page gives 333/1000, exactly.

2:26 Nothing repeats here, and that is what separates it from a repeating decimal.

2:31 With a limit of 16, the closest fraction is 1/3, the repeating one.

2:36 With a limit of 10,000, it comes back to 333/1000, the exact value.

2:43 So the digits go over a power of 10, the top and bottom are divided by their greatest common divisor, and a limit finds the closest fraction.

2:52 The page turns a fraction back into a decimal as well.

2:56 Try your own number at fastcalc.us.

Decimal to fraction and repeating decimal formulas

terminating (k places): x = digits / 10^k
repeating (p digits after k fixed): x = (all − fixed) / (10^k × (10^p − 1))
percent: divide the fraction by 100
lowest terms: divide numerator and denominator by gcd(n, d)
ruler mark (scale S): round(x × S) / S; error (mils) = (mark − x) × 1,000

Worked examples: terminating, repeating, and unit fractions

Terminating decimal and mixed number: 0.125 has three decimal places, so it is 125/1000. Dividing by gcd(125, 1000) = 125 gives 1/8 (12.5000%). For 1.75, the raw fraction is 175/100. Dividing by gcd(175, 100) = 25 gives 7/4, or 1 3/4 as a mixed number.

Mixed repeating decimal: 0.8333… has 1 fixed digit (8) and 1 repeating digit (3). Enter 0.83 with 1 repeating digit: x = (83 − 8) ÷ (10 × 9) = 75/90. Dividing by gcd(75, 90) = 15 gives 5/6, which expands to 0.8(3).

Pure repeating decimal: 1/7 expands by long division to 0.(142857) because remainder 1 comes back after 6 steps. Enter 0.142857 with 6 repeating digits to get 142857/999999. Dividing by gcd(142857, 999999) = 142857 gives 1/7.

Euclidean reduction and best rational approximations

Each fraction is reduced by the Euclidean method. Euclid states the goal in Book VII, Proposition 2 of the Elements: "To find the greatest common measure of two given numbers not relatively prime." Take 75 and 90. Subtracting 75 from 90 leaves 15, which divides 75 evenly, so gcd(75, 90) = 15 and 75/90 = 5/6. You can also write any reduced fraction as a comparison in the ratio calculator.

A rounded readout can produce a huge bottom number. Common Core 8.NS.A.2 asks students to use rational approximations of irrational numbers to compare their sizes, locate them approximately on a number line diagram, and estimate the value of expressions such as π². Its worked example truncates the decimal expansion of √2 to place it between 1 and 2, then between 1.4 and 1.5. The companion standard 8.NS.A.1 asks students to convert a repeating decimal expansion into a rational number. The Python 3 fractions guide describes limit_denominator(max_denominator), which "Finds and returns the closest Fraction to self that has denominator at most max_denominator." For 3.14159265, the raw fraction is 62831853/20000000. A cap of 10 gives 22/7, a cap of 100 gives 311/99, and a cap of 1,000 gives 355/113.

Assumptions, input bounds, and rounding limits

  • In decimal and percent modes, the digits you type are read one by one, never as a rounded machine number. A non-zero value must be at least 0.000001 in size and smaller than 10^15. It can have at most 12 decimal places and at most 15 digits in all, not counting leading zeros; a longer entry is refused with a message rather than rounded. Trailing zeros after a decimal point are dropped, so 0.830 is read as 0.83.
  • The repeating digits are the last ones you type, and they repeat forever: 0.83 with 1 repeating digit means 0.8333…, which is exactly 5/6, not 0.83. Type the block once in full at the end of the number. For 0.4166…, type 0.416 with 1 repeating digit to get 5/12. Typing 0.4 with 1 repeating digit means 0.(4) = 4/9. The links to the inch and feet pages carry the value of the fraction to 12 significant digits, 0.833333333333 for 5/6, whatever the mode, so 25% goes on as 0.25.
  • In fraction mode, the top number can be up to 1,000,000,000,000 in size. The bottom number must be from 1 to 100,000. A repeating cycle for 1/d has at most d − 1 digits. Cycles longer than 40 digits show their first 40 digits plus an ellipsis (…) and list the full cycle length in the steps.
  • The equality 0.999… = 1 is exact: entering 0.9 with 1 repeating digit gives (9 − 0)/9 = 9/9 = 1.
  • The best approximation is the closest fraction with a denominator no larger than your limit, found with the continued-fraction method that Python's limit_denominator uses. When two fractions are exactly as close, this page keeps the convergent that method reaches first; with a limit of 1, the value 1/2 shows 0 rather than 1. This page settles ties that way by its own choice.

How to choose exact fractions or ruler marks

Check first if your decimal is exact or rounded. A price, tax rate, or recipe amount like 0.375 is exact and reduces to 3/8. A four-digit readout like 0.3333 is a rounded third. With 0 repeating digits it gives 3333/10000, while 1 repeating digit gives 1/3.

For shop work, use the binary ruler table instead of the base-10 fraction. A caliper reading of 0.400 in is 2/5 in. On a tape, the nearest 1/16-inch mark is 3/8 in (0.375 in, −25.00 mils). At both the 1/32-inch and 1/64-inch scales, the closest mark is 13/32 in (0.40625 in, +6.25 mils).

Use the max denominator box to pull a clean ratio from a long decimal. A cap of 100 turns 0.492983 into 35/71 (error −0.000025). Raising the cap to 1,000 finds 281/570 (error −0.000001).

Copy the worked steps when you need to show homework or shop notes. Each line lists the raw fraction, the Euclidean greatest common divisor (such as gcd(18, 24) = 6 for 3/4), the lowest-terms fraction, and the mixed number.

Decimal to fraction questions

How do I convert 0.75 to a fraction?

Write 0.75 over 100 for its two decimal places to get 75/100. Divide top and bottom by gcd(75, 100) = 25 to get 3/4. The same step turns 0.0625 into 625/10000 = 1/16 and 0.6 into 6/10 = 3/5.

How do I convert a repeating decimal to a fraction?

Type the number through the first full repeating block and set Repeating digits to the block length. For 0.2727…, enter 0.27 with 2 repeating digits. That gives (27 − 0) ÷ 99 = 27/99, which divides by 9 to equal 3/11.

How do I enter 0.1666…?

Type 0.16 and set Repeating digits to 1 so only the 6 repeats while the 1 stays fixed. The formula gives (16 − 1) ÷ (10 × 9) = 15/90, which divides by 15 to equal 1/6.

Why does 0.333 give 333/1000 instead of 1/3?

With Repeating digits set to 0, 0.333 is a three-place decimal equal to 333/1000. That is 1/3000 short of 1/3. Set Repeating digits to 1 (or 3) if the 3 repeats forever, or check the ≤ 8 row for 1/3.

How do I turn a percent into a fraction?

Pick Percent to fraction and type the number without the % sign. The tool multiplies the base-10 bottom number by 100. Thus 45% becomes 45/100 = 9/20, and 66.6% with 1 repeating digit becomes (666 − 66) ÷ 900 = 600/900 = 2/3.

Why does 1/8 terminate while 1/17 repeats forever?

In lowest terms, a fraction stops only when its bottom number is built from prime factors 2 and 5, since a terminating decimal is a fraction over a power of 10. Since 8 = 2^3, 1/8 stops in 3 places at 0.125. Since 17 is prime to 10, 1/17 repeats a 16-digit cycle 0.(0588235294117647), the full d − 1 length.

How do I convert a decimal inch to the nearest 1/16 or 1/64 inch?

Multiply the decimal by 16 or 64, round to the nearest whole number, and reduce the fraction. For 0.300 in, 0.300 × 16 = 4.8 rounds to 5/16 in (0.3125 in, +12.50 mils). At 64ths, 0.300 × 64 = 19.2 rounds to 19/64 in (0.296875 in, −3.13 mils).

Sources

Embed this calculator

Paste this code into your page. The credit line under the frame is optional.