acalculator

How does fraction to decimal work?

Type a fraction such as 5/8 or 1 3/4. You get the exact decimal, a rounded value, the percent, and the long division that finds it.

Your numbers

Type 5/8, or 1 3/4 for a mixed number.
Decimal
0.625

5/8 as a decimal is 0.625.

Rounded
0.6250
As a percent
62.5%
Type of decimal
terminating
Repeating digits
0
Fraction in lowest terms
5/8
Long division
5 ÷ 8 = 0 remainder 5; 50 ÷ 8 = 6 remainder 2; 20 ÷ 8 = 2 remainder 4; 40 ÷ 8 = 5 remainder 0; The remainder is 0, so the decimal ends; 5/8 = 0.625

Decimal: 0.625. 5/8 as a decimal is 0.625.

The long division

How to calculate

Converts a fraction or mixed number to its exact decimal, with the repeating digits marked, a rounded value, the percent, and the long division.

Example with the default inputs (Fraction 5/8, Round to (decimal places) 4): 5/8 as a decimal is 0.625.

Method: Divide the numerator by the denominator by long division: each step multiplies the remainder by 10 and divides again; the decimal ends when a remainder is 0 and repeats from the first remainder that comes up twice.

  • The arithmetic is exact, with whole numbers of any size.
  • A repeating block is marked with a bar over each of its digits (0.16̅ = 0.1666…). If no block repeats within 60 decimal places, the first 60 are shown, then "…".
  • The rounded value keeps exactly the chosen number of decimal places; halves round away from zero (0.125 to 2 places is 0.13).

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Fraction 5/8, Round to (decimal places) 4 gives Decimal 0.625, Rounded 0.6250, As a percent 62.5%, Type of decimal terminating, Repeating digits 0, Long division 5 ÷ 8 = 0 remainder 5; 50 ÷ 8 = 6 remainder 2; 20 ÷ 8 = 2 remainder 4; 40 ÷ 8 = 5 remainder 0; The remainder is 0, so the decimal ends; 5/8 = 0.625.Source: Method from OpenStax Prealgebra 2e, section 5.3: https://openstax.org/books/prealgebra-2e/pages/5-3-decimals-and-fractions
  2. Fraction 1/3, Round to (decimal places) 4 gives Decimal 0.3̅, Rounded 0.3333, As a percent 33.3̅%, Type of decimal repeating, Repeating digits 1.
  3. Fraction 1/6, Round to (decimal places) 2 gives Decimal 0.16̅, Rounded 0.17, Repeating digits 1.
  4. Fraction 1/7, Round to (decimal places) 3 gives Decimal 0.1̅4̅2̅8̅5̅7̅, Rounded 0.143, Repeating digits 6.
  5. Fraction 1 3/4, Round to (decimal places) 1 gives Decimal 1.75, Rounded 1.8, Fraction in lowest terms 7/4, As a percent 175%.
  6. Fraction -2/3, Round to (decimal places) 4 gives Decimal -0.6̅, Rounded -0.6667.
  7. Fraction 1/97 gives Decimal 0.010309278350515463917525773195876288659793814432989690721649…, Type of decimal repeating.

How it works

The fraction you type (a fraction, a mixed number such as 1 3/4, or a whole number) is first written in lowest terms as p/q with q positive, so 6/8 becomes 3/4 and 1 3/4 becomes 7/4. All arithmetic is exact, with whole numbers of any size.

Long division. Let a = |p|. The whole part is a ÷ q (whole-number division) and the first remainder is r = a mod q. Each decimal digit comes from multiplying the remainder by 10: the digit is (10r) ÷ q and the new remainder is (10r) mod q. The decimal ends when a remainder is 0. If a remainder comes up that came up before, the digits from its first appearance repeat forever. A fraction in lowest terms ends exactly when q has no prime factors other than 2 and 5.

The calculator shows:

  • Decimal (the answer): a minus sign (a plain hyphen) when the fraction is negative, the whole part, and then:
    • a decimal that ends: every digit, such as 0.625 or 1.75, when it has at most 60 decimal places; a whole number has no decimal point (3); a decimal that ends after more than 60 places is written in exact e notation: its first significant digit, then (when there are more) a point and the other significant digits with trailing zeros dropped, then e and the power of ten, with a minus sign when it is negative and no plus sign (10^-200 is 1e-200, 2^-61 is 4.336808689942017736029811203479766845703125e-19);
    • a repeating decimal: the digits before the repeating block, then each digit of the repeating block followed by a combining overline (the character U+0305), such as 0.16̅ for 1/6 and 0.1̅4̅2̅8̅5̅7̅ for 1/7;
    • when no remainder repeats within 60 decimal places: the first 60 decimal places, then … (1/97 repeats every 96 digits).
  • Rounded: the value rounded to the number of decimal places you pick (0 to 20), with every place written (0.6250), halves rounded away from zero, and no minus sign when the rounded value is 0 (−1/1000 to 2 places is 0.00). Leave the box empty to hide it.
  • As a percent: the exact decimal of 100 × p/q, written the same way as the decimal, followed by % (62.5%, 33.3̅%).
  • Type of decimal: terminating or repeating.
  • Repeating digits: 0 for a terminating decimal, or the length of the repeating block. It is left out when the block is not found within 60 decimal places.
  • Fraction in lowest terms: p/q, or the whole number when q is 1.
  • Long division: the steps, joined by a semicolon and a space: first a ÷ q = whole remainder r, then one step per decimal digit, 10r ÷ q = digit remainder r′ (at most 12 digit steps; when there are more, the list stops with …). Then, when the steps were not cut short, The remainder is 0, so the decimal ends or The remainder repeats, so the digits <block> repeat forever (none of the two for a whole number). The last step is p/q in lowest terms (only the whole number when q is 1, as in 6 = 6), then = and the decimal.

Assumptions

  • The input is a fraction, a mixed number, or a whole number; a minus sign applies to the whole mixed number (−1 3/4 = −7/4).
  • The denominator cannot be 0.
  • Numbers are written without thousands separators.

Worked examples by hand

5/8. 5 ÷ 8 = 0 remainder 5. 50 ÷ 8 = 6 remainder 2, 20 ÷ 8 = 2 remainder 4, 40 ÷ 8 = 5 remainder 0. The remainder is 0, so 5/8 = 0.625, which is 62.5% and 0.6250 to 4 places.

1/3. 10 ÷ 3 = 3 remainder 1, and the remainder 1 comes back at every step, so 1/3 = 0.3̅ (0.333…), 0.3333 to 4 places, and 33.3̅%.

1/6. 10 ÷ 6 = 1 remainder 4, then 40 ÷ 6 = 6 remainder 4 again, so the 6 repeats: 1/6 = 0.16̅. To 2 places: 0.1666… is past 0.165, so it rounds up to 0.17.

1/7. The remainders are 1, 3, 2, 6, 4, 5 and then 1 again, with the digits 1, 4, 2, 8, 5, 7, so 1/7 = 0.1̅4̅2̅8̅5̅7̅, with 6 repeating digits, and 0.143 to 3 places.

1 3/4. 1 3/4 = 7/4 and 7 ÷ 4 = 1 remainder 3, then 30 ÷ 4 = 7 remainder 2, 20 ÷ 4 = 5 remainder 0: 1.75, which is 175%. To 1 place, 1.75 is exactly halfway between 1.7 and 1.8, so it rounds away from zero to 1.8.

−2/3. 2 ÷ 3 = 0.666…, so −2/3 = −0.6̅, and to 4 places −0.6667.

1/97. The remainder does not repeat within 60 decimal places (the block is 96 digits long), so the decimal shows the first 60 places, 0.010309278350515463917525773195876288659793814432989690721649, followed by …

Other questions people ask

How do I convert a fraction to a decimal?

Divide the numerator (top) by the denominator (bottom). 5/8 = 5 ÷ 8 = 0.625. By hand, use long division: 8 goes into 5 zero times, then into 50 six times (remainder 2), into 20 twice (remainder 4), and into 40 five times (remainder 0), which gives 0.625.

Why do some fractions give repeating decimals?

In long division there are only as many possible remainders as the denominator, so if the remainder never reaches 0, a remainder must come back, and from then on the same digits repeat. 1/3 gives remainder 1 at every step, so 1/3 = 0.333… .

Which fractions give decimals that end?

A fraction in lowest terms gives a terminating decimal exactly when its denominator has no prime factors other than 2 and 5. 3/8, 7/20 and 9/125 end; 1/3, 5/6 and 2/7 repeat.

What does the bar over the digits mean?

The bar marks the digits that repeat forever. 0.16̅ means 0.16666…, where only the 6 repeats, and 0.1̅4̅2̅8̅5̅7̅ means 0.142857142857… .

How do I convert a mixed number to a decimal?

Keep the whole number and convert the fraction part: 1 3/4 = 1 + 0.75 = 1.75. Or write it as an improper fraction first: 1 3/4 = 7/4, and 7 ÷ 4 = 1.75.

How do I turn a fraction into a percent?

Convert it to a decimal and multiply by 100: 5/8 = 0.625 = 62.5%. The calculator shows the percent exactly, with the same bar for repeating digits (1/3 = 33.3̅%).

How does the rounding work?

The rounded value keeps the number of decimal places you choose and always writes all of them (3/4 to 3 places is 0.750). A value exactly halfway rounds away from zero: 1.75 to 1 place is 1.8, and −1.75 is −1.8.