How to Calculate Capital Gains on a Mutual Fund Sale

To calculate the capital gain on a mutual fund sale, subtract your adjusted cost basis from your net sale proceeds. A positive result is a gain; a negative one is a loss. The subtraction is simple. Getting the two numbers right is where the work lives, especially if you’ve reinvested distributions, paid a sales load, or sold only part of your position.

Start With Your Cost Basis

Cost basis begins with what you paid for the shares, including any front-end sales load charged at purchase.1U.S. Securities and Exchange Commission. Front-end Sales Load Put $10,000 into a fund with a 4% load and only $9,600 buys shares, but your basis is the full $10,000 because that’s what you spent to acquire the position. Federal law defines basis as the cost of the property, and those transaction charges are part of the cost.2Office of the Law Revision Counsel. 26 U.S. Code 1012 – Basis of Property

Reinvested distributions are where most people slip up. When your fund pays dividends or capital gain distributions and you reinvest them, those amounts buy new shares, and you already owe tax on them in the year they’re paid because they appear on Form 1099-DIV.3Internal Revenue Service. Instructions for Form 1099-DIV (01/2024) Every reinvestment increases your basis. Forget to add them, and you’ll pay tax on the same income twice: once as a distribution, again as gain at sale.

Return-of-capital distributions work the opposite way. They aren’t taxed when received, but they lower your basis dollar for dollar. Your fund company’s year-end statements and 1099s break out which distributions were ordinary dividends, capital gains, and return of capital. Save those records; they’re what makes the calculation possible years later.

Decide Which Shares You Sold

If you sell only part of your holding, the IRS needs to know which shares went out the door, because different lots were bought at different prices on different dates. Three methods are available:

  • Average cost. Add the total cost of every share you own in the fund and divide by share count. Every share carries the same per-share basis. Most brokerages default to this method for mutual funds, and the IRS permits it for fund shares and stock acquired through dividend reinvestment plans. Simple, but you lose control over which lots are sold.4Internal Revenue Service. Mutual Funds (Costs, Distributions, etc.)
  • First-in, first-out (FIFO). The oldest shares are treated as sold first. In a fund that has appreciated steadily, FIFO tends to produce the largest gain because the earliest shares have the lowest basis.
  • Specific identification. You tell the broker at the time of the trade exactly which lots to sell. Selling high-basis lots first shrinks the taxable gain; selecting lots held more than a year locks in long-term rates. The designation has to be made before or at the time of the sale, and the broker must confirm it.5eCFR. 26 CFR 1.1012-1 – Basis of Property

Once you’ve used a method for a particular account, switching generally applies only to future sales, not past ones. If specific identification matters to you, set the preference with your broker before placing the trade.

Figure Your Net Proceeds

Gross proceeds are the market value of the shares at sale. Subtract any transaction costs, including a contingent deferred sales charge (back-end load) if the fund charges one. Your broker reports the final figure in Box 1d of Form 1099-B, and the form’s instructions require commissions and transfer taxes to already be netted out.6Internal Revenue Service. Instructions for Form 1099-B (2026) Compare that number against your own records before you file. The IRS gets the same copy, and mismatches trigger notices.

Do the Subtraction

Net proceeds minus adjusted cost basis equals your capital gain or loss.7Internal Revenue Service. Topic No. 409, Capital Gains and Losses Say you sold 200 shares for net proceeds of $12,000, and your average cost basis for those shares, including reinvested distributions and the original load, was $8,500. Your capital gain is $3,500.

Report the individual transactions on Form 8949, then summarize them on Schedule D of your Form 1040. Short-term transactions go in Part I of Schedule D; long-term transactions in Part II.7Internal Revenue Service. Topic No. 409, Capital Gains and Losses

Which Rate Applies

Holding period sets the rate. Shares held one year or less produce a short-term capital gain, taxed at your ordinary income rate.8Office of the Law Revision Counsel. 26 U.S. Code 1222 – Other Terms Relating to Capital Gains and Losses For 2026, ordinary rates run from 10% to 37%. Shares held more than one year qualify for long-term rates, which are meaningfully lower.

The 2026 long-term capital gains brackets for single filers:

  • 0% on taxable income up to $49,450
  • 15% on taxable income from $49,451 to $545,500
  • 20% on taxable income above $545,500

For married couples filing jointly, the 15% rate begins above $98,900 and the 20% rate above $613,700.9Tax Foundation. 2026 Tax Brackets and Federal Income Tax Rates The holding period runs from the day after you acquired the shares through the sale date. Missing the one-year mark by one day pushes the entire gain into ordinary-rate territory.

If you use average cost, the broker assigns the holding period by FIFO order. All your shares share the same per-share basis, but the oldest are treated as sold first for the short-vs-long determination.

The 3.8% Surtax for Higher Earners

Above certain income levels, capital gains from mutual fund sales pick up an additional 3.8% Net Investment Income Tax. It applies to the lesser of your net investment income or the amount by which your modified adjusted gross income exceeds the threshold for your filing status.10Office of the Law Revision Counsel. 26 U.S. Code 1411 – Imposition of Tax

The thresholds: $200,000 for single filers, $250,000 for married filing jointly, and $125,000 for married filing separately.11Internal Revenue Service. Topic No. 559, Net Investment Income Tax They aren’t adjusted for inflation, so more taxpayers cross them each year. A single large fund sale can push you over, and the 3.8% sits on top of whatever capital gains rate already applies.

When the Result Is a Loss

If basis exceeds proceeds, you have a capital loss. Losses first offset gains of the same type: short-term against short-term, long-term against long-term. Any leftover then offsets gains of the other type.

If a net loss remains, you can deduct up to $3,000 against ordinary income for the year, or $1,500 if you’re married filing separately.12Office of the Law Revision Counsel. 26 U.S. Code 1211 – Limitation on Capital Losses Anything beyond that carries forward indefinitely, keeping its short-term or long-term character.13Office of the Law Revision Counsel. 26 U.S. Code 1212 – Capital Loss Carrybacks and Carryovers A large loss can offset gains for years.

Watch the Wash Sale Rule if You’re Harvesting a Loss

Sell fund shares at a loss and buy substantially identical shares within 30 days before or after the sale, and the IRS disallows the loss. The window covers 61 days total: 30 before the sale, the sale date, and 30 after.14Office of the Law Revision Counsel. 26 U.S. Code 1091 – Loss From Wash Sales of Stock or Securities

The disallowed loss isn’t gone. It gets added to the basis of the replacement shares and comes back to you when you sell those without triggering another wash sale. Sell at a $1,000 loss and repurchase for $5,000 inside the window, and your new basis is $6,000. Brokers report the adjustment in Box 1g of Form 1099-B.

Automatic dividend reinvestment can trip this rule on its own. If your fund reinvests a distribution inside the 30-day window after you sell at a loss, the IRS treats it as a repurchase. Turn off reinvestment before the sale or wait the full 31 days before buying back in.

A Few Situations That Change the Math

Some gains show up without a sale. When a fund manager sells profitable holdings inside the fund, the resulting capital gain distributions pass through to shareholders. They appear in Box 2a of Form 1099-DIV and are taxable in the year they’re paid, whether you took cash or reinvested.15Internal Revenue Service. Mutual Funds (Costs, Distributions, etc.) 4 These are treated as long-term regardless of how long you’ve held the fund, and any amount you reinvested adds to your basis.

Inherited shares get a stepped-up basis to fair market value on the date of death.16Office of the Law Revision Counsel. 26 U.S. Code 1014 – Basis of Property Acquired From a Decedent Shares bought decades ago for $10,000 and worth $80,000 at death give you an $80,000 basis; the lifetime appreciation escapes capital gains tax. Inherited shares are also automatically treated as long-term, whatever the actual holding period.17Office of the Law Revision Counsel. 26 U.S. Code 1223 – Holding Period of Property Document the fair market value at death; without records the IRS can argue for a basis of zero.

State tax stacks on top of the federal number. Most states tax capital gains as ordinary income, with rates ranging from zero in the nine states without an income tax to roughly 13% or more in the highest-tax states. A few offer preferential treatment for long-term gains; most don’t. Add your state’s rate into the calculation before you decide whether to sell or how far to push loss harvesting.