Skip to content

Alligation Calculator — Mixing Ratio & Quantities

Calculate the ratio to mix a cheaper and a dearer ingredient, or a low and high concentration, to reach a target value, plus the exact amount of each needed.

Alligation Calculator

Enter the value of the cheaper ingredient, the dearer (more expensive) ingredient, and the target mixture value. The tool returns the ratio in which to mix them, and the exact amount of each ingredient when a total quantity is given.

Input values

Results

Mixing ratio

Cheaper parts
10.00
Dearer parts
10.00
Ratio (cheaper : dearer)
1 : 1

Quantities

Cheaper quantity
50.00
Dearer quantity
50.00

Alligation cross

Mixture20.00Dearer30.00Cheaper10.00Dearer parts10.00Cheaper parts10.00

Alligation formula

10.00 : 10.00 = (30.00 − 20.00) : (20.00 − 10.00)

Mixture composition

Mixture composition
Donut chart: Mixture composition with 2 segments.50.0%50.0%20.00 parts
Loading calculator...
📚

Documentation

What is an alligation calculator?

An alligation calculator works out the ratio needed to mix two ingredients of different value into a blend that lands on a target value. The method behind it is called alligation. It applies to any two-part mixture, such as blending a cheap stock with an expensive one, or diluting a strong solution with a weak one, as long as both ingredients are measured on the same scale.

The alligation formula

Alligation compares three numbers on one consistent scale: a cheaper value C, a dearer (more expensive) value D, and a target mixture value M, where C is less than M and M is less than D.

c:d=(D−M):(M−C)c : d = (D - M) : (M - C)

where c is the number of parts of the cheaper ingredient and d the number of parts of the dearer one.

Each ingredient's share comes from the gap on the other side of the target. The closer the target sits to an ingredient's value, the more of that ingredient the blend needs, because the average has to end up near that value.

If a total quantity Q is also known, the amount of each ingredient is:

Ac=D−M(D−M)+(M−C)×QA_c = \frac{D - M}{(D - M) + (M - C)} \times Q

Ad=M−C(D−M)+(M−C)×QA_d = \frac{M - C}{(D - M) + (M - C)} \times Q

where AcA_c is the amount of the cheaper ingredient, AdA_d the amount of the dearer one and Q the total quantity.

The alligation cross

The formula is traditionally drawn as a cross. The two ingredient values sit on the left, the target sits in the middle, and each diagonal difference is written on the opposite corner.

D↘↗M−CMC↗↘D−M\begin{matrix} D & \searrow & & \nearrow & M - C \\ & & M & & \\ C & \nearrow & & \searrow & D - M \end{matrix}

The dearer value sits at the top left, the cheaper value at the bottom left, and the target in the middle. The difference at the top right is the number of parts of the dearer ingredient; the difference at the bottom right is the number of parts of the cheaper one.

Worked example

Mix a $10 ingredient with a $30 ingredient to make a blend worth $20.

The parts come out as cheaper : dearer = (30 − 20) : (20 − 10) = 10 : 10 = 1 : 1.

The two ingredients are needed in equal parts. For 100 units total, that means 50 units of the $10 ingredient and 50 units of the $30 ingredient. The average value of that blend is exactly $20.

Moving the target to $25 changes the ratio: (30 − 25) : (25 − 10) = 5 : 15, which reduces to 1 : 3. The target now sits closer to the dearer value, so the blend needs three times as much of the dearer ingredient as the cheaper one.

Alligation alternate and alligation medial

The method above is called alligation alternate: the two ingredient values and the target are known, and the ratio is unknown. The reverse problem is called alligation medial: the amounts and values of the ingredients are known, and the resulting mixture value is unknown. Alligation medial is a weighted average:

M=q1×v1+q2×v2q1+q2M = \frac{q_1 \times v_1 + q_2 \times v_2}{q_1 + q_2}

where M is the mixture value, q the amount of an ingredient and v its value, with the subscripts marking the first and the second ingredient.

The two methods check each other. Plugging the amounts an alligation-alternate calculation gives back into the weighted-average formula should return the original target value.

Where alligation is used

  • Pharmacy compounding. Blending a strong and a weak preparation, such as a 70% and a 20% solution, to reach a prescribed strength. The values are percentages or concentrations rather than prices, but the arithmetic is the same.
  • Retail and commodity pricing. Blending a cheap and a premium stock to hit a target selling price or unit cost.
  • Food, drink, and chemistry. Diluting or fortifying a solution to a target concentration, proof, or sugar content.

The rule needs only one measured property on a consistent scale, so the same three numbers cover all of these cases.

How to use the alligation calculator

Enter the cheaper value, the dearer value, and the target mixture value, using the same unit for all three. The fields do not accept values below zero. Add a total quantity to see the exact amount of each ingredient needed. The target must sit strictly between the two ingredient values. A target outside that range cannot be reached by any blend of the two ingredients, and a target equal to one of them needs no mixing at all, so the calculator shows an error message instead of a ratio in both cases.

Frequently asked questions

What happens if the target value is not between the two ingredient values? No mixture of the two ingredients can reach it. A blend of a $10 item and a $30 item always has an average value between $10 and $30, so the calculator rejects targets outside that range. It also rejects a target equal to $10 or $30, because that target is met by one ingredient on its own and there is no ratio to work out.

Does the unit of measurement matter? No. The ratio depends only on the differences between the three values, so prices, percentages, and concentrations such as mg/mL all work, as long as all three inputs use the same unit.

Can alligation handle three or more ingredients? This calculator solves the two-ingredient case. Problems with three or more ingredients have more than one valid answer and are usually solved by pairing ingredients two at a time or by setting up linear equations.

Is alligation the same as a weighted average? They are inverse operations. A weighted average, also called alligation medial, turns known amounts into a mixture value. Alligation alternate turns a target value into the amounts needed to reach it.

Why is the method called alligation? The name comes from the Latin word alligare, meaning "to bind" or "to tie together," which describes how the method ties two values into one target ratio.

Sources