How to Calculate Earnings on Excess HSA Contributions

To calculate earnings on excess HSA contributions, you use the IRS Net Income Attributable (NIA) formula: multiply the excess amount by your account’s percentage gain or loss during the period the excess was in the account. The formula is the same one Treasury Regulation 1.408-11 lays out for corrected IRA contributions, and HSA trustees are required to apply it.1Internal Revenue Service. Instructions for Forms 1099-SA and 5498-SA The result can be positive or negative. If your HSA gained value while the excess was sitting there, you withdraw the excess plus the earnings. If it lost value, you withdraw less than the original excess.

The Three Numbers You Need First

Before you can run the calculation, pull three figures from your HSA statements and transaction history.

  • The excess contribution. The exact dollar amount deposited above your annual limit. If several deposits combined to push you over, add them together. Employer contributions, payroll deductions through a cafeteria plan, and your own direct deposits all count toward the same combined cap.2Office of the Law Revision Counsel. 26 USC 223
  • The adjusted opening balance. The fair market value of the HSA at the start of the computation period (generally the beginning of the month the excess was deposited), plus every contribution or transfer into the account during the period, including the excess itself.3eCFR. 26 CFR 1.408-11 – Net Income Calculation for Returned or Recharacterized IRA Contributions
  • The adjusted closing balance. The fair market value on the date you request the corrective withdrawal, plus any distributions or transfers out of the account during the same computation period.3eCFR. 26 CFR 1.408-11 – Net Income Calculation for Returned or Recharacterized IRA Contributions

If your HSA holds investments rather than cash, the fair market value reflects current share prices on the relevant dates. Monthly statements usually show the values you need.

The NIA Formula

Net Income = Excess Contribution × (Adjusted Closing Balance − Adjusted Opening Balance) ÷ Adjusted Opening Balance3eCFR. 26 CFR 1.408-11 – Net Income Calculation for Returned or Recharacterized IRA Contributions

The fraction on the right measures how much the whole HSA grew or shrank during the computation period. Multiplying it by the excess contribution isolates the share of that change attributable to the extra deposit. The trustee will run this calculation on your behalf when you submit a return-of-excess request, but you should check the math yourself.

Worked Example: Gains

You contributed $1,000 over the limit. Your adjusted opening balance is $10,000 and your adjusted closing balance is $10,800. The account grew by $800 on a $10,000 base, so the growth fraction is 0.08. Multiply $1,000 by 0.08 and you get $80 in net income. You withdraw $1,080 total: $1,000 of principal plus $80 in attributable earnings.

Worked Example: Losses

Same $1,000 excess, but the adjusted closing balance drops to $9,500. The fraction is ($9,500 − $10,000) ÷ $10,000 = −0.05. Multiplying $1,000 by −0.05 gives −$50. The loss reduces your required withdrawal to $950. Market declines during the computation period are not penalized.3eCFR. 26 CFR 1.408-11 – Net Income Calculation for Returned or Recharacterized IRA Contributions

The Deadline That Locks In Your Calculation

The withdrawal of the excess and its NIA must happen by the due date of your federal return, including extensions, for the year the excess was contributed. For a 2025 excess, that means April 15, 2026, or October 15, 2026 with a valid extension.2Office of the Law Revision Counsel. 26 USC 223 Meeting this deadline avoids the 6% excise tax entirely. The closing balance in your NIA calculation is measured as of the date you actually request the withdrawal, so the computation period keeps running until you act.

If you filed on time but forgot to remove an excess employer contribution, you have a limited grace window of up to six months past the unextended filing deadline. Using it requires filing an amended return marked “Filed pursuant to section 301.9100-2” with an amended Form 5329 showing the excess has been removed.4Internal Revenue Service. Instructions for Form 8889

Reporting the Earnings You Just Calculated

The NIA figure you calculated flows onto your tax return as income. How the principal is treated depends on how the excess got into the account.

After-Tax Contributions

If you deposited the excess with after-tax dollars and did not deduct it, the principal is not taxable again. The NIA earnings, however, are included in your gross income for the year you receive the withdrawal, reported as “Other income” on Form 1040.2Office of the Law Revision Counsel. 26 USC 223

Pre-Tax or Employer Contributions

When the excess came through payroll under a cafeteria plan or was deposited by your employer, those dollars were never taxed. If the excess was not already included in the wages on your W-2, you report both the excess principal and the NIA earnings as “Other income” on your return for the year you withdraw them.4Internal Revenue Service. Instructions for Form 8889

Forms and Reconciliation

Report the overall HSA activity on Form 8889.4Internal Revenue Service. Instructions for Form 8889 In the calendar year after your withdrawal, the trustee will issue Form 1099-SA. Look for distribution Code 2 in Box 3, which flags the payment as a return of excess contributions, and Box 2, which shows the earnings amount.5Internal Revenue Service. Instructions for Forms 1099-SA and 5498-SA Confirm the earnings figure on the 1099-SA matches your own NIA calculation. Mismatches between your return and the 1099-SA can trigger automated IRS notices.

If You Miss the Deadline

An excess that stays in your HSA past the filing deadline (including extensions) is hit with a 6% excise tax.6Office of the Law Revision Counsel. 26 USC 4973 – Tax on Excess Contributions to Certain Tax-Favored Accounts and Annuities The 6% is not a one-time hit. It applies each year the excess remains, calculated on the lesser of the excess amount or the account’s total value at year-end.7Internal Revenue Service. Publication 969, Health Savings Accounts and Other Tax-Favored Health Plans (2025 Draft) Once you cross the deadline, the NIA formula no longer applies to the correction; you either withdraw the principal (without an earnings calculation) and keep paying the 6% until it’s out, or you absorb the excess by under-contributing in a later year so the leftover room offsets the carryover on Form 5329.8Internal Revenue Service. Instructions for Form 5329

One Situation NIA Does Not Fix

If you used the last-month rule to contribute the full annual amount and then failed the 13-month testing period by losing HSA eligibility, the amount that exceeded your pro-rated limit is added back to your income for the year you lost eligibility, plus an additional 10% tax.9Internal Revenue Service. Publication 969, Health Savings Accounts and Other Tax-Favored Health Plans That is a different mechanism from the excess contribution correction described here. The NIA formula does not apply, and pulling the money out early will not undo it.