Stock tax calculator
Stock tax calculator: type what you paid, what you sold for and the two dates, and the calculator below works out the tax on the gain. The dates carry the whole story, because one year of holding separates the ordinary rates from the 0/15/20 long-term schedule.
A stock held a year or less sells short-term and the gain rides your ordinary brackets at up to 37%. Held longer, the gain stacks above your other income and splits across the 0%, 15% and 20% bands. On the worked example below, the same gain pays almost double when the sale happens seven months in instead of three years.
How it works
The one-year line, the wash sale rule, the rest
Long-term means held more than one year, and the count excludes both the purchase day and the sale day. A sale on the first anniversary of the purchase has been held exactly one year, so it is short-term. IRS Publication 550 states the rule in those words.
The long-term gain does not replace your income; it stacks on top of it. The federal return fills the ordinary brackets with wages first, then splits the gain: the part below the zero breakpoint pays nothing, the middle pays 15%, the top pays 20%. For 2026 a single filer's zero breakpoint sits at $49,450 of taxable income and the 15 percent band runs to $545,500.
Sell a stock at a loss and buy the same stock within 30 days before or after the sale and the wash sale rule bites. Under IRC section 1091 the loss is disallowed and folded into the cost basis of the new shares, so it is not gone, only parked. The rule covers stocks and securities, and the IRS has not extended it to crypto. Import your broker's trade history and the calculator checks every loss sale against the purchases around it and flags each wash sale it finds; it leaves the numbers for you to adjust.
Dividends are not capital gains. They are income of their own kind, taxed on their own rules, and this calculator does not model them. Only sales belong here, and each imported lot carries its own purchase date, so the one-year test runs per lot, not per ticker.
Worked example
Same $60,000 gain: $5,317.50 long, $10,650 short
Two identical sales of the same stock. In each you buy $25,000 and sell for $85,000, a gain of $60,000, with wages of $41,000 and single filing. The only difference is the purchase date: March 2023 in one, September 2025 in the other, against an April 2026 sale.
Held 37 months, the gain is long-term. Wages after the standard deduction come to $24,900, leaving $24,550 of room under the $49,450 zero breakpoint. The first $24,550 of the gain pays nothing; the remaining $35,450 pays 15%: $5,317.50. Income stays far under the $200,000 net investment income tax threshold, so the total is $5,317.50, an effective 8.9% on the gain.
Held 7 months, the same gain is short-term and rides the ordinary brackets: $25,500 fills the 12 percent band and $34,500 lands in the 22% band. Tax on the gain: $10,650, an effective 17.75%. The one-year line is worth $5,332.50 on this one sale.
One $60,000 stock gain dated two ways, 2026, single filer
| Held 37 months | Held 7 months | |
|---|---|---|
| Capital gain | $60,000 | $60,000 |
| Gain at 0% | $24,550 | $0 |
| Gain at 15% | $35,450 | $0 |
| Gain at ordinary rates, 12% and 22% | $0 | $60,000 |
| Tax on the gain | $5,317.50 | $10,650 |
What else moves the bill
Details that change a stock year
- Losses net before anything is taxed. Gains and losses net within their own character first, then against each other. A net loss deducts up to $3,000 a year against ordinary income, $1,500 married filing separately, and the rest carries forward split by character.
- Fees count on both sides. Commissions on the way in join the basis; fees on the way out come off the proceeds.
- Every lot carries its own dates. An import that blends three purchase lots into one average holding period gets the test wrong; the calculator matches each sale to its own lots and applies the year line per lot.
- High earners pay the 3.8% net investment income tax on top, once modified adjusted gross income passes $200,000 single or $250,000 joint.
- State tax joins the federal figures when you pick a state. Most states treat the gain as ordinary income on their own brackets.
Questions
Frequently asked questions
How are stocks taxed in the United States?
By holding period and income. Held over one year, the gain takes the 0/15/20 schedule stacked on your taxable income. Held a year or less, it is ordinary income at up to 37%.
How long do I have to hold a stock for the long-term rate?
More than one year, excluding both the purchase day and the sale day. A sale on the first anniversary is short-term; the clock finishes the next day.
What is a wash sale?
Selling a stock at a loss and buying the same stock within 30 days before or after. The loss is disallowed and folded into the cost basis of the new shares. Imported trade history is checked for the pattern and each wash sale is flagged in the checklist; the calculator leaves the numbers for you to adjust.
Are dividends capital gains?
No. Dividends are income of their own kind, with their own rules, and this calculator does not model them. Enter sales here, not dividend income.
Can stock losses reduce the tax on my wages?
Only a little, and only federally. Losses offset gains first; a net capital loss then deducts up to $3,000 a year against ordinary income, and the remainder carries forward.
Does the calculator handle stock sales in different years?
Yes. Each return covers one tax year, sales dated outside it are flagged rather than re-dated, and capital loss carryovers move between years.
Sources
Where these figures come from
Also on capitalgainstax.net