Capital Gains Tax Calculator
Federal and state tax on a sale, short-term vs. long-term, your 0% bracket room and the 3.8% surtax.
Review a made-up brokerage account in December: sort tax lots, harvest a loss without a wash sale, wait out the one-year mark, use the 0% long-term rate, and see it all on Form 8949 and Schedule D.
Loading the simulation…
Short answer
Tax-loss harvesting means selling an investment at a loss to offset gains. Short-term and long-term results are netted, and up to $3,000 of a net loss ($1,500 married filing separately) comes off other income, with the rest carried over. Buying the same stock within 30 days before or after the sale, even in an IRA, makes it a wash sale.
Every purchase is a separate tax lot. A gain or loss is long-term if you held the investment more than one year, and short-term if one year or less. Start counting on the day after you bought; the day you sell counts. For stock traded on an exchange, use trade dates, not settlement dates.
Mutual funds pass gains realized inside the fund on to shareholders. A capital gain distribution is reported as a long-term capital gain no matter how long you've owned the shares, and it's taxable even though you didn't sell anything.
Selling an investment that's down turns a paper loss into one you can use against gains. If you identify the shares you sell, you can use the cost of those particular shares. If you don't, the shares you bought first are treated as sold first.
A loss sale is a wash sale if, within 30 days before or after it, you buy substantially identical stock or securities, including for your IRA or Roth IRA. The loss is disallowed. Usually it's added to the cost of the new shares, and their holding period includes the old one's; when the purchase is in an IRA, it isn't added. Form 8949 shows it with code W.
Short-term gains and losses are netted together, long-term gains and losses are netted together, then the two are combined on Schedule D. If the total is a loss, up to $3,000 ($1,500 if married filing separately) comes off other income each year. The rest carries over and keeps its short-term or long-term character.
Net short-term gains are taxed like wages; long-term gains get 0%, 15% or 20% rates. For 2026, the 0% rate on long-term gains applies while taxable income stays at or under $49,450 for single filers and $98,900 for married couples filing jointly. A lot a few days short of one year can sometimes wait.
For stock sold on an exchange, the holding period ends on the trade date, and a sale made on December 31 that settles in January is reported for the year of the trade. Most trades now settle one business day after the trade date.
If your capital losses are bigger than your capital gains, you can deduct the smaller of $3,000 ($1,500 if married filing separately) or your net loss against other income. Anything left carries over to later years and keeps its short-term or long-term character.
You can't deduct a loss on stock or securities if, within 30 days before or after the sale, you buy substantially identical stock or securities, get a contract or option to buy them, or buy them for your IRA or Roth IRA. The disallowed loss is usually added to the cost of the new shares, but not when the purchase is in an IRA.
Yes. Capital gain distributions are reported as long-term capital gains, no matter how long you've owned the fund shares, and they go on Schedule D, line 13.
When you've held it more than one year. Start counting on the day after you bought it; the day you sell is included. A sale on the one-year anniversary is still short-term; the next day it's long-term.
For stock traded on an exchange, the trade date decides. IRS Publication 550 gives the example of stock sold on December 31 with payment in January: the gain or loss goes on the return for the year of the sale.
The rules and the yearly brackets and thresholds are real, from IRS sources. The account, prices, wages and lots are made up, and the tax math is a simplified teaching model with no dividends, credits, state tax or surtaxes. It isn't tax or investment advice.
A simulation with made-up numbers. Real rates, fees, rules and timelines vary by state, lender and market. WealthAndWay publishes general educational information. It is not financial, tax, investment or legal advice, and reading it does not create a professional relationship. Rules and numbers change; check the linked official sources or a qualified professional before acting. Full disclaimer.
Run your real numbers
Federal and state tax on a sale, short-term vs. long-term, your 0% bracket room and the 3.8% surtax.
Profit, return and break-even price on a stock trade after commissions, plus an estimate of the tax at your own rate.
Average cost per share across up to 5 purchases, your profit or loss today, and how many shares it takes to average down to a target.