# How do I convert decimal to fraction?

Writes a decimal number as an exact fraction in lowest terms, and as a mixed number.

- Page: https://www.acalculator.org/convert/decimal-to-fraction
- JSON spec: https://www.acalculator.org/convert/decimal-to-fraction.json
- Version: 97b754461321

## Default answer

Example with the default inputs (Decimal 0.625): 0.625 as a fraction is 5/8.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| decimal | Decimal | The decimal number to write as a fraction, for example 0.625. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| fraction | Fraction | The decimal as a fraction in lowest terms, numerator over denominator. |
| mixed | Mixed number | The fraction as a whole number and a proper fraction. |
| work | How | The decimal over a power of ten, then both parts divided by their greatest common factor. |

## Method

Write the decimal over 10 to the power of its number of decimal places, then divide the numerator and denominator by their greatest common factor.

## Assumptions

- The decimal is taken exactly as typed: 0.333 is 333/1000, not 1/3.
- The decimal keeps up to 17 significant digits, the precision of a number on this page.
- A negative decimal gives a negative fraction.

## Worked examples

1. decimal = 0.625 gives fraction = 5/8, mixed = 5/8, work = 0.625 = 625/1000 = 5/8 (both divided by 125). Source: hand calculation in content.mdx: 625/1000, divide by 125; Python 3 Fraction("0.625") = 5/8.
2. decimal = 1.25 gives fraction = 5/4, mixed = 1 1/4. Source: hand calculation in content.mdx: 125/100 = 5/4 = 1 1/4; Python 3 Fraction("1.25") = 5/4.
3. decimal = -0.75 gives fraction = -3/4, mixed = -3/4. Source: hand calculation in content.mdx: 75/100 = 3/4, keep the sign; Python 3 Fraction("-0.75") = -3/4.
4. decimal = 0.3 gives fraction = 3/10, work = 0.3 = 3/10, already in lowest terms. Source: hand calculation in content.mdx: 3/10 has no common factor; Python 3 Fraction("0.3") = 3/10.

## FAQ

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

Write the digits after the decimal point over 10, 100, 1000 and so on (one zero per decimal place), then divide the top and bottom by their greatest common factor. For example, 0.625 = 625/1000, and dividing both by 125 gives 5/8.

### What is 0.75 as a fraction?

0.75 = 75/100. Both numbers divide by 25, so 0.75 = 3/4.

### How do I write a decimal bigger than 1 as a mixed number?

Convert it to a fraction first, then take out the whole part. 1.25 = 125/100 = 5/4, and 5/4 is 1 whole with 1/4 left, so 1.25 = 1 1/4.

### What about repeating decimals like 0.333...?

This converter takes the decimal exactly as you type it, so 0.333 is 333/1000. The repeating decimal 0.333... (threes forever) is exactly 1/3, and 0.666... is 2/3.

### Why is 0.1 not a strange fraction here?

Computers store 0.1 as a binary number that is very slightly off. The converter reads the decimal as you wrote it, so 0.1 is exactly 1/10.
