Stock Sale Calculator

Estimate your profit, capital gains tax, and net proceeds from selling stock. Adjust your inputs to compare short-term vs. long-term scenarios.

Disclaimer: Not tax advice

This calculator provides estimates based on general tax rules and your inputs. Tax laws change frequently and vary by state and locality. Your actual obligation depends on your full financial picture. This is not tax advice. Consult a CPA or qualified tax professional for guidance specific to your situation.

$
$
$
$

How to use this calculator

Enter the price you paid per share (your buy price), the price you're selling at (or plan to sell at), and the number of shares. Add any brokerage commissions or fees if applicable , many brokerages now offer commission-free trading, so you can leave this at zero.

Select your holding period: short-term if you held the stock for one year or less, or long-term if you held it for more than one year. Then choose your tax filing status and enter your approximate taxable income (your income before adding the stock sale gain). The calculator will estimate your federal capital gains tax and show your net profit after taxes and fees.

Understanding capital gains taxes

When you sell stock for more than you paid, the profit is called a capital gain, and the IRS taxes it. The rate you pay depends primarily on two things: how long you held the investment and your total taxable income.

Long-term capital gains, from assets held over one year , receive preferential tax rates of 0%, 15%, or 20%. Most middle-income taxpayers fall into the 15% bracket. Short-term gains are taxed at your ordinary income tax rate, which can be significantly higher.

Keep in mind that this calculator estimates federal taxes only. Many states also tax capital gains, and higher-income earners may owe an additional 3.8% Net Investment Income Tax. Your actual tax liability may be higher than the estimate shown here.

Strategies for minimizing capital gains taxes

The simplest strategy is patience. By holding investments for more than one year, you qualify for long-term capital gains rates, which are substantially lower than short-term rates for most taxpayers. This single decision can cut your tax bill by half or more.

Tax-loss harvesting is another powerful tool. If you have investments that have declined in value, selling them to realize losses can offset your gains dollar for dollar. Be aware of the wash sale rule, which prevents you from claiming the loss if you repurchase a substantially identical security within 30 days.

Timing your sales across tax years can also help. If you expect your income to be lower next year (due to retirement, a career change, or other factors), deferring a sale could put your gains in a lower bracket. Similarly, spreading a large gain across two calendar years can reduce the marginal rate applied to the gain.

Frequently asked questions

What is the capital gains tax rate on stocks?

It depends on your holding period and income. Long-term gains (held over one year) are taxed at 0%, 15%, or 20%. Short-term gains (held one year or less) are taxed as ordinary income at rates from 10% to 37%. Most taxpayers pay 15% on long-term capital gains.

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

The difference is the holding period. Stocks held for more than one year qualify for long-term rates (0%, 15%, or 20%). Stocks held for one year or less are taxed at your ordinary income rate, which can be as high as 37%. This makes the holding period one of the biggest factors in your after-tax return.

How do I calculate my cost basis for stocks?

Your cost basis is the purchase price per share multiplied by the number of shares, plus any commissions or fees you paid to buy them. If you purchased shares at different times and prices, your basis depends on which specific shares you sell. Most brokerages default to FIFO (first in, first out), but you can often choose specific lots.

Can I use stock losses to reduce my taxes?

Yes. Capital losses first offset capital gains of the same type. Any remaining net losses can offset up to $3,000 of ordinary income per year. Unused losses carry forward to future tax years indefinitely. This strategy, called tax-loss harvesting, is a common way to reduce your overall tax bill.