Decimal to Fraction Converter

Turn finite decimals and repeating decimals like 1.2(34) into the simplest exact fraction.

Examples
Fraction result
Simplified fraction
Mixed number
Decimal type
Enter a finite or repeating decimal.

Every conversion happens in your browser — the decimal you type never leaves your device.

FAQ

How do I type a repeating decimal?

Put the repeating part in parentheses: 0.(3) means 0.333..., and 1.2(34) means 1.2343434.... Plain decimals like 0.125 work too.

Is the fraction exact?

Yes. The tool works from the digits you type, then reduces the numerator and denominator by their greatest common divisor. It does not guess a repeating pattern from a rounded decimal.

Why show a mixed number too?

The simplified fraction is the exact answer. The mixed-number row is just another way to read values greater than 1, so 1.25 shows as 5/4 and 1 1/4.

Converting Finite and Repeating Decimals to Exact Fractions

A decimal number represents a fractional value, but its standard base-10 notation does not always reveal the underlying ratio of integers. Converting these values into exact fractions is essential for maintaining mathematical precision, as decimal representations are often rounded approximations.

This converter processes both finite decimals and repeating decimals, transforming them into their simplest exact fraction form. The conversion occurs instantly in the browser as you type.

Supported Input Formats and Constraints

The converter accepts several decimal formats up to a maximum input limit of 120 digits:

  • Finite Decimals: Standard decimal values such as 0.125 or .5.
  • Repeating Decimals: Decimals with a repeating pattern of digits, which are represented by enclosing the repeating cycle in parentheses. For example, 0.(3) represents 0.333... and 1.2(34) represents 1.2343434....
  • Signed Decimals: Negative and positive signs are accepted.

If the input is empty, invalid, or exceeds the 120-digit limit, the output fields are cleared. The tool relies on explicit user input and does not attempt to guess a repeating pattern from a rounded decimal value.

If the input is malformed, the interface displays the error message:
Enter a decimal like 0.125,.5, 0.(3) or 1.2(34).

If the input exceeds the maximum length, the interface displays:
That decimal is too long to handle comfortably here.

Clicking the "Clear" button empties the input field, resets all results, and places the cursor back in the input field.

Mathematical Process of Conversion

The mathematical method used to convert a decimal to a fraction depends on whether the decimal is finite or repeating.

Finite Decimals

A finite decimal has a terminating number of digits after the decimal point. To convert a finite decimal to a fraction, the decimal is written as a fraction where the numerator is the number without the decimal point, and the denominator is 10 raised to the power of the number of decimal places.

For a decimal with n digits after the decimal point:

Fraction = (Decimal Value × 10ⁿ) / 10ⁿ

For example, with the decimal 0.125, there are 3 digits after the decimal point:

125 / 10³ = 125 / 1000

Repeating Decimals

Repeating decimals contain a sequence of digits that repeats infinitely. To convert these to an exact fraction, algebra is used to eliminate the repeating part.

Let x equal the repeating decimal, such as x = 1.2(34), which is 1.2343434....

  1. Multiply x by 10ᵈ, where d is the number of non-repeating decimal places, to isolate the repeating cycle directly after the decimal point: 10x = 12.343434...
  2. Multiply this new equation by 10ᵖ, where p is the length of the repeating cycle (in this case, 2 digits, so 10² = 100): 1000x = 1234.343434...
  3. Subtract the first equation from the second equation to eliminate the infinite repeating part: 1000x - 10x = 1234.343434... - 12.343434... 990x = 1222
  4. Solve for x: x = 1222 / 990

Simplification Using the Greatest Common Divisor (GCD)

Once the initial fraction is established, it must be reduced to its simplest form. This is achieved by dividing both the numerator and the denominator by their Greatest Common Divisor (GCD).

For the fraction 1222 / 990, the GCD of 1222 and 990 is 2:

(1222 ÷ 2) / (990 ÷ 2) = 611 / 495

This results in the exact, simplified fraction.

Understanding the Output Fields

The converter provides several outputs to describe the converted number:

  • Simplified fraction: The exact fraction with the numerator and denominator reduced to their lowest terms by dividing them by their greatest common divisor.
  • Mixed number: For values greater than 1, this representation shows the whole number alongside the remaining fractional part. For example, the improper fraction 5 / 4 is also displayed as the mixed number 1 1 / 4.
  • Decimal type: Identifies whether the input is a Finite decimal or a Repeating decimal; cycle length {n}, where {n} represents the number of digits in the repeating cycle.

A "Copy" hint appears next to the results to allow you to copy the output values to your clipboard.

Local Browser Processing and Privacy

Every conversion is performed locally within your web browser. The decimal values you type are processed entirely on your device and are never uploaded to an external server.


Frequently Asked Questions

How do I type a repeating decimal?

Put the repeating part in parentheses: 0.(3) means 0.333..., and 1.2(34) means 1.2343434.... Plain decimals like 0.125 work too.

Is the fraction exact?

Yes. The tool works from the digits you type, then reduces the numerator and denominator by their greatest common divisor. It does not guess a repeating pattern from a rounded decimal.

Why show a mixed number too?

The simplified fraction is the exact answer. The mixed-number row is just another way to read values greater than 1, so 1.25 shows as 5/4 and 1 1/4.