Article — Alligation Calculator
Alligation calculator: pharmacy compounding made simple
Alligation is a 14th-century arithmetic technique for mixing two strengths to hit a target. It works because the ratio of high-strength to low-strength parts equals (target − low) over (high − target). Pharmacists use it daily for compounding creams, oral suspensions, and intravenous solutions. The math has not changed in 700 years.
This alligation calculator solves the alternate form directly. Enter the higher and lower strengths, the target, and the total volume you need to dispense. The output shows the parts ratio, the exact volume of each ingredient, and a verified target concentration — a built-in sanity check before you compound.
What is alligation?
Alligation comes from the Latin alligare, meaning "to bind together." The technique was originally used in medieval European pharmacy and metallurgy to combine substances of different strengths or purities at a desired final value. It pre-dates algebra in widespread use and survives in modern pharmacy curricula because it is faster than equation-solving when working under time pressure.
Two varieties exist. Alligation alternate answers "how much of each do I mix?". Alligation medial answers "what strength did I end up with?" after mixing known quantities. Most calculator work is alternate.
The alligation alternate method
The core formula is a ratio of differences. If S_A is the higher strength, S_B the lower, and C the target, the parts of A required equal (C − S_B), and the parts of B equal (S_A − C). Total parts equal (S_A − S_B), the spread between the two strengths.
parts A: parts B = (C − S_B): (S_A − C)volume A = parts A / total parts × Vvolume B = V − volume AThe alligation grid method (tic-tac-toe)
Most pharmacy schools teach alligation visually as a tic-tac-toe grid. The higher strength sits in the top-left, the lower in the bottom-left, the target in the centre. Differences are subtracted along diagonals: target minus lower goes to the top-right (parts of A), higher minus target goes to the bottom-right (parts of B). The right column then reads off the mix ratio.
The grid method has been verified for 5+ component blends in modern computational pharmacy. A 2024 Journal of Chemical Education paper described how pharmacy faculty re-introduced alligation alternate to undergraduate chemistry students as a fast mental tool for stoichiometry verification.
A pharmacy alligation example
A pharmacist needs 500 mL of 3% sodium chloride saline. Stock options: 0.9% saline (the usual diluent) and 23.4% concentrated saline. Target is 3%, halfway between the extremes but closer to the diluent.
Parts of 23.4% = 3 − 0.9 = 2.1 parts. Parts of 0.9% = 23.4 − 3 = 20.4 parts. Total = 22.5 parts. Volume of 23.4% = (2.1 / 22.5) × 500 = 46.7 mL. Volume of 0.9% = 453.3 mL. The verified target is (46.7 × 23.4 + 453.3 × 0.9) / 500 = 3.00% — correct.
Alligation vs simple dilution
Simple dilution is alligation with one component at 0% strength. The classic C₁V₁ = C₂V₂ equation handles this special case: stock + water. Alligation generalizes the same conservation law to any two strengths, neither of which has to be pure water or pure stock. The math reduces to dilution when you set S_B = 0.
Always verify with the medial check: total active mass before mixing equals total active mass after. If volume A times strength A plus volume B times strength B does not equal total volume times target, something is wrong. The calculator's "Verified target" cell does this for you.
Alligation medial: the reverse problem
Alligation medial calculates the average strength of an already-made blend. The formula is a weighted average: sum each component's volume times its strength, then divide by total volume. It is most useful as a verification step after compounding by alligation alternate.
For mixing 300 mL of 20% solution with 200 mL of 5%: mean = (300 × 20 + 200 × 5) ÷ (300 + 200) = 14%. The medial result confirms your alternate ratio came out as expected.
Where alligation breaks down
Alligation only works if the target falls between the two component strengths. You cannot make a mixture stronger than your strongest ingredient or weaker than your weakest. When the target is exactly equal to one of the strengths, the parts of the other ingredient go to zero — you do not need to mix anything.
If the calculator returns negative parts, the target lies outside the range [S_B, S_A]. The result is physically meaningless. Either dilute the stronger ingredient first, or source a different stock with the right strength.
Common alligation pitfalls
Three errors keep appearing in compounding logs. First, mismatched units — the strengths must share a unit (% w/w, % w/v, mg/mL — pick one). Second, calculating with the active drug's weight when the prescription is in solution strength, or vice versa. Third, rounding the parts before computing volumes, which compounds the error in the final volume.
- Hydrocortisone cream — mix 2.5% with 0% base for any target between 0.1% and 2.4%
- Dextrose IV — combine 5% (D5W) and 50% (D50) for 10–40% solutions
- Isopropyl alcohol — dilute 99% to 70% for skin antisepsis using purified water
- Mouthwash — blend 0.12% and 0.06% chlorhexidine for pediatric strengths
- Saline — combine 0.9% and 23.4% for hypertonic 3% concentrations
- Topical lidocaine — blend 4% and 2% for custom anesthetic strengths
The calculator handles the arithmetic; the clinical judgement stays with the compounder. Combined with the verification cell, alligation alternate remains the fastest method to mix two strengths to a target — exactly as it has been since the medieval apothecaries who first wrote it down.
Beyond pharmacy, alligation appears in food chemistry (mixing two ingredient strengths to a desired final concentration), winemaking (blending high- and low-alcohol vintages), photography (mixing two developer strengths), and metallurgy (the original 14th-century use — blending precious metals to a desired karat). The mathematics is identical regardless of substance.
Modern pharmacy schools still teach alligation alternate alongside algebraic solutions because the grid method scales better mentally when working under time pressure. A pharmacy technician filling a compound prescription can run an alligation calculation in 15 seconds with practice — faster than entering values into a spreadsheet or calculator. The visual grid serves as its own check: a missing diagonal jumps out as the answer is being read off.
One subtlety worth noting: alligation assumes ideal mixing where volumes are additive. For most aqueous solutions at typical concentrations this is a reasonable approximation. For mixtures involving alcohol and water, ammonia and water, or other hydrogen-bonding partners, the actual volume after mixing is slightly less than the sum of starting volumes (volume contraction). For high-precision pharmaceutical work involving alcoholic solutions, account for this by mixing slightly more than the calculated total and adjusting downward.