I have had a mutual fund for several years in a taxable account and have never sold one yet. When the time comes that I sell this someday, are the taxes that I paid on the yearly dividends somehow separated so I only pay taxes on the other part of the gains?

Yes. I assume you reinvested dividends, which is what most people do. In that case, the dividends become part of the basis of your total holding, and when you finally sell, you pay taxes on the difference between the sales proceeds and your basis.

Ok, rereading that, it sounds a little confusing. Perhaps an example would be better. Suppose you buy $1000 worth of a mutual fund, and then over some number of years, collect another $200 in dividends and capital gains distributions, on which you pay taxes. Since you're reinvesting dividends, you've accumulated some number of additional shares in the fund. Your basis in all those shares is $1200 - the $1000 you originally invested, and the $200 in dividends and distributions with which you purchased those additional shares. If you sell the lot for $2000, you'll pay taxes on just the $800 gain. (A little complication: things you hold for more than a year are taxed at a lower rate than things you hold for a year or less, so you have to divide the sale into two pieces, long-term and short-term. But the sum of the two gains is still just $800.)

Announcements

Disclaimer:
In accordance with IRS Circular 230, you cannot use the contents of any post on The Motley Fool's message boards to avoid tax-related penalties under the Internal Revenue Code or applicable state or local tax law provisions.

When Life Gives You Lemons
We all have had hardships and made poor decisions. The important thing is how we respond and grow. Read the story of a Fool who started from nothing, and looks to gain everything.

Work for Fools?
Winner of the Washingtonian great places to work, and Glassdoor #1 Company to Work For 2015! Have access to all of TMF's online and email products for FREE, and be paid for your contributions to TMF! Click the link and start your Fool career.