CalculatorFree.net

Capital Gains Tax Calculator

Capital Gain: $10,000.00
Tax Rate: 15% long-term
Capital Gains Tax: $1,500.00
Total Tax: $1,500.00
Net Proceeds After Tax: $8,500.00
Cost Basis: $10,000.00 Sale Price: $20,000.00 Capital Gain = $20,000.00 - $10,000.00 = $10,000.00 Holding Period: Long-term (>= 1 year) Annual Income: $75,000.00 LT Rate: 15% (income in 15% bracket) Capital Gains Tax = $10,000.00 × 15% = $1,500.00 ──────────────────────────────────────── Capital Gain: $10,000.00 Capital Gains Tax: $1,500.00 Total Tax: $1,500.00 Net Proceeds: $8,500.00
Advertisement

What Are Capital Gains?

A capital gain is the profit you make when you sell a capital asset — stock, real estate, mutual funds, bonds, cryptocurrency, or collectibles — for more than you paid for it. The amount you paid is called your cost basis, which includes the original purchase price plus any commissions, fees, or improvements (for real estate).

Capital Gain = Sale Price − Cost Basis

If you sell for less than your basis, you have a capital loss, which can offset capital gains dollar-for-dollar and up to $3,000 of ordinary income per year. Excess losses carry forward indefinitely.

Short-Term vs. Long-Term Capital Gains

The single most important factor determining how much tax you pay on a capital gain is how long you held the asset before selling.

2025 Long-Term Capital Gains Tax Rates

Rate Single Filers Married Filing Jointly Head of Household
0% Up to $47,025 Up to $94,050 Up to $63,000
15% $47,026 – $518,900 $94,051 – $583,750 $63,001 – $551,350
20% Over $518,900 Over $583,750 Over $551,350

These thresholds are based on your total taxable income, not just the gain itself. A single filer with $40,000 of wages who sells stock with a $20,000 long-term gain has $60,000 of taxable income — part of the gain falls in the 0% bracket, the rest in the 15% bracket.

Worked Example

Sarah (single filer) has $50,000 in W-2 wages and sells stock she has held for 18 months with a $30,000 long-term gain. Her taxable income is $80,000 (before standard deduction). After the $15,000 standard deduction, taxable income = $65,000.

Long-term gain: $30,000 The 0% bracket ends at: $47,025 Gain in 0% bracket: $47,025 − $35,000 (wages after deduction) = $12,025 at 0% Gain in 15% bracket: $30,000 − $12,025 = $17,975 at 15% Tax on long-term gains: $0 + ($17,975 × 15%) = $2,696

Net Investment Income Tax (NIIT)

High-income taxpayers owe an additional 3.8% Net Investment Income Tax on investment income — including capital gains, dividends, interest, and rental income — above these thresholds:

The NIIT applies to the lesser of your net investment income or the amount by which your modified adjusted gross income exceeds the threshold. This means the top effective federal rate on long-term capital gains is 23.8% (20% + 3.8%) for high earners, and up to 40.8% for short-term gains (37% + 3.8%).

How to Reduce Capital Gains Tax

1. Hold for the Long-Term

The simplest strategy: wait at least 366 days before selling any appreciated asset. Converting a short-term gain to a long-term gain can reduce your tax rate by 15–22 percentage points. On a $50,000 gain, that is $7,500 to $11,000 in tax savings just by waiting.

2. Tax-Loss Harvesting

Deliberately sell investments that have declined in value to generate losses that offset your gains. If you have $20,000 in realized gains and $8,000 in harvested losses, you only pay tax on $12,000. Losses in excess of gains offset up to $3,000 of ordinary income per year; the remainder carries forward.

3. Donate Appreciated Assets

If you donate stock or other appreciated assets directly to a qualified charity (instead of selling first and donating cash), you avoid capital gains tax entirely and receive a charitable deduction for the full fair market value. This is one of the most tax-efficient ways to give.

4. Use Tax-Advantaged Accounts

Assets held inside a 401(k), IRA, Roth IRA, or HSA do not generate capital gains tax when you sell or rebalance. Holding highly appreciated, high-turnover investments inside these accounts first (asset location) can meaningfully reduce your lifetime tax bill.

5. Opportunity Zone Investments

Reinvesting capital gains into a Qualified Opportunity Fund within 180 days can defer the original gain until December 31, 2026, and eliminate all future appreciation on the opportunity zone investment after a 10-year hold.

Frequently Asked Questions

What is a step-up in basis and how does it reduce capital gains tax?

When you inherit an asset, its cost basis is "stepped up" to the fair market value on the date of the original owner's death. This means if your parent bought stock for $10,000 that was worth $150,000 when they died, your basis is $150,000. If you sell immediately, you owe zero capital gains tax on the $140,000 appreciation. The step-up in basis is one of the most powerful estate planning tools available and effectively eliminates capital gains tax on assets held until death.

What is a 1031 exchange and how does it defer capital gains on real estate?

A 1031 exchange (named after IRC Section 1031) allows real estate investors to defer paying capital gains tax when they sell an investment property by reinvesting the proceeds into a "like-kind" property within a strict timeline: 45 days to identify a replacement property and 180 days to close. You must use a qualified intermediary to hold the funds between transactions. The tax is deferred — not eliminated — until you eventually sell without doing another exchange. 1031 exchanges are available only for investment or business property, not your primary residence.

Are cryptocurrency gains subject to capital gains tax?

Yes. The IRS treats cryptocurrency as property, not currency. Every time you sell, exchange, or use crypto to buy goods or services, you trigger a taxable event. Gains held less than one year are short-term and taxed as ordinary income. Gains held more than one year qualify for long-term rates (0%, 15%, or 20%). You must track your cost basis for every transaction. The IRS now asks about crypto on Form 1040, and crypto exchanges issue 1099 forms. Tax-loss harvesting is allowed and the wash-sale rule does NOT currently apply to crypto (though Congress has proposed changing this).

Can I exclude capital gains on the sale of my primary home?

Yes, under IRC Section 121. If you owned and lived in the home as your primary residence for at least 2 of the last 5 years, you can exclude up to $250,000 of gain (single filers) or $500,000 (married filing jointly). You can use this exclusion once every two years. The exclusion does not apply to gains from depreciation recapture if you ever used the home for business purposes, and it does not reduce the sale price for state capital gains tax purposes in all states. Partial exclusions are available if you had to sell early due to a job change, health issue, or unforeseen circumstance.

What is the wash sale rule?

The wash sale rule (IRC Section 1091) prevents you from claiming a tax loss if you buy the same or "substantially identical" security within 30 days before or after the sale. If you sell 100 shares of Apple at a loss and buy 100 shares of Apple the next day, the loss is disallowed — it is added to the basis of the replacement shares instead. The 30-day window applies both before AND after the sale (a 61-day window total). To harvest a tax loss legitimately, either wait 31 days to repurchase, or buy a similar but not identical fund in the interim (e.g., sell S&P 500 ETF, buy total market ETF).

What are Qualified Opportunity Zones and how do they defer capital gains?

Qualified Opportunity Zones (QOZs) are designated low-income census tracts where you can defer and potentially reduce capital gains tax by investing unrealized gains in a Qualified Opportunity Fund (QOF) within 180 days of a sale. If you hold the QOF investment for at least 10 years, any appreciation in the QOF itself is completely tax-free. The original deferred gain must be recognized by December 31, 2026 regardless of holding period. QOZ investments can be complex and illiquid — always consult a tax advisor before investing.

Advertisement

Related Calculators