This calculator finds the capital gain or loss when you sell an asset, using sale proceeds, adjusted cost basis and selling expenses. The gain is the figure that tax rules then apply to; this tool stops before applying any tax rate.
How to use the Capital Gains calculator
- Enter the Sale proceeds: the total amount you received for the asset.
- Enter the Adjusted cost basis: generally what you paid, plus purchase costs and improvements, minus items such as depreciation.
- Enter Selling expenses, such as commissions or closing costs paid on the sale.
- Read the gain. A negative figure is a capital loss.
How the capital gains calculation works
Getting the cost basis right
The IRS defines basis as generally the amount you paid for an asset. For stocks and bonds, it includes the purchase price plus costs such as commissions and transfer fees. For property, cost includes sales tax and other purchase expenses, and the basis is adjusted up for improvements that add value and down for items such as allowable depreciation.
Inherited and gifted assets follow different basis rules, and reinvested dividends add to the basis of fund shares. Brokers report basis for many securities, but check it: leaving out reinvested dividends or a commission overstates your gain.
From gain to tax
Under IRS rules, an asset held more than one year produces a long-term gain or loss; one held a year or less is short-term, and short-term gains are taxed as ordinary income. For 2025, the IRS lists long-term rates of 0%, 15% and 20% depending on taxable income, with higher maximum rates for collectibles and some real estate gains.
Losses can offset gains, and the IRS allows up to 3,000 of net capital loss a year (1,500 if married filing separately) to offset other income, with the rest carried forward. This calculator does not apply holding periods, exclusions or loss offsets. Use the result as an input to your tax return or a conversation with a tax professional, not as the tax owed.
Worked example
Sale proceeds: 12500 · Adjusted cost basis: 8400 · Selling expenses: 75
- Start with sale proceeds: 12,500.
- Subtract adjusted cost basis: 12,500 − 8,400 = 4,100.
- Subtract selling expenses: 4,100 − 75 = 4,025.
Result: $4,025.00
Assumptions and limits
This calculates gain, not tax owed. Supply an adjusted basis according to your applicable rules; holding-period exemptions and loss offsets are not applied.
Formula and worked examples last checked November 20, 2026. Spotted a problem? Report an error.
Frequently asked questions
What is the difference between short-term and long-term capital gains?
According to the IRS, a gain on an asset held more than one year is long-term, and one held a year or less is short-term. Short-term gains are taxed as ordinary income, while long-term gains have separate rates of 0%, 15% or 20% for most assets, depending on taxable income.
What counts as adjusted cost basis?
Basis starts with what you paid, including commissions and other purchase costs. It is increased by improvements that add value and reduced by items such as depreciation. IRS Topic 703 explains the general rules, and inherited or gifted property follows its own.
How much capital loss can I deduct?
Capital losses first offset capital gains. If losses exceed gains, the IRS allows up to 3,000 a year (1,500 if married filing separately) to offset other income, and the remainder carries forward to later years.
Does this calculator work for selling a home?
It calculates the gain, which is the starting point. A home sale may qualify for an exclusion and has its own basis adjustments, which this tool does not apply. Enter the sale price, your adjusted basis including improvements, and selling costs, then review the rules with a tax professional.