Small terms. A visible compromise.
Find a whole-number ratio for your decimal.
Choose the largest numerator and denominator you want to use. Ratiofit finds the closest positive p:q within those limits and shows exactly how far it is from your entered target.
Free · No signup · Exact comparisonsSet your target and caps
Editing a field clears the old result. Press Calculate ratio when your three inputs are ready.
Closest under these caps
Your reduced ratio
≈
Achieved decimal rounded to 12 places. Exact fractions determine the choice.
- Signed error: achieved − target
- Absolute ratio error
- Your exact entered target
- Attainable interval under caps
Error decimals are rounded to 18 places. A nonzero permitted error stays nonzero; exact-match status comes only from exact arithmetic.
Equal absolute error: choose the lower ratio, then the smaller denominator, then the smaller numerator.
Two genuine limits
A target near 1.7778 can use 16:9 with caps of 20 each. Limit the numerator to 8 and denominator to 10, and the closest pair becomes 7:4. A denominator-only shortcut does not enforce both caps.
A tiny error is still an error
The entered decimal 1.777777777778 is close to 16/9, but it is not exactly equal. This tool keeps that finite decimal as the target and shows the remaining difference instead of calling it exact.
Know the tie rule
For target 0.75 with p ≤ 1 and q ≤ 2, both 1/2 and 1 are 0.25 away. Ratiofit chooses the lower value, 1:2. See the tie examples.
A numerical helper for small proportions
Use the calculator when you have a desired dimensionless proportion and want modest positive whole-number terms. A layout sketch or model diagram might be easier to label with a short p:q pair. You decide which caps and approximation error are suitable; the result does not promise that a physical part, print, mechanism or material will fit.
This tool does not convert units, distribute a fixed total, interpret irrational symbols or optimize a tolerance band. Its objective is only the smallest absolute difference in ratio value within your caps. Read the method and original worked examples before using a result.