Audited 06 Jun 2026·Last updated 27 Jul 2026·6 citations·Tier 1·0 uses

Ratio Calculator

Simplify any ratio to lowest terms and scale it to a total amount. Converts ratios to decimals and percentages with step-by-step arithmetic.

Ratio Calculator

First quantity in the ratio.
Second quantity in the ratio.
Optional total to scale the ratio into absolute amounts.
Simplified Ratio
2:3
Ratio in lowest terms (e.g., 2:3).
Ratio as Decimal
0.6667
Ratio as Percentage
66.67%
Part A Amount
0
Part B Amount
0

Background.

A ratio calculator simplifies a pair of numbers to their lowest terms and optionally scales them to a specified total. Ratios are one of the oldest mathematical concepts, appearing in Euclid's Elements around 300 BCE as a fundamental tool for comparing magnitudes. Today they are used in cooking to scale recipes, in engineering to mix compounds, in finance to compare debt to equity, and in education to teach proportional reasoning. The calculator automates the arithmetic that would otherwise require manual greatest-common-divisor computation and cross-multiplication.

Cooks and bakers search for ratio calculators when adapting recipes for different serving sizes. A cake recipe calling for a 3:2 ratio of flour to sugar can be scaled to feed twenty guests instead of eight by computing the total parts (5) and dividing the desired total weight accordingly. Mechanical engineers use ratios to design gear trains: a 4:1 gear ratio means the driven shaft rotates once for every four rotations of the driving shaft. Financial analysts express leverage as a debt-to-equity ratio, and credit rating agencies use these ratios to assess solvency. The ubiquity of ratios across disciplines makes this one of the most broadly applicable calculators in the mathematics category.

The mathematical foundation of ratio simplification is the greatest common divisor (GCD), also called the greatest common factor. The GCD of two integers is the largest positive integer that divides both without a remainder. Euclid described the algorithm for computing it in Book VII, Proposition 2 of the Elements, using repeated subtraction. The modern version uses the modulo operation: GCD(a, b) = GCD(b, a mod b), continuing until the remainder is zero. This algorithm is efficient, requiring at most five times the number of digits of the smaller number (Lamé's theorem, 1844), and it remains the standard method in computer science.

What is ratio calculator?

A ratio is a comparison of two quantities by division, expressed in the form a:b or a to b. It describes how much of one quantity corresponds to another, without specifying their absolute sizes. Ratios can be simplified by dividing both terms by their greatest common divisor, producing an equivalent ratio in lowest terms. For example, the ratio 8:12 simplifies to 2:3 because GCD(8, 12) = 4. Ratios are used to express part-to-part relationships, whereas fractions express part-to-whole relationships. The ratio 2:3 implies five total parts (2 + 3), so the first quantity is 2/5 of the whole and the second is 3/5. Ratios can involve more than two terms (e.g., 2:3:5 for a three-part mixture), but this calculator handles two-term ratios, which are the most common in practice. Ratios are dimensionless if both quantities have the same unit. If the units differ, the ratio carries units (e.g., miles per hour). The calculator assumes the inputs share a common unit or are pure numbers. Ratios appear in everyday contexts such as mixing paint, diluting cleaning solutions, and adjusting recipe yields. In each case, maintaining the correct proportional relationship ensures consistency and quality regardless of the total batch size.

How to use this calculator.

  1. Enter the first quantity (Value A) in the input field.
  2. Enter the second quantity (Value B) in the input field.
  3. (Optional) Enter a total amount in the Total Parts field to scale the ratio into absolute amounts.
  4. Review the simplified ratio, displayed in lowest terms (e.g., 2:3).
  5. Check the decimal and percentage forms for additional context.
  6. If you entered a total, review the computed amounts for Part A and Part B.
  7. Use the simplified ratio or scaled amounts in your recipe, engineering spec, or financial analysis.

The formula.

a:b = (a ÷ d) : (b ÷ d), d = gcd(a, b)

The ratio simplification algorithm rests on the greatest common divisor and the Euclidean algorithm. Given two non-negative integers a and b, the GCD is the largest integer d such that a mod d = 0 and b mod d = 0. The Euclidean algorithm computes this iteratively: replace the larger number with the remainder of dividing the two numbers, and repeat until the remainder is zero. The last non-zero remainder is the GCD. For example, GCD(144, 192): 192 mod 144 = 48; 144 mod 48 = 0; so GCD = 48. Once the GCD is known, the simplified ratio is obtained by dividing each term by it: (a/d) : (b/d). This produces the unique representation in lowest terms because a/d and b/d share no common divisor greater than 1. If d = 1, the ratio is already in lowest terms. The algorithm works for any non-negative integers, including zero: GCD(0, b) = b, so the simplified ratio of 0:b is 0:1. The decimal form is computed as a / b, which expresses the relative magnitude of the first quantity to the second as a single real number. If b = 0, the decimal is undefined and the calculator rejects the input. The percentage form is (a / b) × 100, which expresses the first quantity as a percentage of the second. Scaling the ratio to a total T requires computing the sum of the simplified ratio terms, s = (a/d) + (b/d), then allocating T proportionally: Part A = T × (a/d) / s and Part B = T × (b/d) / s. The allocation preserves the ratio because Part A / Part B = (a/d) / (b/d) = a/b. Dimensional analysis confirms that if T has units of mass, volume, or currency, the parts inherit the same units while the ratio itself remains dimensionless. The time complexity of the Euclidean algorithm is O(log min(a, b)), making it efficient even for very large numbers. Lamé's theorem states that the number of steps required is at most five times the number of decimal digits in the smaller number.

A worked example.

Example

A civil engineer needs to mix concrete with a 150:250 ratio of cement to aggregate by weight. First, the engineer simplifies the ratio using the Euclidean algorithm. GCD(150, 250): 250 mod 150 = 100; 150 mod 100 = 50; 100 mod 50 = 0. The GCD is 50. Dividing both terms by 50 yields a simplified ratio of 3:5. The engineer confirms this by checking that 3/5 = 0.6 and 150/250 = 0.6, so the simplified ratio is equivalent. The total batch size is 800 kilograms. The sum of the simplified ratio parts is 3 + 5 = 8. The cement allocation is 800 × 3/8 = 300 kg. The aggregate allocation is 800 × 5/8 = 500 kg. The engineer verifies that 300 + 500 = 800 kg and that 300:500 = 3:5, confirming the ratio is preserved. The decimal form is 0.6, meaning there is 0.6 kg of cement for every 1 kg of aggregate. The percentage form is 60%, meaning cement constitutes 60% of the aggregate weight. These three representations—ratio, decimal, and percentage—give the engineer flexibility in communicating the mix design to suppliers and inspectors.

total Parts800
value B250
value A150

Frequently asked questions.

What is the difference between a ratio and a fraction?
A ratio compares two parts to each other (part-to-part), while a fraction compares one part to the whole (part-to-whole). The ratio 2:3 means two units of A for every three units of B, with five total units. The fraction 2/5 means two parts out of five total. A ratio can be converted to fractions by dividing each term by the sum of the terms: in the ratio 2:3, A is 2/5 of the total and B is 3/5. The calculator displays both perspectives when a total is provided, but the primary output is the part-to-part ratio because that is the most common use case.
Can ratios have more than two terms?
Yes, multi-term ratios such as 2:3:5 are common in chemistry and cooking, where three or more ingredients are mixed. However, this calculator handles two-term ratios because they are sufficient for most applications and because multi-term ratios introduce additional complexity in simplification and scaling. Users who need three-term ratios can simplify them pairwise: first simplify the ratio of A to B, then simplify the result to C. For dedicated multi-term ratio support, users should consult a stoichiometry or recipe-scaling specialized tool.
What happens if one of the values is zero?
If Value A is zero and Value B is positive, the simplified ratio is 0:1, the decimal is 0, and the percentage is 0%. This is valid and meaningful: it means there is none of A for every unit of B. If both values are zero, the ratio is undefined because 0:0 has no meaningful proportional relationship. The calculator rejects this input with an error. If Value B is zero and Value A is positive, the ratio is undefined in decimal form (division by zero), and the calculator rejects the input because ratios require a non-zero second term for meaningful comparison.
How does the calculator handle decimal inputs?
The calculator multiplies both inputs by a power of ten to convert them to integers before applying the Euclidean algorithm. For example, the ratio 1.5:2.25 is converted to 150:225 by multiplying by 100, then simplified to 2:3 by dividing by GCD(150, 225) = 75. This approach preserves precision while leveraging the integer GCD algorithm. For inputs with many decimal places, the scaling factor is determined by the maximum number of decimal places in either input. Very small decimals (< 1e-10) may lose precision due to floating-point representation and should be entered as fractions or scientific notation if exact results are required.
Is the ratio 1:2 the same as 2:1?
No. Ratios are ordered: 1:2 means one part of A for every two parts of B, while 2:1 means two parts of A for every one part of B. The decimal and percentage forms differ accordingly: 1/2 = 0.5 versus 2/1 = 2.0. Reversing the order inverts the relationship. Users must enter the values in the correct order to match their intended comparison exactly. The calculator does not assume symmetry; it consistently treats the inputs as an ordered pair (A, B).
What is the greatest common divisor and why does it matter?
The greatest common divisor (GCD) of two integers is the largest positive integer that divides both without a remainder. It matters for ratios because dividing both terms by the GCD produces the simplest equivalent ratio. Without simplification, the ratio 144:192 is cumbersome; with simplification, it becomes 3:4, which is easier to communicate and compare. The GCD is unique for any pair of integers, so the simplified ratio is also unique. The Euclidean algorithm, invented by Euclid around 300 BCE, is the most efficient known method for computing the GCD and is still used in every modern computer algebra system.
Can I use this calculator for aspect ratios?
Yes. Aspect ratios such as 16:9 or 4:3 are simply ratios of width to height. Enter the width as Value A and the height as Value B. The calculator will simplify the ratio if possible (e.g., 1920:1080 simplifies to 16:9). Note that some aspect ratios are already in lowest terms (e.g., 16:9 has GCD = 1), while others simplify (e.g., 1280:720 simplifies to 16:9). The calculator is useful for verifying that a video resolution matches a target aspect ratio or for scaling dimensions while preserving proportions.
How do ratios apply to financial leverage?
The debt-to-equity ratio is a financial ratio comparing a company's total liabilities to its shareholders' equity. A ratio of 2:1 means the company has twice as much debt as equity. Creditors and investors use this ratio to assess risk: higher ratios indicate greater leverage and higher default risk. The calculator can simplify raw debt and equity figures into a standardized ratio for comparison across companies. However, financial analysis typically reports the ratio as a single decimal (e.g., 2.0) rather than colon notation, so users should also review the decimal output.
Why does the scaled amount sometimes have decimals?
When the total is not evenly divisible by the sum of the simplified ratio parts, the allocation produces fractional amounts. For example, scaling the ratio 2:7 to a total of 1000 gives 222.22 and 777.78 because 1000/9 = 111.111... The calculator rounds to two decimal places for display. In practical applications such as cooking or manufacturing, users may round to the nearest whole unit or adjust the total slightly to achieve integer allocations. The calculator provides the mathematically exact allocation; users apply practical rounding as their context requires.
Are ratios the same as rates?
Ratios and rates are related but distinct. A ratio compares two quantities with the same unit (e.g., 3:5 cups of flour to sugar). A rate compares quantities with different units (e.g., 60 miles per hour). When the units differ, the result is not a pure ratio but a rate with composite units. The calculator treats inputs as pure numbers or as quantities with identical units. If users need to compute a rate (e.g., price per unit), they should use a unit-rate or cost-per-unit calculator rather than a ratio simplifier.

References& sources.

  1. [1]Euclid (c. 300 BCE). Elements, Book VII, Propositions 1–3. English translation: Heath, T.L. (1908). The Thirteen Books of Euclid's Elements. Cambridge: Cambridge University Press.
  2. [2]Hardy, G.H. & Wright, E.M. (2008). An Introduction to the Theory of Numbers, 6th ed. Oxford: Oxford University Press.
  3. [3]NCTM (2000). Principles and Standards for School Mathematics. Reston, VA: National Council of Teachers of Mathematics.
  4. [4]Cengel, Y.A. & Boles, M.A. (2015). Thermodynamics: An Engineering Approach, 8th ed. New York: McGraw-Hill.
  5. [5]Lamon, S.J. (2007). Rational Numbers and Proportional Reasoning: Toward a Theoretical Framework for Research. In F.K. Lester (Ed.), Second Handbook of Research on Mathematics Teaching and Learning (pp. 629–667). Charlotte, NC: Information Age Publishing.
  6. [6]Lamé, G. (1844). "Note sur la limite du nombre des divisions dans la recherche du plus grand commun diviseur entre deux nombres entiers." Comptes Rendus de l'Académie des Sciences 19:867–870.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 313 calculators remain free
  • No billing is enabled
Coming soon