What alligation is and when a compounder reaches for it
Alligation is a shortcut for the weighted average. You hold two preparations of known strength and you need a strength between them, so you have to decide the proportion in which to blend them. The full algebra is a two-equation mass balance; alligation collapses it to two subtractions.
It comes up daily in compounding. A prescription calls for 5% hydrocortisone ointment and the shelf holds 10% and 2.5%. A cleanroom needs 70% isopropyl alcohol and stocks 99%. A veterinary suspension has to be diluted from a human-strength product. In every case the finished quantity is fixed by the prescription and the only unknown is the split.
There are two forms of the calculation and they run in opposite directions. Alligation alternate — this page — starts from a desired strength and finds the proportions. Alligation medial starts from known quantities of known strengths and finds the resulting average strength. Medial is the verification step for alternate: work out the proportions, then recompute the strength from them and confirm you get back what you asked for. This calculator does both, and reports the medial result as a check rather than assuming its own answer is right.
The one thing alligation cannot do is produce a strength outside the range of the stocks. Blending anything between 20% and 70% gives you something between 20% and 70%. If the target sits outside, you need a different stock, and the calculator says so rather than returning a plausible negative quantity.
Why cross-subtraction works
Write the mass balance first. If you use Qh of the strong stock at Ch and Ql of the weak stock at Cl to make Q at C, then the drug going in equals the drug coming out:
Ch·Qh + Cl·Ql = C·Q, with Qh + Ql = Q.
Substitute the second into the first and rearrange, and you get Qh/Ql = (C − Cl) / (Ch − C). That is the whole of alligation. The numerator is how far the target sits above the weak stock, and the denominator is how far it sits below the strong stock — the two diagonals of the traditional tic-tac-toe layout.
The layout everyone is taught puts the strong strength top left, the weak strength bottom left, the target in the middle, and the differences on the right. The reason each difference is written on the opposite row is that the parts of the strong stock are governed by how far the target is from the weak one. If your target barely exceeds the weak stock, you need very little of the strong one — which is exactly what a small (C − Cl) says.
Once you have the parts, converting to quantities is proportional division: total parts is Ch − Cl, and each stock gets the batch size times its share. Nothing about the units matters, provided all three strengths are on the same basis. Percent w/w, percent v/v, mg/mL and ratio strengths all work — but you must convert them to a common basis first, because 1% w/v and 1% w/w are only the same thing when the density is 1.
Alligation medial runs the other way and needs no rearrangement at all: multiply each quantity by its strength, add, and divide by the total quantity. It handles any number of components, which is why you use it to verify a three-way blend that alternate cannot solve directly.
Worked example: 500 g of 5% ointment from 10% and 2% stocks
A prescription calls for 500 g of a 5% ointment. The shelf holds a 10% preparation and a 2% preparation of the same drug in the same base.
- Check the target is between the stocks. 2 < 5 < 10. ✓ Alligation applies.
- Parts of the 10% stock. desired − lower = 5 − 2 = 3 parts.
- Parts of the 2% stock. higher − desired = 10 − 5 = 5 parts.
- Total parts. 3 + 5 = 8, which is also higher − lower = 10 − 2 = 8. ✓
- Quantity of the 10% stock. 500 × 3 ÷ 8 = 187.5 g.
- Quantity of the 2% stock. 500 − 187.5 = 312.5 g. Cross-check: 500 × 5 ÷ 8 = 312.5. ✓
- Verify by alligation medial. Drug from the strong stock: 187.5 × 0.10 = 18.75 g. Drug from the weak stock: 312.5 × 0.02 = 6.25 g. Total drug = 25.00 g. Divided by 500 g of product = 0.05, that is 5%. ✓
- Sanity check the direction. The target 5% is nearer the 2% stock than the 10% stock, so most of the batch should be the weaker preparation — and 312.5 g of 500 g is 62.5%. ✓
A second case with a diluent. To make 1,000 mL of 70% isopropyl alcohol from 95% stock and purified water, the water counts as 0% and the parts are 70 − 0 = 70 of the alcohol and 95 − 70 = 25 of the water, out of 95 total parts. So 1,000 × 70 ÷ 95 = 736.84 mL of the 95% stock and 263.16 mL of water. Verify: 736.84 × 0.95 = 700.0 mL of absolute alcohol in 1,000 mL of product, which is 70%. ✓ In practice, mix alcohol and water by weight rather than by volume — the mixture contracts on mixing, so 736.84 + 263.16 mL will not measure out as exactly 1,000 mL.
How to check the answer before you weigh anything
The larger share goes to the stock the target is nearer. This is the fastest sanity check there is. If the target is 5% between stocks of 2% and 10%, it is 3 units above the weak and 5 below the strong, so the weak stock dominates. If your answer says otherwise, you have written the differences on the wrong rows.
The two quantities must sum to the batch size. Obvious, and worth doing every time, because the most common slip is computing both quantities from their own parts and getting a total that is not what was ordered.
Run the medial check. Multiply each quantity by its strength, add, divide by the total. If the result is not the target to within rounding, something is wrong. This calculator performs it automatically and reports the verified strength as a separate output rather than echoing the input.
Watch for quantities you cannot weigh. A class A prescription balance has a sensitivity requirement that puts a floor of about 120 mg on a directly weighable quantity at 5% error. If alligation gives you 40 mg of the strong stock, you do not weigh 40 mg — you make a larger batch and take an aliquot, or you use the aliquot method with a diluent.
Confirm the two stocks are truly compatible. Alligation is arithmetic; it does not know that an oil-in-water cream will not blend homogeneously with an anhydrous ointment, or that two vehicles have different pH. USP General Chapter <795> governs the practice side: compatibility, beyond-use dating, documentation and the master formulation record.
Common alligation problems worked out
| Stocks | Target | Batch | Parts (high : low) | Quantity high | Quantity low |
|---|---|---|---|---|---|
| 10% and 2% | 5% | 500 g | 3 : 5 | 187.5 g | 312.5 g |
| 70% and 20% | 40% | 1,000 mL | 20 : 30 | 400 mL | 600 mL |
| 95% and 0% | 70% | 1,000 mL | 70 : 25 | 736.84 mL | 263.16 mL |
| 100% and 0% | 2.5% | 60 g | 2.5 : 97.5 | 1.5 g | 58.5 g |
| 1% and 0.1% | 0.25% | 120 g | 0.15 : 0.75 | 20 g | 100 g |
| 50% and 5% | 15% | 450 mL | 10 : 35 | 100 mL | 350 mL |
| 30% and 10% | 25% | 240 g | 15 : 5 | 180 g | 60 g |
| 20% and 0% | 20% | 100 g | 20 : 0 | 100 g | 0 g |
The 1% / 0.1% row shows why parts need not be whole numbers, and the last row is the degenerate case where the target equals the stronger stock and no diluent is used at all.
Compounding practice: USP General Chapter <795>
The arithmetic on this page is only the first step of a compounded preparation. USP General Chapter <795>, Pharmaceutical Compounding — Nonsterile Preparations, governs the rest: the master formulation record, the compounding record, ingredient identity and quality, equipment calibration, minimum weighable quantity, physical and chemical compatibility, beyond-use dating and labelling. Sterile preparations fall under <797> and hazardous drugs under <800>. A correct alligation does not make a preparation compliant; document the calculation as part of the compounding record.
Where alligation goes wrong
- Writing the differences on the same row instead of diagonally. This reverses the answer, giving 312.5 g of the strong stock instead of the weak one. The nearest-stock sanity check catches it immediately.
- Attempting a target outside both stocks. No blend of 20% and 70% is 80%. The algebra returns a negative quantity, which is the mathematical way of saying you need a different stock.
- Mixing bases: percent w/w with percent w/v. They coincide only at a density of 1 g/mL. Convert everything to one basis before you subtract.
- Forgetting that a diluent is 0% and a pure drug is 100%. Both are ordinary stocks in the calculation; leaving them out of the layout is a frequent examination error.
- Weighing below the balance's minimum. Anything under roughly 120 mg on a class A balance exceeds the acceptable weighing error. Use the aliquot method instead of trusting the reading.
- Assuming volumes are additive. Alcohol and water contract on mixing, so a hydroalcoholic preparation measured by volume will fall short. Work in weight, or make to final volume.
- Using alligation alternate for three stocks. With three components the problem is underdetermined — many combinations satisfy it — so pair them off or set up the mass balance directly, then verify with alligation medial.
Alligation among the other dilution methods
Three related calculations cover most concentration work, and choosing the right one is half the battle.
Alligation alternate applies when you have two strengths and need a third between them, with the batch size fixed. The dilution equation C₁V₁ = C₂V₂ applies when one of your stocks is an inert diluent and you want to know how much stock to take — it is the special case of alligation with the weak stock at 0%, and it is quicker when that is genuinely the situation. Alligation medial applies when the quantities are already decided and you want to know the resulting strength, which is also how you verify the other two.
Sequential dilution is a fourth pattern used when the ratio is too large to do in one step, and the arithmetic there is multiplicative rather than proportional — the serial dilution calculation handles that case, which is standard in microbiology and analytical work. When the strength is expressed as milliequivalents rather than percent, as it is for most electrolyte injections, convert first with the mEq to mg conversion and then apply alligation to the resulting mg/mL figures.
Downstream, the compounded product still has to be billed, and the quantity you prepared becomes the quantity dispensed in the days supply calculation. If the preparation is for a child, check the final concentration against the intended dose with a weight-based dose calculation before compounding rather than after.
Key terms
- Alligation alternate
- Finding the proportions of two known strengths that give a desired intermediate strength. The differences are taken diagonally, which is where the name comes from.
- Alligation medial
- Finding the average strength of a mixture from known quantities of known strengths. A plain weighted mean, and the natural check on alligation alternate.
- Parts
- The relative proportions of the two stocks, obtained by cross-subtraction. They are dimensionless and are converted to quantities by proportional division of the batch size.
- Diluent
- An inert vehicle counted as 0% strength — white petrolatum, cream base, purified water, lactose. It participates in the calculation like any other stock.
- Minimum weighable quantity
- The smallest amount that can be weighed within an acceptable error on a given balance, roughly 120 mg on a class A prescription balance at 5% error. Below it, use the aliquot method.
- Aliquot method
- Preparing a larger, weighable quantity of a dilution and then taking a measured fraction of it, used when the required amount of a potent drug is too small to weigh directly.
