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 / b

Ratio B:A

ratio_ba = b / a

A as % of Total

fraction_of_total = (a / (a + b)) * 100

A / (A+B)

part_to_whole = a / (a + b)

Variables

VariableDescriptionDefault
aQuantity A150
bQuantity B200

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
  1. 01Ratio A:B = 150/200 = 0.75 or 3:4
  2. 02Ratio B:A = 200/150 = 1.3333 or 4:3
  3. 03A as fraction of total = 150/(150+200) = 150/350 = 42.86%
  4. 04B as fraction of total = 200/350 = 57.14%

Frequently Asked Questions

How do I simplify a ratio to whole numbers?

Divide both quantities by their greatest common divisor (GCD). For 150:200, GCD is 50, giving 3:4. For decimals, first multiply to get whole numbers, then simplify.

What is the difference between ratio and rate?

A ratio compares quantities of the same kind (apples to oranges). A rate compares quantities of different kinds (miles per hour, cost per unit). Rates have units; ratios are dimensionless.

Can ratios involve more than two quantities?

Yes. A ratio like 2:3:5 compares three quantities. To find each part, divide each number by the sum (2+3+5=10) and multiply by the total amount.

Learn More

Guide

Hydration Guide: How Much Water Do You Really Need?

Learn how to calculate your daily water intake based on weight, activity level, and climate. Understand the signs of dehydration and how to stay properly hydrated.

Ready to run the numbers?

Open Ratio Calculator