Ratios turn up in recipes, map scales, financial statements, gear trains, mixture problems and screen aspect ratios — anywhere two quantities need to be compared or kept in proportion. Working out whether 12 : 8 and 9 : 6 are equivalent, or finding the missing value when three parts of a proportion are known, is exactly the kind of arithmetic that is error-prone to do mentally and tedious to verify by hand. Ratio & Proportion Calculator handles all three operations and shows the working at every step.
Three modes cover the full range of ratio problems without any overlap. Simplify Ratio reduces a pair of values to lowest terms. Solve Proportion finds the unknown fourth value X when three are known. Scale Ratio multiplies both parts by a factor, which is the operation behind doubling a recipe, converting a map measurement, or computing equivalent gear ratios at a different RPM.
Worked Example: Three Problems in Three Modes
Click Load Sample in each mode to see a worked case.
- Simplify: enter 12 and 8. The working panel shows GCD(12, 8) = 4, then 12 ÷ 4 = 3 and 8 ÷ 4 = 2, giving the simplified ratio 3 : 2 and the decimal form
1 : 0.667. Decimal inputs such as 2.5 : 1.5 are converted to integers first (5 : 3) before the GCD pass runs, so the result is always in whole numbers. - Proportion: enter A = 3, B = 4, C = 9. The solver cross-multiplies: 3 × X = 4 × 9, so X = 36 ÷ 3 = 12. Paste the result straight into a spreadsheet column or a materials estimate.
- Scale: enter 2 : 5 with factor 3. Each part is multiplied by 3 to produce 6 : 15. The steps show each multiplication separately so the working is auditable.
The Formula Behind Each Mode
- Simplify uses the Euclidean algorithm: GCD(a, b) = GCD(b, a mod b), repeated until the remainder is zero. Both parts are divided by the GCD. For decimal inputs, both values are first scaled by the LCM of their denominators so that the GCD operates on integers rather than floating-point approximations.
- Proportion applies the cross-multiplication rule: if A : B = C : X then A × X = B × C, so X = (B × C) / A. The result is rounded to 6 significant figures and trailing zeros are stripped, so
12.000000 displays as 12. - Scale multiplies each part independently by the factor N. The factor can be any positive number, including fractions such as 0.5 to halve a ratio.
Tricky Inputs: Decimals, Zero and Very Large Numbers
- Zero or negative inputs are rejected with Both A and B must be positive numbers. A ratio of 0 : N is undefined because no finite multiple of zero can equal a non-zero quantity.
- Decimal ratios such as 1.5 : 2.5 are valid. The simplifier converts them to 3 : 5 via integer scaling before applying the GCD. Up to 6 decimal places are preserved in the conversion; a 7th decimal place is rounded.
- Very large values (above roughly 10 trillion) will lose precision in JavaScript's double-precision float, which may cause the GCD to return 1 even when a common factor exists. For exact large-integer ratio arithmetic, a dedicated arbitrary precision library is the right tool.