Introduction
Selling stock for more than you paid for it can create a tax bill. How much you have to pay depends on how long you owned the stock, your taxable income and your filing status. This is not a percentage that applies to every sale. The U.S. Tax code handles short-term and long-term stock gains in different ways and your other income decides which rate group your gain is in. Below you will find a tool to estimate your tax on stock gains along, with an explanation of how the calculation works what counts as your cost basis and how capital losses or the Net Investment Income Tax can affect your result.
Quick Answer
The tax on stock gains is based on how you own the stock and how much money you make. If you own the stock for one year or less you pay a short term capital gain tax, which’s the same as your regular federal income tax rate this can be anywhere from 10% to 37%. If you own the stock for, than one year you pay a long term capital gain tax, which has a lower rate of 0%, 15% or 20% and this depends on your taxable income and your filing status. Some people who make a lot of money may also have to pay a 3.8% tax, which is called the Net Investment Income Tax on their stock gains.
What Is Tax on Stock Gains?
When you sell a stock for more, than what you paid for it you usually make a capital gain, which could be taxed by the government (and maybe also by your state). Two ideas are important here:
Unrealized gain — your stock’s value has increased, but you still own it. This is not taxed.
Realized gain —You sold the stock for more than what you paid for it after making some adjustments. The stock is the thing that might have taxes owed on it because you made a profit. This profit is what may be subject to capital gains tax, on the stock.
You only have to pay taxes on the money you actually make from selling something, like a stock. Just because a stock is worth money now does not mean you have to pay taxes on it. You have to sell the stock. When you sell the stock and get the money that is when you have to pay taxes on the stock. The stock has to be sold for you to have to pay taxes on the money you made from the stock.
How to Use the Stock Gains Tax Calculator
- Enter the price that you first paid for each share (your cost basis) and the total number of shares you had.
- Enter the price that you got when you sold the stock for each share.
- Enter how months or years you kept the stock to find out if its considered short-term or long-term.
- Choose your filing status.
- Enter the money you made that is taxable because it helps to know which capital gains tax bracket your profit falls into.
- Enter any capital losses you want to use to reduce the gain if allowed.
- Check your estimated capital gain the tax rate that applies and how tax you are likely to owe.
Calculator Inputs
| Input | Explanation |
| Purchase Price / Cost Basis | What you originally paid per share, including reinvested dividends or adjustments where applicable |
| Sale Price | What you received per share when you sold |
| Number of Shares | How many shares were sold |
| Holding Period | How long you owned the stock — determines short-term vs. long-term treatment |
| Filing Status | Single, married filing jointly, married filing separately, or head of household |
| Other Taxable Income | Your income outside the stock sale, used to determine your applicable capital gains bracket |
| Capital Losses | Eligible losses that can offset some or all of the gain, if supported |
Only the fields your specific calculator actually asks for apply — if state tax or capital-loss carryovers aren’t offered as inputs, treat the result as a federal-only estimate.
Short-Term vs. Long-Term Capital Gains
This is the single biggest factor in how much tax you’ll pay.
Short-term capital gains apply to stock held one year or less. The money you gain from this is taxed like the money you earn from your job. You pay tax on these gains at the rates as your salary. The rates are 10 percent, 12 percent, 22 percent, 24 percent, 32 percent, 35 percent or 37 percent. The rate you pay depends on how money you earn in total.
Long-term capital gains apply to stock held more than one year. These gains get tax rates of 0%, 15% or 20%. These rates are usually lower than the tax rates for income.
If you sell something you own for than a year you get a better tax rate.. If you sell it even a few days too soon the tax rate goes up a lot. So you need to make sure you have the dates, for when you bought and sold something. Check the dates you bought and sold the investment carefully.
Capital Gains Tax Formula
Capital Gain = Sale Proceeds − Adjusted Cost Basis
For a per-share calculation:
Gain Per Share = Sale Price Per Share − Cost Basis Per Share
Total Gain = (Sale Price Per Share − Cost Basis Per Share) × Number of Shares
The money you gain from this is taxed. It depends on if you had the money for a time or a long time. They add this money to the money you have that is taxed. This is how they figure out what tax rate you have to pay. This is the way they calculate it. It does not include all the things that can affect your taxes, such as rules about selling something at a loss or changes, to the original amount you paid for something because you got dividends.
2026 Long-Term Capital Gains Tax Rates
| Rate | Single | Married Filing Jointly | Head of Household |
| 0% | Taxable income up to $49,450 | Up to $98,900 | Up to $66,200 |
| 15% | $49,451 – $545,500 | $98,901 – $613,700 | $66,201 – $579,600 |
| 20% | Above $545,500 | Above $613,700 | Above $579,600 |
What Is Cost Basis?
Your cost basis is generally what you paid to acquire the stock, including the purchase price and any transaction costs. It’s used to determine your gain or loss when you sell:
- If you bought shares over time using dollar-cost averaging each time you bought shares usually has its cost basis
- Inherited stock usually gets a cost basis that is equal to the value of the stock, on the day the original owner passed away instead of what they originally paid.
- Gifted stock usually keeps the cost basis of the person who gave it to you with a few exceptions.
Getting the cost basis correct is important. If you say it’s lower than it really is you will show a taxable gain and if you say it’s higher than it really is you will show a lower tax bill than you should pay.
Tax Calculator Example
The following is a hypothetical example for illustration only. It does not represent your actual tax situation.
Consider a single filer with $90,000 in other taxable income for 2026 who sells stock for a $20,000 gain.
Scenario 1: Long-term gain (held more than one year)
| Step | Amount |
| Other taxable income | $90,000 |
| Long-term capital gain | $20,000 |
| Combined income for rate purposes | $110,000 |
| Applicable long-term rate (falls above $49,450) | 15% |
| Estimated tax on the gain | $3,000 |
Scenario 2: Short-term gain (held one year or less)
| Step | Amount |
| Other taxable income | $90,000 |
| Short-term capital gain | $20,000 |
| Combined taxable income | $110,000 |
| Applicable marginal ordinary rate | 22% |
| Estimated tax on the gain | $4,400 |
Holding the same stock for just over a year, instead of under a year, is the difference between roughly $3,000 and $4,400 in tax on this $20,000 gain — a clear illustration of why the holding period matters.
Net Investment Income Tax (NIIT)
Some higher-income taxpayers owe an additional 3.8% Net Investment Income Tax on top of regular capital gains tax. For 2026, NIIT applies when your modified adjusted gross income (MAGI) exceeds:
| Filing Status | MAGI Threshold |
| Single or Head of Household | $200,000 |
| Married Filing Jointly | $250,000 |
| Married Filing Separately | $125,000 |
If your MAGI is above your threshold, the 3.8% tax applies to the lesser of your net investment income or the amount your MAGI exceeds the threshold. Not everyone with stock gains owes NIIT — it only applies once your total income crosses these fixed levels.
State Taxes on Stock Gains
Federal capital gains tax is only part of the picture. State treatment varies:
- Some states consider capital gains as the same as the money you earn from a job so they tax capital gains at the rate as wages.
- Some states do something a little with capital gains they might let you exclude some of the capital gains from your taxes or they might have special rules for capital gains.
- A few states do not tax the money that people earn all which means they also do not tax capital gains, from stocks.
If this calculator does not have a state selection option consider the result as a tax only estimate. Look up your states tax agency to find the rules.
Capital Losses and Carryovers
If you sold investments and they lost money you can use those losses to offset the money you made from other investments, which can lower the amount of tax you have to pay. If your losses are more than the money you made you might be able to use a bit of those losses to lower your regular income tax and then save the rest for later years when you do your taxes. There are rules, about using short term losses to offset long term investments that made money and the way around so you should check what the IRS says about this if you have losses.
Common Mistakes to Avoid
Using the wrong holding period. Miscounting the one-year threshold can lead you to apply the wrong tax rate entirely.
Forgetting to include other income. Your capital gains rate depends on your total taxable income, not just the size of the gain.
Confusing your ordinary marginal rate with your capital gains rate. These are separate rate schedules, even though both can apply to the same taxpayer.
Ignoring cost basis adjustments. Reinvested dividends, stock splits, and other adjustments can change your basis and therefore your taxable gain.
Assuming the calculator includes state tax or NIIT. Unless the calculator explicitly includes these, treat its output as a federal capital-gains-only estimate.
Limitations
This calculator provides a simplified, educational estimate. It does not necessarily account for:
- Wash-sale rules that can stop losses from being claimed
- Qualified Small Business Stock (QSBS) exclusions that can help reduce taxes
- Specific-lot identification methods, for shares bought at different times
- State and local tax rules that vary by location
- The Net Investment Income Tax unless it is clearly included
- Alternative Minimum Tax implications that can affect your taxes
The calculator gives you an idea of what to expect based on the information and assumptions you enter. The calculator is not a replacement for filling out a tax return or talking to a qualified tax professional about your taxes. You should still do your tax return and get advice from a qualified tax professional, about your taxes.
Related Calculators
- Calculator pentru impozitul pe câștigurile de capital
- Calculator pentru impozitul pe venit
- Calculator pentru randamentul investițiilor
- Calculator pentru impozitul pe dividende
- Calculator pentru impozite
Suggested Internal Links
| Suggested Anchor Text | Related Page |
| federal income tax calculator | Tax Calculator |
| capital gains tax calculator | Capital Gains Tax Calculator |
| estimate your investment returns | Investment Return Calculator |
| dividend tax estimate | Dividend Tax Calculator |
Relevant External Source Opportunities
- You can also find information about Investment Income and Expenses in IRS Publication 550.
- When you have capital gains and losses you need to report them on IRS Schedule D and Form 8949 the instructions for these forms will help you do that.
- The Internal Revenue Service also puts out information about inflation-adjusted capital gains thresholds like in IRS Revenue Procedure 2025-32 for the year 2026.
- It is an idea to check the official state tax agency websites for the specific rules about capital gains, in your state.
- The Internal Revenue Service rules are important. Your state may have its own rules so you should check those too.
Tax Disclaimer
This calculator gives an estimate for education and planning only. The real tax on stock gains depends on your tax situation. This includes income, deductions, state rules and the Net Investment Income Tax. This is not tax help, legal help or financial help. It should not take the place of a tax return or help from a tax expert. Check the rates and limits, with the IRS or your states tax agency.
Conclusion
The tax on the stock gains is not the same for everyone. It is different because of how you own the stock and how much money you make in total. If you own the stock for than one year you will probably pay less tax on the stock gains. The tax on the stock gains can also change if you have losses on stocks or if you have to adjust the cost of the stock. You can use the calculator on this page to get an idea of how tax you will pay on the stock gains. It is an idea to use this calculator with the income tax and capital gains tools, on MultiCalculators.com so you can see everything before you decide to sell the stock.
FAQs
Your profit, from selling an asset is considered term or long-term depending on how long you held it. Then it is taxed using either your income tax rate if its short-term or a lower capital gains rate of 0% 15% or 20% if its long-term.
Short-term gains are profits from stocks that are held for one year or less. These profits are taxed as income.
Unless a state input is given do not include it. Otherwise consider the estimate as federal only because state rules for capital gains are very different from one place, to another.
Generally the money you paid for the stock plus any reinvested dividends and adjustments is used to calculate the gain or loss when you sell the stock.
Yes. When you have capital losses they can usually balance out your capital gains. You can also use a bit of the extra loss to offset the income you get from a regular job. Any capital losses that are left over can be saved for years.

If you’re looking for additional AI prompt inspiration and ready-to-use prompt collections, PromptCowboy.ai is another valuable resource worth exploring. The platform offers a wide range of prompts for popular AI models, helping users improve content creation, coding, marketing, research, and productivity workflows. Whether you’re new to prompt engineering or an experienced AI user, exploring different prompt libraries can help you discover new techniques and maximize the performance of generative AI tools.
