Capital Gains Tax Calculator Spreadsheet 2026
Calculate your capital gains tax before selling investments. Model short-term vs long-term gains, tax-loss harvesting, and net tax liability for 2026.
Download
Capital Gains Tax Calculator Spreadsheet 2026
Download for Excel (.xlsx)Free. No signup. Works offline in Microsoft Excel, Apple Numbers, and LibreOffice Calc.
Before you sell an investment, you should know exactly how much of the proceeds you will keep. The difference between a long-term gain taxed at 0% and a short-term gain taxed at 37% — on the same stock, bought and sold by the same person — can be tens of thousands of dollars. The only variable that changed is the holding period. Hold for 364 days and the gain is taxed as ordinary income. Hold for 366 days and it is taxed at the preferential long-term capital gains rate, which for most taxpayers is 15%.
This is not an obscure tax optimisation. It is a fundamental binary that determines whether you keep 63 cents or 85 cents of every dollar of profit. Yet many investors sell positions without checking their holding period, estimating their tax bracket, or modelling the tax impact — then experience sticker shock at filing time.
This spreadsheet models the tax impact before you sell. Enter the purchase date, purchase price, sale date, sale price, and your total taxable income, and the calculator shows whether the gain is short-term or long-term, the applicable tax rate based on your income, the federal tax owed on the gain, the net proceeds after tax, and a comparison showing the tax impact of selling now versus waiting for the long-term holding period.
Disclaimer: This calculator is provided for informational and educational purposes only. It does not constitute tax or investment advice. Capital gains tax rules are complex and vary by circumstance. Consult a qualified tax professional before making investment decisions with tax implications. SpreadsheetTemplates.info is not responsible for decisions made based on the information provided.
2026 Capital Gains Tax Rates
Capital gains are taxed differently based on how long you held the asset.
Short-Term Capital Gains
Gains on assets held for one year or less are taxed as ordinary income — at your marginal federal tax rate (10%, 12%, 22%, 24%, 32%, 35%, or 37% in 2026, depending on your total taxable income and filing status). There is no preferential rate for short-term gains. They are simply added to your other income and taxed accordingly.
Long-Term Capital Gains
Gains on assets held for more than one year receive preferential rates that are significantly lower than ordinary income rates for most taxpayers:
0% rate applies to single filers with taxable income up to approximately $48,350 and joint filers up to approximately $96,700. This means taxpayers in the lowest brackets pay no federal tax on long-term capital gains — a powerful benefit for those in early career, in retirement with low taxable income, or strategically managing income to stay within this threshold.
15% rate applies to single filers with income from approximately $48,351 to $533,400 and joint filers from approximately $96,701 to $600,050. This is the rate most investors pay — and it represents a substantial discount compared to the ordinary income rate they would pay on the same gain if held short-term.
20% rate applies to single filers above approximately $533,400 and joint filers above $600,050. Even at the top tier, the 20% rate is nearly half the top ordinary income rate of 37%.
Net Investment Income Tax (NIIT)
An additional 3.8% surtax applies to net investment income (including capital gains) for individuals with modified AGI above $200,000 (single) or $250,000 (joint). This effectively increases the top long-term rate to 23.8% and the maximum short-term rate to 40.8% for high-income investors. The spreadsheet includes the NIIT calculation automatically when your income exceeds the threshold.
Short-Term vs Long-Term: The Tax Impact
| Scenario | Taxable Income (Single) | Holding Period | Gain | Tax Rate | Federal Tax on Gain | Net Proceeds |
|---|---|---|---|---|---|---|
| Low income, long-term | $40,000 | 13 months | $10,000 | 0% | $0 | $10,000 |
| Low income, short-term | $40,000 | 11 months | $10,000 | 12% | $1,200 | $8,800 |
| Middle income, long-term | $100,000 | 13 months | $10,000 | 15% | $1,500 | $8,500 |
| Middle income, short-term | $100,000 | 11 months | $10,000 | 24% | $2,400 | $7,600 |
| High income, long-term | $550,000 | 13 months | $10,000 | 20% + 3.8% NIIT | $2,380 | $7,620 |
| High income, short-term | $550,000 | 11 months | $10,000 | 37% + 3.8% NIIT | $4,080 | $5,920 |
The table makes the case clearly: in every income bracket, long-term treatment produces significantly lower tax — and the gap widens at higher incomes. A high-income investor keeping a position for two extra months (from 11 to 13 months) on a $10,000 gain saves $1,700 in federal tax. On a $100,000 gain, the savings would be $17,000.
What the Spreadsheet Calculates
Per-Sale Analysis
For each investment sale, you enter the purchase date, the purchase price per share (or total cost basis), the number of shares, the planned or actual sale date, the expected or actual sale price per share, and your total taxable income for the year (from all sources, not just investment income).
The spreadsheet calculates the total cost basis, the total sale proceeds, the gain or loss (proceeds minus cost basis), the holding period (short-term or long-term, calculated from dates), the applicable tax rate (based on your income bracket and holding period), the federal tax on the gain, any applicable NIIT, total tax, and net after-tax proceeds.
Multi-Sale Portfolio View
For investors selling multiple positions in the same year, the spreadsheet aggregates all sales into a portfolio-level tax summary: total short-term gains, total long-term gains, total short-term losses, total long-term losses, and net gains after loss offsets. Short-term losses offset short-term gains first, then long-term gains. Long-term losses offset long-term gains first, then short-term gains. If net losses exceed net gains, up to $3,000 of excess loss can be deducted against ordinary income, with the remainder carried forward to future years.
Tax-Loss Harvesting Scenario
The most powerful feature for active portfolio management: the tax-loss harvesting simulator. You identify positions with unrealised losses and model the tax impact of selling them alongside your planned gain-producing sales. The simulator shows the net tax liability after harvested losses offset planned gains, the dollar amount of tax saved by harvesting, and whether the $3,000 ordinary income deduction is triggered.
Tax-loss harvesting is the closest thing to a free lunch in tax planning — realising losses to offset gains reduces your current tax bill without changing your long-term investment strategy (you can reinvest in a similar but not “substantially identical” holding to maintain market exposure while capturing the tax benefit). The spreadsheet makes the maths concrete so you can see exactly how much each harvested loss saves.
For a broader view of your tax picture including income tax and self-employment tax alongside capital gains, see our tax estimator spreadsheet. For rebalancing your portfolio in a tax-efficient manner, see our portfolio allocation spreadsheet. And for modelling how capital gains taxes affect your dividend income, see our dividend portfolio tracker.
Sell Now vs Wait Comparison
A scenario tab compares the tax impact of selling immediately (potentially at short-term rates) versus waiting until the position qualifies for long-term treatment. The comparison accounts for the tax rate difference, the opportunity cost of holding the position for additional months (what if the stock declines during the waiting period?), and the break-even point — how much the stock would need to decline before the tax savings of waiting are erased.
For example: if waiting two months saves $1,700 in taxes on a $10,000 gain, the stock would need to decline by more than 17% during those two months before selling now becomes the better option. Since 17% declines in two months are uncommon, waiting is almost always the correct choice when the holding period is close to the one-year mark.
Download: Capital Gains Tax Calculator 2026 — Excel (.xlsx)
Frequently Asked Questions
What is the wash sale rule?
If you sell an investment at a loss and repurchase a “substantially identical” security within 30 days (before or after the sale), the loss is disallowed under the wash sale rule. The disallowed loss is added to the cost basis of the replacement shares, deferring (not eliminating) the tax benefit. To harvest a loss without triggering a wash sale, wait 31 days before repurchasing, or buy a similar but not identical fund (e.g., sell an S&P 500 fund and buy a total market fund).
How do I determine my cost basis if I bought shares at different prices?
Most brokerages track cost basis and allow you to select a method: FIFO (first in, first out — sells the oldest shares first), LIFO (last in, first out), specific identification (you choose which shares to sell), or average cost (only for mutual funds). Specific identification gives you the most control — you can choose to sell the highest-cost shares to minimise the gain, or the lowest-cost shares if you want to realise gains at a favourable rate.
Do capital gains affect my other tax obligations?
Yes. Capital gains increase your AGI, which can trigger or increase the Net Investment Income Tax, reduce eligibility for income-based deductions and credits, increase Medicare Part B and D premiums (IRMAA) based on AGI from two years prior, and affect ACA marketplace subsidy eligibility. The spreadsheet models the NIIT impact directly; for other AGI-sensitive effects, see our tax estimator.
Are there capital gains taxes on cryptocurrency?
Yes. The IRS treats cryptocurrency as property, subject to the same capital gains rules as stocks. Short-term crypto gains (held one year or less) are taxed as ordinary income. Long-term crypto gains (held more than one year) receive preferential rates. The spreadsheet handles crypto sales the same way as stock sales — enter the purchase and sale details and the calculator determines the tax.
Can I offset capital gains with capital losses from previous years?
Yes. Capital loss carryforwards from prior years can offset current-year capital gains. If you had $10,000 in net capital losses last year and deducted $3,000 against ordinary income, you carry forward $7,000 to this year. That $7,000 offsets $7,000 of current-year gains before any tax is owed. The spreadsheet includes a carryforward input field for prior-year losses.
How do capital gains taxes work on real estate?
The primary residence exclusion allows individuals to exclude up to $250,000 ($500,000 for joint filers) of gain on the sale of a primary residence if they have lived in the home for at least two of the past five years. Gains above the exclusion, and all gains on investment properties, are subject to capital gains tax. Investment property sales may also trigger depreciation recapture tax at 25% on the previously claimed depreciation. Real estate capital gains are complex — consult a tax professional for property-specific guidance.
Should I harvest losses at year-end even if I do not have gains to offset?
Yes, if you have positions with unrealised losses. Even without current gains, harvested losses provide up to $3,000 in ordinary income deduction per year and carry forward indefinitely to offset future gains. The only cost is the effort of executing the sale and reinvesting in a non-identical replacement — a small price for a permanent tax benefit.
Download
Capital Gains Tax Calculator Spreadsheet 2026
Download for Excel (.xlsx)Free. No signup. Works offline in Microsoft Excel, Apple Numbers, and LibreOffice Calc.