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

  1. Enter the price that you first paid for each share (your cost basis) and the total number of shares you had.
  2. Enter the price that you got when you sold the stock for each share.
  3. Enter how months or years you kept the stock to find out if its considered short-term or long-term.
  4. Choose your filing status.
  5. Enter the money you made that is taxable because it helps to know which capital gains tax bracket your profit falls into.
  6. Enter any capital losses you want to use to reduce the gain if allowed.
  7. Check your estimated capital gain the tax rate that applies and how tax you are likely to owe.

Calculator Inputs

InputExplanation
Purchase Price / Cost BasisWhat you originally paid per share, including reinvested dividends or adjustments where applicable
Sale PriceWhat you received per share when you sold
Number of SharesHow many shares were sold
Holding PeriodHow long you owned the stock — determines short-term vs. long-term treatment
Filing StatusSingle, married filing jointly, married filing separately, or head of household
Other Taxable IncomeYour income outside the stock sale, used to determine your applicable capital gains bracket
Capital LossesEligible 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

RateSingleMarried Filing JointlyHead of Household
0%Taxable income up to $49,450Up to $98,900Up to $66,200
15%$49,451 – $545,500$98,901 – $613,700$66,201 – $579,600
20%Above $545,500Above $613,700Above $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:

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)

StepAmount
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)

StepAmount
Other taxable income$90,000
Short-term capital gain$20,000
Combined taxable income$110,000
Applicable marginal ordinary rate22%
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 StatusMAGI 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:

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:

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

Suggested Internal Links

Suggested Anchor TextRelated Page
federal income tax calculatorTax Calculator
capital gains tax calculatorCapital Gains Tax Calculator
estimate your investment returnsInvestment Return Calculator
dividend tax estimateDividend Tax Calculator

Relevant External Source Opportunities

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

How is tax on stock gains calculated?

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.

What’s the difference between short-term and long-term capital gains?

Short-term gains are profits from stocks that are held for one year or less. These profits are taxed as income.

Does this calculator include state taxes?

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.

What is cost basis?

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.

Can capital losses reduce my stock gains tax?

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.

Tax on Stock Gains

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.

Leave a Reply

Your email address will not be published. Required fields are marked *