Stock Profit & Tax Calculator: After-Tax Gain

Profitable stock sales can produce two different numbers: the investment gain itself and the amount left after federal tax. Trading costs affect the gain before taxes are considered, while holding period, filing status and taxable income determine how a 2026 federal capital-gains estimate should be calculated.


Stock Profit & Tax Calculator

Price paid for each share before buy-side fees.
Sale price received for each share before sell-side fees.
Fractional shares are supported.
Optional commissions or other acquisition costs included in basis.
Optional selling costs deducted from sale proceeds.
Federal tax details
Determines short-term versus long-term federal gain treatment.
Used with 2026 federal income and capital-gains brackets.
2026 taxable income after deductions, excluding the gain from this trade.
Results update automatically as you change the inputs.
Trade profit before tax -
Estimated profit after federal tax -
Calculation details
Cost basis-
Net sale proceeds-
Profit or loss before tax-
Pre-tax return-
Estimated federal tax on gain-
Effective federal rate on gain-
After-federal-tax result-
Break-even sell price/share-

Federal planning estimate for a single stock sale using 2026 tax brackets. It does not calculate state or local tax, the 3.8% Net Investment Income Tax, wash-sale adjustments, loss deductions or carryovers, qualified dividends, other capital gains and losses, AMT, special-rate assets, or every basis adjustment. Taxable-income stacking can differ when other preferential-rate income is present.



Embed this calculator on your site

For best results, paste this snippet into a main content area or a container up to about 1200px wide. The iframe is responsive and its height automatically adjusts to the calculator content.

How to Use the Stock Profit & Tax Calculator

Start with the purchase price, sale price and number of shares sold. Buy-side and sell-side fees are optional, but including them produces a more complete estimate of cost basis and net sale proceeds.

  • Buy price/share: Price paid for each share before acquisition costs.
  • Sell price/share: Price received for each share before selling costs.
  • Shares sold: Number of shares included in the modeled sale; fractional shares are supported.
  • Buy fees: Commissions or similar acquisition costs added to basis.
  • Sell fees: Selling costs deducted from proceeds.

Federal tax details require a holding period, filing status and taxable income before this stock gain. Taxable income means income after deductions for the 2026 return, excluding the gain modeled by the calculator. Entering gross salary instead would generally overstate where the gain sits in the tax brackets.

Only short-term and long-term treatment are offered. Mixed tax lots cannot be estimated reliably with one holding-period choice because different shares may have different bases and different holding periods.

How Stock Profit and Cost Basis Are Calculated

Cost basis begins with the purchase price multiplied by the number of shares, then adds entered buy-side fees. Stock basis can require other adjustments in real tax reporting, but purchase costs such as commissions are generally included when shares are bought.

Cost basis = buy price x shares + buy fees

Net sale proceeds equal the sale price multiplied by the number of shares minus entered selling costs. Subtracting basis from proceeds produces the modeled capital gain or loss.

Profit or loss = net sale proceeds – cost basis

Using the default trade, 100 shares purchased at $50 and sold at $75 with $5 of fees on each side produce a $5,005 cost basis and $7,495 of net proceeds. Profit before tax is $2,490, equal to about a 49.75% return on the modeled basis.

Break-even price is also useful when fees matter. It solves for the sale price per share needed for net proceeds to equal the modeled cost basis after sell-side fees.

How the 2026 Federal Tax Estimate Works

Short-term gains generally come from stock held for one year or less and are taxed at ordinary federal income-tax rates. Rather than multiplying the entire gain by one marginal rate, the calculator compares 2026 ordinary income tax before and after adding the gain. Bracket-crossing gains can therefore be taxed partly at one rate and partly at another.

Long-term gains generally come from shares held for more than one year. Most stock gains use the 0%, 15% and 20% federal long-term capital-gains structure, with the applicable portions determined by filing status and taxable income.

For 2026, the 0% long-term threshold is $49,450 for single filers and married taxpayers filing separately, $98,900 for married couples filing jointly and $66,200 for heads of household. The top of the 15% band is $545,500 for single filers, $613,700 for joint filers, $306,850 for married-separate filers and $579,600 for heads of household.

Long-term gain is stacked above the taxable income entered. With the default $80,000 of taxable income for a single filer, a $2,490 long-term gain falls in the 15% band. Estimated federal tax on that gain is $373.50, leaving about $2,116.50 after the modeled federal capital-gains tax.

Using a short-term holding period for the same default trade produces a different result. At $80,000 of taxable income for a single filer, the incremental 2026 ordinary income tax on the $2,490 gain is about $547.80 because the gain falls in the 22% bracket.

Why the Tax Estimate Can Differ From a Tax Return

Capital-gains tax is calculated across an entire return, not trade by trade in isolation. Other realized gains and losses can change the amount ultimately taxed, and long-term gains can interact with qualified dividends or other preferential-rate income when the tax worksheet is completed.

Losses require especially careful treatment. Selling stock at a loss can offset capital gains, and net capital losses can sometimes reduce other taxable income within annual limits or carry forward to later years. No tax benefit is assigned to a losing trade here because the correct benefit depends on the rest of the taxpayer’s capital-gain and loss activity.

Wash-sale rules can also change the timing of a deductible loss when substantially identical securities are acquired around a loss sale. Tax-lot identification matters when shares were purchased at different times or prices, since the basis of the shares actually sold controls the realized gain or loss.

State and local income taxes are excluded. Jurisdictions apply different capital-gains rules, so one generic state-rate assumption would make a national calculator look more precise than it is.

Net Investment Income Tax is excluded as well. NIIT at 3.8% can apply to certain taxpayers with net investment income and modified adjusted gross income above statutory thresholds, but taxable income alone is not enough to calculate it accurately.

Reading the Results

Trade profit before tax shows the gain after the entered trading costs but before federal capital-gains tax. Losses are displayed separately rather than as a negative profit label.

Estimated profit after federal tax subtracts only the modeled 2026 federal tax attributable to a gain. State tax, NIIT and other return-level effects remain outside that number, so it should not be treated as guaranteed cash available after every tax obligation.

Calculation details show basis, proceeds, pre-tax return, estimated federal tax, the effective federal rate on the gain, the after-tax result and break-even sell price. Effective rate can differ from the headline bracket because a gain may span more than one tax band.

Comparing short-term and long-term settings can illustrate how holding period changes federal tax treatment, but the tax difference should not decide an investment sale by itself. Price risk, diversification, portfolio needs and the reason for selling remain separate investment considerations.

Frequently Asked Questions (FAQs)

How are stock commissions handled?

Entered buy-side fees are added to the modeled cost basis, while sell-side fees reduce sale proceeds. Actual basis can require additional adjustments depending on how the shares were acquired or changed while owned.

What counts as a long-term stock gain?

Stock held for more than one year generally qualifies for long-term capital-gain treatment. Holding the stock for one year or less generally produces short-term treatment.

Why does the calculator ask for taxable income?

Federal tax rates on capital gains depend on income as well as holding period and filing status. Taxable income before the modeled gain determines where that gain begins in the 2026 tax brackets.

Does a stock loss create an automatic tax refund?

No. Losses may offset other capital gains and can sometimes reduce other taxable income, but the benefit depends on annual netting rules, deduction limits, carryovers and possible wash-sale adjustments.

Does the estimate include the 3.8% Net Investment Income Tax?

No. NIIT depends on net investment income and modified adjusted gross income, which are different from the taxable-income input used for the regular federal capital-gains estimate.

Does the calculator include state capital-gains tax?

No. State and local tax treatment varies by jurisdiction and is not included in the after-federal-tax result.

Sources