In theory, when you sell stocks or mutual fund shares, calculating your gain or loss for tax purposes is simple: It’s the difference between the sale price and your cost basis. In practice, however, it can get complicated. That’s because many people buy multiple shares of the same investments over time at different prices — for example, through an automatic dividend reinvestment plan or a dollar cost averaging strategy.
Complicating things further, the tax implications of a sale depend on how long you’ve held an investment. Securities held for more than one year generate long-term capital gains, taxed at 0%, 15% or 20%, depending on your tax bracket. Gains on securities held for one year or less are taxed at ordinary income tax rates as high as 37%.
What are the tax implications?
Suppose Steve buys 1,000 shares of a company for $10 per share ($10,000 total) in January 2021, buys another 1,000 shares in January 2025 for $25 per share ($25,000 total) and another 500 shares in January 2026 for $28 per share ($14,000 total).
In July 2026, he sells 500 shares for $36 per share ($18,000 total). For purposes of this example, assume that Steve paid no commissions or fees on his purchases and that he’s in the 32% tax bracket (with a 15% long-term capital gain rate).
Steve’s basis in the shares, and therefore the amount of taxable capital gain, depends on which shares are being sold. For example:
- If Steve sells 500 shares from the block purchased in January 2021, his basis is $5,000 (500 x $10) and his capital gain is $13,000 ($18,000 – $5,000), resulting in a tax of $1,950 (15% x $13,000).
- If Steve sells 500 shares from the block purchased in January 2025, his basis is $12,500 (500 x $25) and his capital gain is $5,500 ($18,000 – $12,500), so the tax is $825 (15% x $5,500).
- If Steve sells 500 shares from the block purchased in January 2026, his basis is $14,000 (500 x $28) and his capital gain is $4,000 ($18,000 – $14,000). In this scenario, however, Steve’s capital gain is short-term, which is subject to his ordinary income tax rate. So, the tax is $1,280 (32% x 4,000).
In this example, selling shares purchased in January 2025 results in the lowest tax bill. (Note: This example doesn’t consider the net investment income tax or any potential state tax.)
How do you determine your basis?
Your cost basis in a stock or mutual fund is what you paid for it, including commissions, “loads” and other fees. It may be adjusted over time to reflect events that affect basis, such as mergers, stock splits or wash sales.
If you buy shares of the same investment at different prices, the method of determining your basis when you sell has a big impact on your tax bill. For stocks, the IRS recognizes two methods:
1. First-in first-out (FIFO). FIFO assumes the first shares purchased are the first sold. It offers simplicity, but if share values rise over time, as in our example, it results in the largest tax bill because the older shares have a lower basis.
2. Specific identification. Under this method, you specify which shares are sold. It requires meticulous recordkeeping, but it gives you the greatest flexibility to time the realization of gains and losses to achieve the best tax result.
For mutual funds, there’s a third option: average cost, which is the total cost of all your shares divided by the total number of shares. Typically, this method results in a tax that falls between FIFO and specific identification.
The average cost method can simplify the basis calculation and help distribute your tax liability evenly over time. Keep in mind, however, that once you use this method, your basis in all existing shares is locked in.
What’s the right method for you?
Most brokers apply FIFO by default unless you instruct them otherwise. FIFO often results in higher tax bills up front. If tax deferral is your goal, specific identification provides the greatest control over the tax consequences. When determining which shares to sell, keep in mind that selling the highest-cost shares minimizes gains, but if you acquired them within the last year, those gains will be short-term capital gains. To decide which shares to sell, you’ll typically need to weigh the impact of smaller gains taxed at a higher rate against larger gains taxed at a lower rate.
It’s also important to consider your tax circumstances. Often, the best strategy is to minimize taxable capital gains, but in some situations, you may want to do the opposite. For example, if you’re looking to harvest capital gains to offset capital losses realized during the year, you’re better off selling the lowest-basis shares first. Your tax advisor can help determine the optimal approach for your circumstances.
Customized basis approaches
While the specific identification method offers the greatest control over the timing of gains and losses, it involves a bit of legwork. To simplify things, many brokers offer customized approaches, which essentially are standing orders under the specific identification method. Examples include last-in, first-out (LIFO), highest-cost, first-out, or an approach that relies on an algorithm to optimize share selection based on cost basis and holding period. Even if you choose one of these approaches, it’s a good idea to review each potential sale to ensure it achieves your tax objectives.
Latest News
On June 9, the IRS released Announcement 2022-13, which modifies Notice 2022-3, by revising the optional standard mileage ...
At the tail end of 2021, the Internal Revenue Service (IRS) released new Schedules K-2 and K-3 effective ...
This information is current as of Sunday, November 21, 2021. On Friday, November 19, 2021, after the Congressional ...
HM&M Updates
Dallas, TX – Aug. 7, 2024 – HM&M, a Springline company (HM&M), a leading CPA firm with four ...
DALLAS, Dec. 11, 2024 – Springline Advisory, a trailblazing financial and business advisory firm, is proud to announce its partnership ...
Last month, Senior Manager, Pearl Balsara was invited to speak at the 2023 FPA DFW Annual Conference in ...

