**Under your assumptions, the ESPP likely comes out ahead.** The biggest missing piece is that payroll deductions enter gradually: your money is tied up for roughly three months on average.

Three adjustments matter:

1. **A 5% discount produces a 5.26% return on your contribution.** You pay $95 for stock worth $100, earning $5 on $95. With your assumed 25% tax rate, the after-tax return is:
   \[
   \frac{5}{95}\times(1-0.25)=3.95\%.
   \]

2. **Only the earliest deductions wait six months.** July contributions wait roughly six months, while December contributions wait very little time. With evenly spaced payroll deductions, the average wait is about three months. A rough annualized comparison is therefore \(3.95\%\times4\approx15.8\%\). That describes the return on the money while committed; each six-month purchase still earns about 3.95% of total contributions.

3. **Assuming a U.S. qualified ESPP, an immediate sale generally makes the discount ordinary wage income.** Your applicable marginal tax rate determines the tax on that discount. Any price change after purchase creates a separate capital gain or loss. [IRS stock-option tax guidance](https://www.irs.gov/taxtopics/tc427)

A dollar comparison makes this clearer. Suppose you contribute **$6,000 evenly through payroll** during the six months:

| Choice | Approximate benefit by December 31 |
|---|---:|
| ESPP, sold at purchase-date market value, with 25% tax | $237 after tax |
| Extra loan payments as each paycheck arrives, at 8% interest | $120 interest saved |

The loan calculation is approximately \( \$6,000\times8\%\times3/12\). Exact payroll dates affect it slightly.

**You could then put the ESPP sale proceeds toward your loan**, capturing the discount and continuing repayment.

Before participating, check whether immediate sales are permitted, how quickly shares become available, and what fees apply. A price decline between purchase and sale can consume the discount, so the profit is only assured if you can sell at the assumed price. If prompt selling is practical and the temporary reduction in take-home pay fits your budget, the ESPP looks worthwhile under these numbers.