How much of my stock profit do I keep after tax?
It depends on how long you held the stock, your income and your state. Buy for $10,000, sell for $15,000 after more than a year, and as a single filer with $75,000 of taxable income in a state with a 5% tax, you would pay about $750 federal and $250 state and keep $4,000 of the $5,000 gain. Sell the same shares within a year and you keep $3,650, because short term gains are taxed like income.
Key points
- Three taxes. Federal, the 3.8% NIIT for higher earners, and state.
- Stacked. The gain sits on top of your income in the brackets.
- Example. $5,000 gain, $75,000 income: keep $4,000.
- Held a year or less. Same gain: keep $3,650.
- 0% band. Long term gains up to $49,450 taxable income, single, 2026.
- One sale only. Losses and other gains are not modeled.
2 minute lesson, optionalWhat did you really make ?Guess first, see the answer, then try it yourself. Five quick steps. You can skip it any time. Play the lessonClose the lessonOpen
Your path
Do today’s challenge, then tap Up next.
Stock calculator
Step 1 of 5
How much profit do you keep after federal tax?
Tap a guess. Wrong guesses cost nothing.
Free · No signup · 2 minutes · Revision review pending · Updated
Step 2 of 5
Next: try it yourself.
Step 3 of 5
Your turn
Drag a slider or tap an option. Watch the number change.
Type exact numbers
Quick version for learning. The full stock calculator below has every option.
Step 4 of 5
What if you changed one thing?
Tap a change to see what it does to .
Step 5 of 5
Tap an answer. You see why either way.
Lesson complete
More
Learn it in 4 short parts
Each part answers one question. Open any part. Tap Got it when you are done.
How it worksHow is tax on a stock sale worked out?
Federal tax depends on your bracket, the NIIT on your total income, and state tax on where you live.
Up to three taxes can apply to a U.S. stock gain: federal tax, the net investment income tax for higher earners, and state tax.
What does the calculator do?
- Gain = sale price − purchase price.
- Federal tax: the gain is stacked on top of your taxable income and taxed at the rates for the brackets it falls into. Long term gains use 0%, 15% or 20%; short term gains use the ordinary income rates.1
- Net investment income tax: 3.8% if your modified adjusted gross income (MAGI) goes over $200,000 single or $250,000 married filing jointly.2
- State tax: your gain × the flat rate you enter.
A $5,000 long term gain on top of $75,000 of taxable income falls in the 15% band: $750 federal. MAGI is under $200,000, so no NIIT. State: 5% × $5,000 = $250. You keep $5,000 − $1,000 = $4,000.
What is the difference between taxable income and MAGI?
Taxable income is after deductions, such as the standard deduction. MAGI is closer to your total income before deductions. The calculator asks for both because the federal brackets use taxable income and the NIIT uses MAGI.
What counts as my purchase price?
The tax is on your gain, and the gain is measured from your cost basis, not just the share price. For stock you buy, the IRS says basis is the purchase price plus extra costs such as commissions and transfer fees.4 Selling costs reduce what you receive, so they shrink the gain too.
Here is how that plays out with round numbers. You buy shares for $10,000 and pay a $10 commission, so your basis is $10,010. You sell for $15,000 and pay another $10, so you receive $14,990. Your taxable gain is $14,990 − $10,010 = $4,980, not $5,000. With commission free trading the difference is often zero, but fees on some accounts and funds still count.
Your broker reports the sale to you and the IRS on a year end tax form, and you list each sale on Form 8949 before the totals move to Schedule D.5 If the basis on that form looks wrong, fix it before you file, because it sets the gain you pay tax on.
Federal tax depends on your bracket, the NIIT on your total income, and state tax on where you live.
Marks part 1 of 4 done and opens the next one.
Income and holding timeHow do income and holding time change the tax?
Low income can mean 0% federal tax on long term gains. Selling within a year usually costs more.
The same $5,000 gain can cost anywhere from a few hundred dollars to well over a thousand in tax.
What do you keep from a $5,000 gain?
| Income and holding period | Federal rate | Total tax | You keep |
|---|---|---|---|
| $40,000, long term | 0% | $250 | $4,750 |
| $40,000, short term | 12% | $850 | $4,150 |
| $75,000, long term | 15% | $1,000 | $4,000 |
| $75,000, short term | 22% | $1,350 | $3,650 |
| $150,000, short term | 24% | $1,450 | $3,550 |
At $40,000 of taxable income, the gain falls inside the 0% federal band, which for 2026 runs to $49,450 for single filers, so only state tax is due.3
How much does holding past one year save?
Short term, the federal tax is $1,100 instead of $750 because the gain is taxed at the 22% income rate, not 15%.
What happens when a gain crosses into the next band?
Because the gain is stacked on top of your income, part of it can land in one band and the rest in the next. Each piece is taxed at its own rate, just like ordinary income brackets.
A single filer has $45,000 of taxable income and a $10,000 long term gain. For 2026 the 0% band runs to $49,450,3 so the first $4,450 of the gain is taxed at 0%. The other $5,550 falls in the 15% band: $5,550 × 15% = $832.50 of federal tax, about 8.3% of the gain.
The timing rule is strict. A gain is long term only if you held the shares for more than one year.1 Selling on the one year anniversary is still short term, which can move the same gain into the ordinary income rates. Check your purchase date before you sell anything close to that line.
Low income can mean 0% federal tax on long term gains. Selling within a year usually costs more.
Marks part 2 of 4 done and opens the next one.
What is left outWhy might my real tax bill be different?
Use this for one sale. For the full year, use tax software or a tax professional.
The estimate covers one sale. Your tax return looks at the whole year.
What does the calculator not include?
- Losses. A loss shows as $0 tax, but the calculator does not model offsetting other gains or deducting up to $3,000 of income.
- Other gains and investment income. It assumes this sale is your only one.
- Fees. Add commissions to the purchase price if you want them counted.
- Credits, AMT and local taxes. These can raise or lower the final bill.
- State rules. States differ; a flat rate is only an estimate.
See your income tax bracket. The tax bracket calculator shows how your 2026 income fills each federal bracket, so you know what rate a short term gain would face.
Open the tax bracket calculatorHow do losses lower my tax bill?
The calculator shows a loss as $0 tax, but on your return losses do real work. They first cancel out gains from the same year. If losses are larger than gains, you can deduct up to $3,000 of the extra against other income ($1,500 if married filing separately), and carry the rest forward to later years.1
Say you have an $8,000 loss and no gains this year. You deduct $3,000 now and carry $5,000 forward. Next year a $5,000 gain could be fully offset by that carried loss, leaving no tax on it.
One trap catches beginners: selling at a loss and buying the same or substantially identical shares right around the sale. That is a wash sale, and the loss is not allowed at that time; it is added to the basis of the new shares instead. IRS Publication 550 explains the timing window and the details.6
Use this for one sale. For the full year, use tax software or a tax professional.
Marks part 3 of 4 done and opens the next one.
Watch outThree mistakes to avoid, and what to do instead
Common slips and what to do instead.
- Counting the gross gain as profit Federal tax, state tax and fees come out first. The after tax number is the one you can spend.
- Selling just short of a year One more day can move the gain from ordinary income rates to lower long term rates.
- Forgetting the gain changes your bracket A large gain can push part of itself into a higher rate. Run the tax bracket calculator with the gain included.
Marks part 4 of 4 done.
Stock Profit After Tax Calculator FAQ
Tap a question to open the answer.
What does the stock calculator do, and is it free?
See what you keep after tax when you sell a stock. You enter buy price, sell price, shares, holding period and income. You get gain, estimated 2026 federal tax and take home profit. It is free to use with no signup. Keep in mind: federal estimate only. State tax and NIIT may apply.
How much tax do I pay when I sell a stock?
It depends on how long you held it, your taxable income and your state. Shares held more than a year get long term rates of 0%, 15% or 20% at the federal level. Shares held a year or less are taxed at your ordinary income rate, which runs from 10% to 37%. As a single filer with $75,000 of taxable income and a 5% state tax, a $5,000 long term gain costs about $1,000 in total.
Do I pay taxes on stocks if I don’t sell?
No, not on the rise in price. In a regular brokerage account, a gain is taxed only when you sell, so shares that went up but are still held create no capital gains tax yet. Dividends are different: they are generally taxable in the year you receive them, even if you reinvest them automatically. Trades inside an IRA or 401(k) are not taxed when they happen.
Is this stock profit after tax calculator free, and what does it include?
Yes, the calculator is free to use with no account. It estimates federal tax on one sale using the 2026 or 2025 brackets, the 3.8% net investment income tax if your MAGI is above the threshold, and state tax at the flat rate you enter. It assumes this sale is your only gain and leaves out losses from other sales, credits, AMT and local taxes, so treat the result as an estimate.
Does reinvesting the profit avoid capital gains tax?
No. This is a common misconception. In a taxable account, selling shares creates the tax whether you take the cash out or buy another stock the same day. The gain counts in the tax year of the sale. The only ways to defer tax on trades are to make them inside a tax advantaged account such as an IRA or 401(k), or to keep holding the shares.
Show 4 more questionsShow fewer questions
How long do I have to hold a stock to pay less tax?
More than one year. The IRS treats a gain as long term only when you held the asset for more than a year, so selling on the exact anniversary still counts as short term. Long term gains get the lower 0%, 15% or 20% federal rates. In this calculator’s default example, holding past a year turns $3,650 of take home profit into $4,000, because the rate drops from 22% to 15%.
What is the 0% capital gains rate for 2026?
For 2026, single filers pay 0% federal tax on long term gains while their taxable income, including the gain, stays at or below $49,450, according to the IRS inflation adjusted figures. The gain stacks on top of your other taxable income, so only the part that fits under the line gets 0%. A single filer with $40,000 of taxable income can take a $9,450 long term gain at 0%. State tax may still apply.
Who pays the 3.8% net investment income tax?
Higher earners whose modified adjusted gross income is above $200,000 single or $250,000 married filing jointly. The tax is 3.8% of the smaller of your net investment income or the amount your MAGI is over the threshold. In the calculator’s higher income example, MAGI of $230,000 is $30,000 over the line, so the full $5,000 gain is subject to the extra 3.8%, adding $190.
Can I deduct a loss on a stock?
Yes. Losses first offset capital gains from the same year. If you still have a net loss, you can deduct up to $3,000 against other income, or $1,500 if married filing separately, and carry any remaining loss forward to future years. Watch the wash sale rule: if you buy the same or substantially identical shares around the time you sell at a loss, the loss is deferred instead.
What should I do next?
Pick the step that fits what you just did.
Who checks this page, and the sources
Real people check the numbers and the wording. Every source is listed.
- Updated
- Sources listed below
- Education, not advice
- Review of this update in progress
Sources and methodEvery source used on this page, how the tool works and the page history.
- IRS Topic No. 409, Capital gains and losses. Short and long term rates and the loss rules.
- IRS Topic No. 559, Net investment income tax. The 3.8% rate and the MAGI thresholds.
- IRS: Inflation adjusted tax items by tax year. The 2026 brackets and capital gains thresholds.
- IRS Topic No. 703, Basis of assets. Your cost basis in stock is the purchase price plus costs such as commissions.
- IRS: About Form 8949, Sales and other dispositions of capital assets. Where each sale is reported and checked against your broker’s form before Schedule D.
- IRS Publication 550, Investment income and expenses. The full rules on holding periods, wash sales and capital gains and losses.
Method: gain = sale price − purchase price. Federal tax is the increase in tax from stacking a positive gain above the taxable ordinary income entered, using the selected year’s brackets and long or short term rates. NIIT is 3.8% of the lesser of the gain and MAGI above the filing status threshold, assuming this sale is the only net investment income. State tax is the gain × the flat rate entered. Losses, other gains, deductions, credits and AMT are excluded. Every figure on this page came from this calculator on October 15, 2026. All amounts are in U.S. dollars.
Page history. November 27, 2026: page simplified into numbered sections, missing tables restored and the questions reordered. The tool itself has not changed. October 21, 2026: content expanded, sources added and the page reviewed by Associate Professor Charles Lo, CPA, PhD. The tool itself has not changed.
StockEducation provides general education, not personal financial, tax or legal advice. Results are illustrations based on the assumptions you enter, not forecasts or promises of any return. Investing involves risk, including the loss of money you invest.
