Free U.S. Capital Gains Calculator

Capital Gains Tax Calculator

Estimate your capital gain or loss and potential U.S. federal tax based on purchase price, sale proceeds, transaction costs, holding period, filing status, and taxable income.

Enter your investment details

Estimate your capital gain or loss and potential U.S. federal capital gains tax.

$

Enter the amount you originally paid for the asset.

$
$
$
$

Enter estimated taxable income before adding this capital gain. This helps determine how the gain falls across the 2026 long-term capital gains brackets.

Capital Gains Results

Enter your investment details

Your estimated capital gain or loss and potential federal tax will appear here.

How to use this capital gains tax calculator

Enter the amount you paid for the asset, any purchase costs, the sale price, selling costs, and the holding period. For long-term gains, also enter the relevant filing status and taxable income information used by the calculator.

The calculator estimates your adjusted cost basis, net sale proceeds, capital gain or loss, and a simplified potential federal capital gains tax amount.

How capital gains are calculated

A capital gain generally occurs when a capital asset is sold for more than its adjusted cost basis. If net sale proceeds are less than adjusted cost basis, the result is generally a capital loss.

Capital Gain Formula

Capital Gain = Net Sale Proceeds − Adjusted Cost Basis

This calculator uses purchase price plus entered purchase costs as a simplified adjusted cost basis and subtracts entered selling costs from sale proceeds.

What is cost basis?

Cost basis generally begins with the amount paid to acquire an asset. Depending on the asset and tax rules, commissions, acquisition costs, corporate actions, improvements, depreciation, or other adjustments may change the basis.

Simplified basis used by this calculator

Adjusted Cost Basis = Purchase Price + Entered Purchase Costs

Short-term vs. long-term capital gains

The holding period is important because short-term and long-term capital gains generally receive different federal tax treatment.

SHORT-TERM

Held for 1 year or less

Net short-term capital gains are generally taxed at ordinary federal income tax rates.

LONG-TERM

Held for more than 1 year

Most net long-term capital gains may qualify for preferential federal capital gains rates, commonly 0%, 15%, or 20%, depending on taxable income and filing status.

How long-term capital gains tax rates work

Long-term capital gains are not always taxed at one flat rate. The applicable rate can depend on filing status, taxable income, and the amount of long-term gain.

For many taxpayers, most net long-term capital gains fall within the federal 0%, 15%, or 20% capital gains rate structure. Portions of a gain can potentially fall into different rate ranges.

0%

May apply to some long-term capital gains when taxable income falls within the applicable lower-income range.

15%

The rate applicable to many taxpayers with net long-term capital gains.

20%

May apply to portions of net long-term capital gains for taxpayers with higher taxable income.

Capital gains calculation example

Suppose an investment was purchased for $50,000, had $500 in purchase costs, and was later sold for $90,000 with $1,000 in selling costs.

Purchase Price: $50,000
Purchase Costs: $500
Adjusted Cost Basis: $50,500
Sale Price: $90,000
Selling Costs: $1,000
Net Sale Proceeds: $89,000
Capital Gain: $38,500

Why taxable income matters for capital gains

Long-term capital gains rates depend partly on taxable income and filing status. This means the tax on an investment gain cannot always be determined from the gain amount alone.

Other taxable income can effectively use part of the lower capital gains rate ranges before the long-term gain is layered on top, which is why the calculator asks for other taxable income.

How capital losses affect taxes

Capital losses can generally offset capital gains when federal capital gains and losses are netted under applicable tax rules. If losses exceed gains, additional rules may permit a limited deduction against other income and carry unused losses to future years.

This calculator does not perform a complete Schedule D capital loss netting or capital loss carryover calculation.

Capital gains tax on stocks and investments

Capital gains tax commonly applies when investments such as stocks, ETFs, mutual funds, or other capital assets are sold for a gain in a taxable account.

The tax result can depend on the holding period, cost basis, transaction history, capital losses, taxable income, and other tax circumstances.

What is the Net Investment Income Tax?

Certain taxpayers with investment income and income above applicable thresholds may also be subject to the 3.8% Net Investment Income Tax (NIIT).

The NIIT can apply to certain investment income including capital gains, but its calculation depends on net investment income, modified adjusted gross income, filing status, and other tax rules.

NIIT is not included automatically

This calculator provides a simplified federal capital gains estimate and does not automatically calculate the Net Investment Income Tax.

Are all capital gains taxed the same way?

No. Special tax rules can apply to certain assets and transactions. Examples may include collectibles, qualified small business stock, depreciable real estate, home sales, wash sales, inherited assets, gifts, and other situations.

Because of these exceptions, this calculator is designed as a simplified estimate for common investment scenarios rather than a complete federal tax return calculation.

Does this calculator apply to selling a home?

Home sales can be subject to special federal tax rules. Eligible taxpayers who sell a principal residence may be able to exclude some capital gain if they satisfy applicable requirements.

This calculator does not automatically apply the principal residence exclusion or other home-sale-specific rules.

What about cryptocurrency capital gains?

Cryptocurrency transactions can also create taxable capital gains or losses depending on the transaction and tax treatment. Cost basis, sale or disposal value, and holding period can all matter.

For crypto-specific calculations, use the dedicated Crypto Capital Gains Calculator once that page is available.

Related tax and investment calculators

Capital Gains Tax FAQ

How do I calculate a capital gain?

Subtract adjusted cost basis from net sale proceeds. A positive result is generally a capital gain, while a negative result is generally a capital loss.

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

Short-term gains generally involve assets held for one year or less and are typically taxed at ordinary federal income tax rates. Long-term gains generally involve assets held for more than one year and may qualify for preferential rates.

What are the federal long-term capital gains tax rates?

Most net long-term capital gains may be taxed at 0%, 15%, or 20% depending on taxable income and filing status. Special rules can apply to certain assets and transactions.

Does this calculator include state capital gains tax?

No. It provides a simplified federal estimate. State tax treatment varies by jurisdiction.

Does this calculator include the Net Investment Income Tax?

No. Certain taxpayers may owe the 3.8% Net Investment Income Tax, but NIIT is not automatically included in this calculator.

Can capital losses reduce capital gains tax?

Capital losses can generally offset capital gains under federal tax rules. Additional rules may apply when total capital losses exceed capital gains.

Are stock gains subject to capital gains tax?

Gains from selling stocks or other investments in a taxable account can generally create capital gains. Holding period, basis, losses, taxable income, and other tax rules affect the final result.

Do I pay capital gains tax if I reinvest the money?

Reinvesting sale proceeds does not by itself necessarily eliminate a taxable gain from a completed sale in a taxable account. Tax treatment depends on the transaction and applicable rules.

Does this calculator work for cryptocurrency?

The general gain calculation may be similar, but crypto can involve many transactions and basis issues. Use the dedicated Crypto Capital Gains Calculator for crypto-focused estimates.

Federal tax estimate only

This Capital Gains Tax Calculator provides simplified estimates for general informational and educational purposes only. It does not constitute tax, legal, financial, or investment advice. Actual tax liability may differ because of taxable income, capital loss netting, loss carryovers, asset type, state taxes, NIIT, special tax rates, basis adjustments, depreciation, exclusions, and other circumstances.