Ratio Calculator Formula
Understand the math behind the ratio calculator. Each variable explained with a worked example.
Formulas Used
Ratio A:B (as decimal)
ratio_ab = a / bRatio B:A
ratio_ba = b / aA as % of Total
fraction_of_total = (a / (a + b)) * 100A / (A+B)
part_to_whole = a / (a + b)Variables
| Variable | Description | Default |
|---|---|---|
a | Quantity A | 150 |
b | Quantity B | 200 |
How It Works
How to Calculate a Ratio
Formula
Ratio A:B = A / B
A ratio compares two quantities by division. The ratio 150:200 simplifies to 3:4 (divide both by 50). Ratios can be expressed as fractions (3/4), decimals (0.75), or percentages. To convert a ratio to parts of a whole, divide each part by the sum.
Worked Example
Compare 150 to 200.
a = 150b = 200
- 01Ratio A:B = 150/200 = 0.75 or 3:4
- 02Ratio B:A = 200/150 = 1.3333 or 4:3
- 03A as fraction of total = 150/(150+200) = 150/350 = 42.86%
- 04B as fraction of total = 200/350 = 57.14%
Ready to run the numbers?
Open Ratio Calculator