How this capital gains tax calculator works
Enter what you paid, what you sold for, how long you owned it, your other income, and where you live. The calculator figures your 2026 tax twice, once with the sale and once without, and reports the difference as the tax on the sale. It works this way because a gain doesn’t have its own tax rate. It stacks on top of everything else you earned that year.
The formula
Gain = sale price − selling costs − cost basis
Tax on the sale = tax with the gain − tax without it (federal + 3.8% NIIT + state)
Example: a single filer with $60,000 of salary has $43,900 of taxable income after the $16,100 standard deduction. A $20,000 long-term gain sits on top, running from $43,900 to $63,900. The first $5,550 of the gain fits under the $49,450 ceiling for the 0% rate; the remaining $14,450 is taxed at 15%. The federal tax on the gain is $2,167.50, an effective rate under 11%. Sold short-term, the same gain would be taxed at 12% and 22%, costing $3,750.
Reading the income tower
The tower is your income for the year. At the bottom is the slice your standard deduction shelters from tax, then your other income, then the gain on top. The colored bands behind it are the tax zones. Any piece of the gain inside the green band pays 0%, gold pays 15%, and orange pays 20%. A dashed red line marks where the 3.8% net investment income tax begins.
Ways to lower capital gains tax
- Hold for more than a year. Past the one-year mark, the gain moves from ordinary rates (up to 37%) to the long-term rates of 0%, 15% or 20%.
- Time sales for lower-income years. In early retirement or a sabbatical year, more of a gain can land in the 0% zone.
- Harvest losses. Selling losing investments offsets gains, and up to $3,000 of extra losses offsets other income.
- Give appreciated assets. Donating stock you’ve held over a year to charity means no one pays tax on the gain. Heirs who inherit assets get a stepped-up cost basis, which wipes out the gain built up during your lifetime.
Not included: the 25% rate on depreciation recapture from real estate, the 28% rate on collectibles, the home-sale exclusion, and the alternative minimum tax.