Typed decimal means an exact terminating value
The exact result treats every digit you type as meaningful. Thus 0.3333 is exactly 3333/10000, not an assumed repeating 1/3. Trailing zeros do not change the reduced fraction but are counted in the displayed interpretation. Enter a dot decimal with at most 18 decimal places; commas, unit text and exponent notation are rejected.
Exact conversion method
If a decimal has p digits after the point, remove the point to form an integer numerator and use 10^p as the denominator. Divide both by their greatest common divisor. For 2.75, 275/100 reduces by 25 to 11/4, or 2 3/4. Integer arithmetic preserves the typed decimal exactly.
Nearest useful fraction under a limit
The optional approximation checks every denominator from 1 through your limit and chooses the numerator nearest to the exact value. Candidate errors are compared with integer cross-products, not rounded display decimals; ties prefer the smaller denominator. This is useful for a practical ruler or recipe fraction, but it changes the value unless the error is zero.
Independent check examples
0.125 = 125/1000 = 1/8 exactly. The typed value 0.3333 reduces to 3333/10000; with maximum denominator 64, the nearest fraction is 1/3 and the absolute error is 1/30000 ≈ 0.0000333333. Negative −1.2 becomes −6/5 or −1 1/5.
Limits, interpretation and sources
This tool converts finite typed decimals only; it does not infer repeating bars or convert irrational constants such as π. A fraction with a limited denominator is an approximation unless explicitly marked exact. Method reference: OpenStax Decimals and OpenStax Rational Numbers.