Fraction to decimal: just divide
A fraction is a division waiting to happen: 3/8 means 3 ÷ 8 = 0.375. Some fractions terminate (3/8 = 0.375) and some repeat forever (1/3 = 0.333…). The rule: a simplified fraction terminates only when its denominator's prime factors are all 2s and 5s. That's why eighths and sixteenths convert to clean decimals — handy in woodworking and cooking — while thirds and sevenths never do.
Decimal to fraction: powers of ten and the GCD
Any terminating decimal converts exactly: put the digits over the matching power of ten (0.375 = 375/1000), then divide top and bottom by their greatest common divisor. The GCD of 375 and 1000 is 125, giving 3/8. This tool runs Euclid's algorithm — repeatedly replacing the larger number with the remainder of dividing the two — which finds the GCD in a handful of steps even for long decimals.
Repeating decimals need a different trick
Typing 0.333333 gives you 333333/1000000 simplified — the exact fraction of what you typed, not 1/3, because the true value repeats forever. Converting a repeating decimal exactly takes algebra: for x = 0.333…, multiply by 10 to get 10x = 3.333…, subtract to get 9x = 3, so x = 3/9 = 1/3. If you know your number is a third, sixth, or ninth, enter it as a fraction instead.
How to use this converter
To go from a fraction to a decimal, type the numerator and denominator. To go the other way, type a decimal and the tool returns the fully simplified fraction plus a mixed-number form when the value exceeds one. The reference table of common fractions is there for quick lookups without typing anything at all.
A worked example
Convert 7/16 to a decimal: 7 ÷ 16 = 0.4375, a clean terminating value because 16 is a power of 2. Now go backward from 0.4375: write it as 4375/10000, find the GCD (625) with Euclid's algorithm, and divide to recover 7/16 exactly. Enter 9/4 instead and you get 2.25, which the tool also shows as the mixed number 2 1/4 — the same value expressed three ways.