Fractions and decimals are two notations for the same rational numbers — but the translation has texture: some fractions terminate, others repeat forever, and this converter detects which and shows the repeating block exactly.
Fraction to decimal: long division with a memory
3⁄8 = 0.375, done. But 1⁄3 never finishes — the long division hits the same remainder again and again, producing 0.(3). The converter tracks remainders during division: the moment one repeats, the block is found. That's why 1⁄7 shows its famous six-digit cycle 0.(142857).
The 2-and-5 rule
Whether a simplified fraction terminates is pure prime arithmetic: it terminates exactly when the denominator's only prime factors are 2 and 5 (the factors of 10). 7⁄8 terminates because 8 = 2³. 1⁄6 repeats because of the 3 hiding in 6. One glance at a denominator tells you the decimal's fate.
Decimal to fraction: powers of ten, then shrink
0.375 is 375⁄1000 by definition; dividing top and bottom by their GCF (125) lands on 3⁄8. The converter notes the exact factor it divided out. Repeating decimals go the algebra route — 0.666… is 2⁄3 via the classic 10x − x trick — enter them as their fraction instead for exactness.
Why your computer fumbles 0.1 + 0.2
Binary floating point is the 2-and-5 rule with the 5 removed: only denominators that are powers of 2 store exactly. 0.1 = 1⁄10 doesn't qualify, so computers store an approximation — hence 0.30000000000000004. This page's integer-based math sidesteps that entirely. For full fraction arithmetic, the fraction calculator adds, multiplies and simplifies with steps.
Exact conversion via integer long division; decimals accepted to 12 places.