Question on HSA Excess contribution and how to calculate "Earnings On Excess"

Hi,

When I opened my HSA in January, I noticed the option to contribute to the prior year's contribution limit. This is my first job out of college, and I wasn’t covered under my company’s health plan in 2024. Since it was my first time having an HSA, I wasn't familiar with the tax implications and rules, so I maxed out the 2024 contribution limit, totaling $4,150. However, after doing some research, I learned that I’m not allowed to do this because my HDHP started only in January 2025. 

 

Now, I have $4,150 in excess contributions, which are invested in an S&P 500 ETF. I want to know the best way to report this. Should I sell the ETF and withdraw the $4,150? I’ve also heard that I need to calculate the earnings made on that money—how do I go about doing that?

 

Thanks,