AI Tools Free

Decimal To Fraction Converter

Enter any terminating decimal with up to 12 decimal places and 30 total digits into this decimal to fraction converter to turn it into a simplified integer fraction (p/q). All calculations run in your browser using string-parsed BigInt greatest common divisors with zero floating-point rounding drift.

Free to useNo sign-upRuns in your browser
Enter your details

Enter the inputs, then select Convert decimal.

Your result
Enter your details

Result will appear here

How this decimal to fraction calculator reduces finite decimals

Every terminating decimal with k digits after the decimal point equals an integer divided by 10^k. This decimal to fraction calculator parses your text input directly into BigInt integers and reduces the ratio to lowest terms (or use our Fraction To Decimal Converter to reverse the conversion).

Power-of-10 Scaling: den = 10^k (for 0 <= k <= 12 decimal places), num = BigInt(integer + fractional digits), d = gcd(|num|, den), output = (num / d) / (den / d).

Because 10^k = 2^k × 5^k, Euclidean GCD reduction cancels all shared factors of 2 and 5 in BigInt up to 30 total digits (see our GCF Calculator and Fraction Simplifier).

Diagram showing 0.125 scaled to 125 / 1000 and reduced by gcd(125, 1000) = 125 to 1/8
Scaling 0.125 by 10^3 = 1000 gives 125/1000, which reduces by gcd(125, 1000) = 125 to 1/8.

Decimal to Fraction Conversion Table (Power-of-10 Scaling & GCD Reduction)

Compare 10 common terminating decimals from 0.015625 to 2.75 alongside their decimal place count (k), unreduced power-of-10 fraction (num / 10^k), greatest common divisor (GCD), and reduced p/q output.

Finite Decimal InputDecimal Places (k)Unreduced num / 10^kGCD(|num|, 10^k)Reduced Output (p/q)Mixed / Practical Equivalent
0.015625615625 / 1000000156251/641/64 inch (0.396875 mm)
0.0312553125 / 10000031251/321/32 inch (0.79375 mm)
0.06254625 / 100006251/161/16 inch (1.5875 mm)
0.1253125 / 10001251/8Preloaded default (12.5%)
0.25225 / 100251/4Quarter (25%)
0.312543125 / 100006255/165/16 inch bolt gauge
0.3753375 / 10001253/8Three-eighths (37.5%)
0.515 / 1051/2One-half (50%)
0.75275 / 100253/4Three-quarters (75%)
2.752275 / 1002511/4Mixed number 2 3/4 (275%)

How to convert decimals to fractions in 3 steps

Convert any terminating decimal string into a lowest-terms ratio in three steps.

Enter a finite decimal (with leading digit)

Type or paste your decimal into the Finite decimal field (0.125 is preloaded). Include at least one digit before the decimal point (0.125, not .125).

Input and settings
Decimal To Fraction Converter Finite decimal input field populated with 0.125
Step 1: Enter a finite decimal up to 12 decimal places and 30 total digits.

Click Convert decimal to scale and reduce

Select Convert decimal to place your digits over 10^k and cancel their greatest common divisor in BigInt.

Tool result
Decimal To Fraction Converter result panel displaying 1/8 for input 0.125
Step 2: Click Convert decimal to reduce num / 10^k via BigInt GCD.

Copy or download the simplified fraction

Read the reduced p/q fraction in Your result, then click Copy or Download (result.txt) to save the answer.

Review the details
Decimal To Fraction Converter workspace with 1/8 and Copy and Download result.txt actions
Step 3: Copy the simplified fraction p/q or download result.txt.

Worked examples: decimal to fraction converter for inches, improper ratios & precision

See how the converter processes binary inch decimals, numbers greater than 1, and high-precision multi-place decimals.

Converting a 3-place inch decimal (0.125 = 1/8)

With the default 0.125, the parser counts k = 3 decimal places (den = 10^3 = 1000), extracts num = 125, and computes gcd(125, 1000) = 125. Dividing both terms by 125 returns 1/8. To convert a percentage like 12.5% into a fraction, divide by 100 first (0.125) using our Percentage Calculator.

Worked example scaling 0.125 to 125/1000 and simplifying by gcd = 125 to 1/8
Three decimal places set den = 1000, and gcd(125, 1000) = 125 reduces 125/1000 to 1/8.

Decimals greater than 1 (2.75 = 11/4)

Entering 2.75 sets k = 2 (den = 100) and num = 275. Dividing numerator and denominator by gcd(275, 100) = 25 outputs the improper fraction 11/4. You can add, subtract, multiply, or divide improper fractions directly in our Fraction Calculator, or rewrite 11/4 as the mixed number 2 3/4 (11 ÷ 4 = 2 remainder 3).

Worked example converting 2.75 to improper fraction 275/100 = 11/4 (mixed number 2 3/4)
Decimals greater than 1 convert to reduced improper fractions (2.75 = 11/4 = 2 3/4).

High-precision 6-place decimal (0.015625 = 1/64)

Entering the 6-place machinist gauge decimal 0.015625 sets den = 10^6 = 1,000,000 and num = 15,625. Because 1,000,000 ÷ 15,625 = 64, gcd(15625, 1000000) = 15,625, reducing the ratio in one step to 1/64. If you have a rounded decimal approximation of a non-power-of-10 fraction (like 0.142857 for 1/7), find its compact rational convergent in our Continued Fraction Calculator.

Worked example reducing 6-place decimal 0.015625 (15,625 / 1,000,000) to 1/64
Six decimal places set den = 1,000,000, reducing 0.015625 to 1/64.

How to read the reduced fraction output and convert improper ratios

Every result displayed in the Your result panel follows three rules:

First, because den = 10^k = 2^k × 5^k, the reduced denominator q is always a product of powers of 2 and 5. Proper decimals (|x| < 1) produce proper fractions (0.375 -> 3/8), while decimals with magnitude > 1 produce improper fractions (2.75 -> 11/4). To write an improper output p/q as a mixed number W r/q, divide |p| by q: the integer quotient is W and the remainder r stays over q (11 ÷ 4 = 2 remainder 3, or 2 3/4).

Second, if you enter an integer (5) or a decimal whose fractional digits are all zero (5.00), gcd(500, 100) = 100 cancels the entire power of 10 and returns 5/1. Negative inputs (-0.375) keep their minus sign on the numerator (-3/8).

Comparison of proper fractions (3/8), improper fractions (11/4 = 2 3/4), and whole-number outputs (5/1)
Outputs are reduced to p/q where gcd(|p|, q) = 1, with whole numbers printed as p/1.

Decimal to fraction converter syntax rules (12 decimal places, 30 digits)

Before clicking Convert decimal, check that your input satisfies the validator (/^[+-]?\d+(?:\.\d{1,12})?$/):

First, you can enter up to 12 digits after the decimal point and up to 30 total digits across the integer and fractional parts. Exceeding either bound triggers 'Use a finite decimal with at most 12 decimal places and 30 digits.' A bare leading period (.125), thousands commas (1,000.25), or embedded whitespace fails the regular expression check, so prefix sub-unit values with 0. or -0..

Second, exponential strings (1.25e-3) must be expanded into standard decimal form (0.00125) first using our Scientific Notation Converter. Entering a truncated repeating decimal like 0.333333333333 treats it as an exact 12-place finite decimal and returns 333333333333/1000000000000; to recover 1/3, use the 10^k - 1 rule below or our Continued Fraction Calculator.

Summary of the 12-decimal-place limit, 30-digit BigInt capacity, and required leading digit (0.125)
Supports finite decimals up to 12 decimal places and 30 total digits with a required leading digit.

Frequently asked questions about decimal to fraction conversion

Answers about using Decimal To Fraction Converter and understanding its results.

How do you convert a decimal to a fraction by hand?

Count the number of digits k after the decimal point, write the number without the decimal point as the numerator over 10^k (10 for 1 place, 100 for 2 places, 1,000 for 3 places), and divide both top and bottom by their greatest common divisor (GCD). For 0.375, write 375 / 1000 and divide both by 125 to get 3/8.

Why do I need to type 0.125 instead of .125?

The input parser validates strings against /^[+-]?\d+(?:\.\d{1,12})?$/, which requires at least one integer digit before the optional decimal point so typos like a stray period are caught immediately.

How do I convert an improper fraction output (like 11/4) into a mixed number?

Divide the numerator by the denominator using integer division (11 ÷ 4 = 2 with a remainder of 3). Write the quotient 2 as the whole number and place the remainder 3 over the original denominator 4 (2 3/4).

How do I convert a repeating decimal (like 0.333... or 0.142857...) to a fraction?

Because this tool converts finite decimals over 10^k, place one repeating block of length k over 10^k - 1 (a string of k nines) and simplify in our Fraction Simplifier. For 0.333... (k = 1), simplify 3/9 = 1/3; for 0.142857... (k = 6), simplify 142857 / 999999 = 1/7.

How many decimal places can this converter handle?

You can enter up to 12 digits after the decimal point (denominators up to 10^12 = 1,000,000,000,000) and up to 30 total digits across the entire number.

How do I convert a percentage (like 37.5%) into a fraction?

Divide the percentage by 100 (move the decimal point two places to the left) to get a finite decimal (37.5% -> 0.375), then enter 0.375 into this converter to get 3/8.

Convert your decimal to a simplified fraction now

Choose another tool for your next calculation, conversion, or text task.

Convert decimal