📊 Stock & Investment Tax Tool

Stock Sale Tax Calculator

Estimate the potential capital gains tax from selling stocks based on your sale price, cost basis, selling expenses, holding period and other basic tax information.

⚠️ Estimate only — actual tax liability depends on your complete tax situation and applicable tax rules.
📊 Stock Sale Information
Enter what you originally paid for the shares, adjusted for applicable basis adjustments.
The total amount you received from the stock sale.
Include eligible transaction costs or selling expenses.
How long did you hold the shares before selling?
Your estimated total taxable income for the year.
For determining the applicable tax rate.
Enter other capital losses you want to consider in this simplified estimate.
📊

Enter your stock sale information

and select Calculate to see your estimate.

💡 Important: Your result is an estimate. Stock sale taxation can depend on cost basis, holding period, income, filing status, capital losses, tax year and other factors. Always consult a qualified tax professional for your specific situation.

What Is a Stock Sale Tax Calculator?

A stock sale tax calculator is an online tool that helps investors estimate the potential capital gains tax from selling stocks or other taxable investments. By entering key details such as the purchase price, sale price, selling expenses, holding period, and your estimated annual income, you can get a quick estimate of your potential tax liability.

Understanding the tax implications of selling stocks is important for effective financial planning. This stock sale tax calculator provides a simplified estimate based on current federal tax rules, helping you make more informed decisions about your investments.

Whether you're selling individual stocks, mutual funds, or exchange-traded funds (ETFs), the basic calculation involves comparing the sale proceeds with your cost basis and applicable expenses. The difference is your capital gain or loss, which may be subject to tax depending on your holding period and overall tax situation.

How Is Tax Calculated When Selling Stocks?

The basic formula for calculating tax when selling stocks is:

Sale Proceeds − Cost Basis − Eligible Selling Expenses = Estimated Capital Gain or Loss

The resulting amount is your capital gain (if positive) or capital loss (if negative). The tax you may owe depends on several factors:

  • Holding period — Whether you held the stock for one year or less (short-term) or more than one year (long-term).
  • Filing status — Single, married filing jointly, married filing separately, or head of household.
  • Taxable income — Your total income for the year, which helps determine your tax bracket.
  • Capital losses — Other losses that may offset gains.

Short-term capital gains are generally taxed at ordinary income rates, while long-term capital gains may qualify for preferential rates. This stock sale tax calculator uses these factors to provide a simplified estimate.

Short-Term vs. Long-Term Stock Gains

The holding period is one of the most important factors in determining how your stock sale gains are taxed:

  • Short-term gains — Apply to stocks held for one year or less. These gains are generally taxed at your ordinary income tax rate, which can range from 10% to 37% depending on your income level.
  • Long-term gains — Apply to stocks held for more than one year. These gains may qualify for preferential tax rates of 0%, 15%, or 20% for the 2026 tax year, depending on your taxable income and filing status.

For 2026, the 0% long-term capital gains rate applies to single filers with taxable income up to $44,600, and the 20% rate applies above $492,300. Married filing jointly thresholds are $89,200 and $553,850 respectively.

The calculator uses these current federal rates to provide a realistic estimate based on your inputs.

What Is Cost Basis?

Cost basis is the original value of an asset for tax purposes. When you sell stocks, your cost basis is generally what you paid for the shares, adjusted for certain factors. Understanding your cost basis is important because it directly affects your capital gain or loss.

Common adjustments to cost basis include:

  • Reinvested dividends — Dividends used to purchase additional shares increase your basis.
  • Stock splits — Splits adjust the number of shares and per-share basis.
  • Commissions and fees — Certain transaction costs may be added to your basis.
  • Corporate actions — Mergers, acquisitions, and spin-offs can affect basis.

A higher cost basis means a lower taxable gain. This is why keeping accurate records of your stock purchases and adjustments is important.

Can Capital Losses Reduce Stock Sale Taxes?

Yes, capital losses can offset capital gains and potentially reduce your tax liability. If you have losses from selling stocks, you may be able to use them to offset gains from other sales in the same tax year.

The general rules for capital losses include:

  • Offset gains — Losses are first used to offset gains of the same type (short-term losses offset short-term gains, and long-term losses offset long-term gains).
  • Netting process — After offsetting gains, remaining losses can be used against other types of gains.
  • Deduction limit — Up to $3,000 of net capital losses can be deducted against ordinary income per year ($1,500 for married filing separately).
  • Carryover — Excess losses can be carried forward to future tax years.

This calculator allows you to enter other capital losses to see how they might affect your estimated taxable gain. However, actual tax treatment depends on your complete tax situation.

Example of a Stock Sale Tax Calculation

Hypothetical Scenario:

Purchase Price / Cost Basis$40,000
Sale Price$60,000
Selling Fees & Expenses$500
Estimated Gain$19,500

Calculation: $60,000 − $40,000 − $500 = $19,500

💡 What this means: The $19,500 is the estimated gain in this example. If the holding period is more than one year, the gain may qualify for long-term capital gains rates (0%, 15%, or 20%). If held for one year or less, it would be taxed at ordinary income rates. This is an example only — not tax advice.

Factors That Can Affect Your Stock Sale Tax

Several factors can influence the tax you may owe on a stock sale:

  • Filing status — Single, married filing jointly, married filing separately, or head of household.
  • Taxable income — Your total income for the year, which determines your tax bracket.
  • Holding period — Short-term vs. long-term classification affects the applicable tax rate.
  • Cost basis — Your original investment in the shares, adjusted for splits, dividends, and other events.
  • Selling expenses — Transaction costs that reduce your amount realized.
  • Capital losses — Other losses that may offset gains.
  • Tax year — Rates and brackets can change from year to year.
  • State tax rules — State tax treatment can differ from federal treatment.

Important Things to Know Before Selling Stocks

Before selling stocks, consider these practical points:

  • Keep accurate records — Maintain records of purchase dates, prices, reinvested dividends, and any adjustments to cost basis.
  • Review your holding period — Holding for more than one year may qualify for lower long-term capital gains rates.
  • Consider your overall tax situation — Other income, deductions, and credits can affect your tax liability.
  • Review your brokerage statements — Most brokers provide cost basis information on Form 1099-B.
  • Check for wash sales — If you repurchase substantially identical securities within 30 days, the wash-sale rule may apply.
  • Consider state taxes — Some states tax capital gains differently or not at all.
  • Consult a tax professional — For complex situations, professional advice can help you make informed decisions.

For more information, read our guide: How Is Tax Calculated When Selling Stocks?

Frequently Asked Questions

A stock sale tax calculator is a free online tool that helps investors estimate the potential capital gains tax from selling stocks based on sale price, cost basis, holding period, and other tax information.

Capital gain is calculated as: Sale Proceeds − Cost Basis − Selling Expenses = Capital Gain or Loss. If the result is positive, you have a capital gain; if negative, a capital loss.

Cost basis is the original value of an asset for tax purposes. For stocks, it's generally what you paid for the shares, adjusted for reinvested dividends, stock splits, and other events.

Yes. Short-term gains (held for 1 year or less) are taxed at ordinary income rates. Long-term gains (held for more than 1 year) may qualify for preferential rates of 0%, 15%, or 20% for 2026.

Yes. Eligible selling expenses reduce the amount realized from the sale, which lowers your capital gain. Examples include brokerage fees and certain transaction costs.

Yes. Capital losses can offset capital gains, reducing your taxable gain. Excess losses may be used to offset other income up to $3,000 per year, with remaining losses carried forward.

Yes. Your taxable income determines your tax bracket, which affects the rate applied to short-term gains and the rate for long-term gains (0%, 15%, or 20% based on income thresholds).

No. The calculator provides an estimate based on the information you enter. Actual tax liability depends on your complete tax situation, including other income, deductions, credits, and applicable federal and state rules.

SB
Reviewed for general educational use by SmartTaxCalculator
Last updated: August 15, 2026 • Tax Year: 2026
View author profile →
Disclaimer: This calculator provides an estimate for general informational purposes only. It is not tax, legal, or financial advice. Actual tax liability may vary based on individual circumstances, applicable federal and state rules, tax year, deductions, credits, capital losses and other factors. Consult a qualified tax professional for advice about your specific situation.

Read full disclaimer →