Decimal to fraction

Type a decimal and get the exact fraction. For a repeating decimal, put the repeating digits in brackets: 0.(3) means 0.333... and 0.1(6) means 0.1666...

Decimal to fraction

Type a number above, or tap an example.

Fraction to decimal

Fill in both numbers.

How it works

The page does exact whole-number arithmetic, so nothing is rounded: 0.1(6) comes out as exactly 1/6, not 0.1667. A decimal that ends turns into a fraction over a power of ten, then the top and bottom are divided by their biggest common factor. A repeating decimal is shifted by one repeat and the copies are subtracted so the repeating tail cancels. The other direction is long division, and it stops and brackets the digits the moment a remainder comes back. Numbers can be up to 60 digits. Repeating nines such as 0.(9) are the same number as 1. Everything is worked out on this page; nothing you type is sent or kept.