
Rex says
Money math without the spreadsheet headache. Plug in your numbers and I'll show you exactly where the dollars land.
Try a scenario
Click to load — tweak from there.Inputs
Result
Net margin per fill (after DIR)
$7.26
Monthly profit on this drug
$290
Gross margin before DIR fee
$8.00
Estimated DIR fee per fill
$0.74
Net margin as % of total reimbursement
36.3%

Psst — share this and help Rex grow
One click, a permanent link with your numbers baked in.
How to use this
- 1Enter ingredient cost reimbursement ($).
- 2Enter dispensing fee ($).
- 3Enter pharmacy acquisition cost (nadac/actual) ($).
- 4Enter estimated dir fee (% of reimbursement) (%).
- 5Enter fills per month for this drug.
- 6Read your net margin per fill (after dir) on the right — it updates as you type.
- 7Hit Share to keep the scenario or send it to someone.
About this calculator
Independent pharmacies survive or fail on generic drug margin since brand-name reimbursement is often near or below acquisition cost. This calculator takes the reimbursement rate (typically calculated as a MAC or AWP-minus rate plus a dispensing fee), the pharmacy's actual acquisition cost for the drug, and estimated direct and indirect remuneration (DIR) fees that PBMs claw back after the point of sale, to compute true net margin per prescription. DIR fees are the critical and often underestimated variable — they're deducted retroactively, sometimes months after the fill, based on pharmacy performance metrics, and can turn an apparently profitable $8 margin fill into a net loss once clawed back. The calculator also shows margin as a percentage of reimbursement so you can compare across drugs of different price points. Pharmacies use this per-NDC to decide which generics to stock proactively versus order on-demand, since a drug with thin or negative margin after DIR fees may not be worth carrying inventory risk on, and to negotiate wholesaler pricing tiers where volume discounts can flip a marginal drug into a profitable one.
Worked example
Using the values the calculator loads with:
Inputs
- Ingredient cost reimbursement: 18.5 $
- Dispensing fee: 1.5 $
- Pharmacy acquisition cost (NADAC/actual): 12 $
- Estimated DIR fee (% of reimbursement): 4 %
- Fills per month for this drug: 40
Results
- Net margin per fill (after DIR): $7.26
- Monthly profit on this drug: $290
- Gross margin before DIR fee: $8.00
- Estimated DIR fee per fill: $0.74
- Net margin as % of total reimbursement: 36.3%
What each field means
Inputs
- Ingredient cost reimbursement ($)
- The ingredient cost reimbursement used in the calculation, measured in $. Starts at 18.5 $ so you have a working example on load.
- Dispensing fee ($)
- The dispensing fee used in the calculation, measured in $. Starts at 1.5 $ so you have a working example on load.
- Pharmacy acquisition cost (NADAC/actual) ($)
- The pharmacy acquisition cost (nadac/actual) used in the calculation, measured in $. Starts at 12 $ so you have a working example on load.
- Estimated DIR fee (% of reimbursement) (%)
- The estimated dir fee (% of reimbursement) used in the calculation, measured in %. Starts at 4 % so you have a working example on load. Accepted range: 0–20 %.
- Fills per month for this drug
- The fills per month for this drug used in the calculation. Starts at 40 so you have a working example on load.
Results
- Net margin per fill (after DIR)
- Returned as a money amount in US dollars and shown as the headline result. It recalculates instantly whenever you change an input, so you can compare scenarios without reloading.
- Monthly profit on this drug
- Returned as a money amount in US dollars. It recalculates instantly whenever you change an input, so you can compare scenarios without reloading.
- Gross margin before DIR fee
- Returned as a money amount in US dollars. It recalculates instantly whenever you change an input, so you can compare scenarios without reloading.
- Estimated DIR fee per fill
- Returned as a money amount in US dollars. It recalculates instantly whenever you change an input, so you can compare scenarios without reloading.
- Net margin as % of total reimbursement
- Returned as a percentage. It recalculates instantly whenever you change an input, so you can compare scenarios without reloading.
FAQ
Why are DIR fees such a problem for independent pharmacies?
DIR fees are assessed after the point of sale, sometimes 60-90 days later, based on pharmacy performance scores the pharmacy can't fully see or control at the time of the fill. This makes real-time margin tracking nearly impossible and has been a major driver of independent pharmacy closures over the past decade.
Where do I find my actual acquisition cost?
Use your wholesaler invoice cost for the specific NDC dispensed, not the published AWP or WAC price, which are list prices far above what pharmacies actually pay. NADAC (National Average Drug Acquisition Cost) from CMS is a reasonable public benchmark if you don't have exact invoice data handy.
Should I stop stocking drugs with negative net margin?
Not automatically — some low or negative margin drugs drive foot traffic, keep patients on your other prescriptions, or are required for a specific patient population you serve. But track them explicitly rather than discovering the loss buried in aggregate pharmacy P&L.
How much do 2024 DIR fee reforms change this math?
CMS finalized rules moving most Medicare Part D price concessions to point-of-sale starting 2024, which should reduce retroactive DIR clawbacks significantly for Part D claims specifically. Commercial and Medicaid PBM contracts may still use retroactive DIR-like fee structures, so verify per payer contract.
Accuracy and limitations
- Results are estimates before tax, fees, and inflation unless an input explicitly covers them.
- Rates are treated as fixed for the whole period — variable-rate products will drift from this projection.
- This is educational maths, not financial advice. Check anything contractual with the lender or your accountant.
Related tools
Cite this calculator
Writing about this topic? Grab a citation — every link helps keep these tools free.
RevenueLab. (2026). Pharmacy Generic Drug Margin Calculator. Retrieved from https://www.revenuelab.fyi/toolbox/pharmacy-generic-margin
<p>Source: <a href="https://www.revenuelab.fyi/toolbox/pharmacy-generic-margin" target="_blank" rel="noopener">Pharmacy Generic Drug Margin Calculator — RevenueLab</a> (2026).</p>
Source: [Pharmacy Generic Drug Margin Calculator — RevenueLab](https://www.revenuelab.fyi/toolbox/pharmacy-generic-margin) (2026).
