Taxes & Investment Strategy
Capital Gains Tax Calculator
Calculate your federal and state capital gains tax obligations on stocks, crypto, and real estate. Compare preferential long-term brackets (0%, 15%, 20%) against ordinary short-term rates and model the 3.8% Net Investment Income Tax (NIIT).
- Instant Real-Time Math
- 100% Client-Side Privacy
- IRS Topic No. 409 & IRC § 1(h) Stacking
Transaction & Tax Profile
Results
Estimated Total Capital Gains Tax
$7,998
Net Profit / Realized Gain: $50,000 (Proceeds: $52,003)
- Federal Tax Obligation
- $5,498
- Long-Term Holding Savings
- Saves $4,155 vs Short-Term
Itemized Capital Gains Tax Breakdown
- Gross Sale Proceeds
- $60,000
- Less: Purchase Cost Basis
- -$10,000
- Realized Capital Gain
- $50,000
- Federal Capital Gains Tax
- $5,498
- State Capital Gains Tax
- $2,500
- 3.8% Net Investment Surtax (NIIT)
- $0
- Net Cash Proceeds Retained
- $52,003
Sale Proceeds Distribution
86.7% Retained Proceeds • 13.3% Total Taxes- Net Retained Proceeds
- Total Taxes (Federal + State + NIIT)
Because your other taxable income is $35,000, the first $13,350 of your long-term capital gain falls beneath the statutory $48,350 threshold, generating $0 in federal capital gains tax. The remaining $36,650 is taxed at 15%. By holding this asset for over one year, you saved approximately $3,500 compared to selling as a short-term trade.
Last reviewed by the WeInvestSmart Editorial Team · Editorial Policy
On this page
What Is Capital Gains Tax?
A capital gain occurs whenever you sell a capital asset for more than your adjusted cost basis. Capital assets encompass virtually all property held for personal or investment purposes, including corporate equities, mutual funds, exchange-traded funds (ETFs), municipal and corporate bonds, cryptocurrencies, precious metals, real estate holdings, and private business equity.
The United States federal tax system divides capital gains into two distinct legal classifications based strictly on holding duration:
- Short-Term Capital Gains: Realized on assets owned for one year or less (365 days or fewer). These gains receive no preferential tax treatment and are taxed as ordinary earned income across standard federal brackets ranging from 10% to 37%.
- Long-Term Capital Gains: Realized on assets held for more than one year (at least 366 days). Congress grants preferential statutory tax rates of 0%, 15%, or 20% to reward patient capital formation and long-term economic investment.
In addition to base federal rates, high-income investors face the statutory 3.8% Net Investment Income Tax (NIIT) under Internal Revenue Code Section 1411, as well as applicable state and municipal income taxes. Calculating your true tax liability requires analyzing all three tiers simultaneously. To coordinate investment cash flows with business taxes, compare this tool with our quarterly estimated tax calculator and our self-employment tax calculator.
Good to know: Holding an asset for exactly 365 days results in short-term tax treatment. To secure long-term capital gains rates, the liquidation trade date must take place on day 366 or later following the original acquisition date.
How It Works: Stacking Rules and Statutory Brackets
Federal capital gains taxes operate through an income stacking mechanism. The IRS does not evaluate your investment profits in isolation. Instead, your standard taxable income (such as W-2 employment wages, self-employment earnings, taxable interest, and non-qualified dividends) forms the base of your tax stack. Long-term capital gains are placed directly on top of that base.
This ordering rule means that your ordinary income absorbs the zero-percent bracket and lower tax bands first. The capital gains then occupy whatever income band remains:
- 0% Capital Gains Rate: Applies to long-term gains that sit below the annual statutory threshold ($48,350 for Single filers and $96,700 for Married Filing Jointly in 2026; $47,025 and $94,050 in 2025).
- 15% Capital Gains Rate: Applies to gains falling between the 0% ceiling and the 20% threshold ($533,400 for Single and $600,050 for Married Filing Jointly in 2026; $518,900 and $583,750 in 2025).
- 20% Capital Gains Rate: Applies to all net long-term capital gains exceeding the upper threshold.
- 3.8% NIIT Surtax: Triggers when Modified Adjusted Gross Income (MAGI) surpasses $200,000 for single filers or $250,000 for joint filers, creating an effective top federal capital gains rate of 23.8%.
Example A models a single investor selling shares with moderate income that straddles the 0% and 15% brackets. Example B models a high-earning investor whose liquidation triggers both the 20% bracket and the 3.8% NIIT surtax. Select Try to load either scenario into the calculator above.
Worked examples
| Parameter / Metric | Example A (Moderate Earner) | Example B (High Earner) |
|---|---|---|
| Purchase Price (Cost Basis) | $10,000 | $50,000 |
| Selling Price (Proceeds) | $60,000 | $250,000 |
| Gross Realized Capital Gain | $50,000 | $200,000 |
| Holding Period | Long-Term (> 1 yr) | Long-Term (> 1 yr) |
| Other Taxable Income | $35,000 | $350,000 |
| Filing Status | Single | Married Filing Jointly |
| State Tax Rate | 5.0% | 6.0% |
| Federal Capital Gains Tax | $5,498 | $35,000 |
| Net Investment Income Tax (3.8%) | $0 | $7,600 |
| State Income Tax | $2,500 | $12,000 |
| Total Estimated Tax | $7,998 | $54,600 |
| Effective Combined Tax Rate | 16.00% | 27.30% |
| Net Cash Proceeds | $52,002 | $195,400 |
Key Concepts: Cost Basis, Wash Sales & the 3.8% NIIT
Navigating capital gains rules requires familiarity with several core tax accounting concepts defined across Treasury regulations:
Adjusted Cost Basis
Your cost basis is the financial foundation of any capital gains calculation. For purchased securities, basis equals the total acquisition price including brokerage commissions and transaction fees. For rental real estate, basis increases with qualified capital improvements (such as a new roof or plumbing replacement) and decreases by cumulative depreciation deductions claimed over the holding period.
When you reinvest dividends or capital gains distributions into mutual funds or dividend reinvestment plans, each reinvestment purchases additional fractional shares with their own distinct cost basis. Failing to account for reinvested dividends results in double taxation when the underlying asset is eventually sold.
Specific Identification vs. FIFO
When selling shares from an accumulated position acquired at different dates and prices, the default IRS method is First-In, First-Out (FIFO), which often triggers the largest gain. Alternatively, investors can elect Specific Identification (SpecID) to sell high-basis lots first, minimizing current taxes or harvesting strategic losses.
Netting Capital Gains and Losses
At tax time on IRS Form 8949 and Schedule D, short-term gains and losses are netted together, and long-term gains and losses are netted together. If one category yields a net loss, it offsets gains in the other category. Excess net capital losses can offset up to $3,000 of ordinary wage income annually, with unused losses carrying forward indefinitely.
How to Use the Calculator: Step-by-Step
Follow these practical steps to project your federal and state capital gains tax liability:
- Enter Purchase Price / Cost Basis: Input your original acquisition cost, including purchase commissions and qualified capital improvements.
- Enter Selling Price / Gross Proceeds: Input the gross contract sales price or trade execution proceeds before taxes.
- Select Holding Period: Choose between long-term (more than one year) and short-term (one year or less) to set statutory brackets.
- Enter Other Taxable Income: Input your estimated annual taxable earnings from employment, business profits, pensions, or IRA withdrawals to establish your tax baseline. Check take-home pay with our gross-to-net paycheck calculator.
- Select Filing Status: Pick Single, Married Filing Jointly, Married Filing Separately, or Head of Household to align bracket boundaries and NIIT limits.
- Specify State Tax Rate: Enter your state marginal income tax rate (0% for no-income-tax states like Florida or Texas).
- Review Real-Time Metrics: Inspect your total tax liability, effective tax rate, bracket-by-bracket breakdown, and final net proceeds.
Good to know: If your capital gain spans multiple federal brackets (for instance, starting in the 0% bracket and crossing into the 15% bracket), the calculator computes the exact blended dollar amount in each tier.
Proactive Tax Minimization & Harvesting Strategies
Proactive tax planning enables investors to preserve substantial capital across decades of portfolio compounding:
1. Tax-Gain Harvesting in the 0% Bracket
Single taxpayers earning below $48,350 in ordinary taxable income ($96,700 for married couples) in 2026 can utilize the 0% federal long-term capital gains bracket. Early retirees and sabbatical takers can sell appreciated investments at 0% tax, immediately repurchase them, and reset their cost basis higher with zero tax penalty.
2. Systematic Tax-Loss Harvesting
Liquidating securities trading at an unrealized loss offsets realized capital gains dollar-for-dollar. When harvesting losses, avoid the 30-day Wash-Sale Rule under IRC Section 1091 by waiting 31 days or reinvesting into a non-substantially identical asset. Explore our step-by-step tax-loss harvesting guide, our breakdown of long-term vs. short-term capital gains, and strategies to reduce the 3.8% Net Investment Income Tax.
3. Donating Appreciated Securities
Donating appreciated shares held over one year directly to a 501(c)(3) charity eliminates 100% of capital gains taxes while providing an itemized charitable deduction for the full fair market value.
4. IRC Section 1031 Like-Kind Exchanges
Real estate investors can defer capital gains and depreciation recapture taxes by rolling proceeds into replacement property within 180 days via a qualified intermediary.
5. Step-Up in Basis at Death
Under Section 1014, inherited capital assets receive a step-up in cost basis to fair market value as of the date of death, permanently eliminating prior unrealized gains.
Special Asset Rules, Real Estate & State Variations
Certain asset classes and personal situations fall outside standard long-term capital gains rules:
Collectibles and Precious Metals
Gold bullion, silver, numismatic coins, art, wine collections, and stamps are classified as collectibles under IRC Section 408(m). Long-term gains on collectibles are subject to a maximum federal statutory rate of 28%, rather than the standard 15% or 20% capital gains ceiling.
Section 1250 Depreciation Recapture on Real Estate
When depreciable real property is sold at a profit, the cumulative depreciation deductions previously claimed to reduce ordinary income are “recaptured” by the IRS. Unrecaptured Section 1250 gains are taxed at a maximum federal rate of 25%, plus applicable NIIT and state income taxes.
Cryptocurrency and Digital Assets
IRS Notice 2014-21 establishes that virtual currencies (such as Bitcoin, Ethereum, and stablecoins) are treated as property for federal tax purposes. Spending cryptocurrency to purchase goods, swapping one token for another, or selling crypto for fiat currency represents a taxable disposition. Every individual transaction generates a reportable capital gain or loss requiring meticulous cost-basis tracking across wallets.
Qualified Small Business Stock (QSBS)
Under IRC Section 1202, non-corporate investors who acquire original-issue stock in eligible domestic C-corporations with aggregate gross assets below $50 million and hold the shares for more than five years can exclude up to 100% of their capital gains (up to $10 million or 10 times their basis).
Sources and Statutory Authorities
- Internal Revenue Service (IRS): Topic No. 409 Capital Gains and Losses
- Internal Revenue Service (IRS): Questions and Answers on the Net Investment Income Tax
- Internal Revenue Service (IRS): Publication 550 Investment Income and Expenses
- Internal Revenue Service (IRS): Publication 523 Selling Your Home
- U.S. Securities and Exchange Commission: Capital Gains Taxation Guidelines
Frequently Asked Questions About Capital Gains Taxes
What is the difference between short-term and long-term capital gains?
Short-term capital gains apply to assets held for one year or less before sale. These profits are taxed at ordinary federal income tax rates ranging from 10% to 37%. Long-term capital gains apply to assets held for more than one year (at least 366 days). Long-term gains benefit from preferential statutory tax rates of 0%, 15%, or 20%, depending on your overall taxable income and filing status.
How does income stacking determine my capital gains tax bracket?
The Internal Revenue Service stacks capital gains directly on top of your other taxable income such as W-2 wages, business profits, and retirement distributions. Your ordinary income fills the lower income tax brackets first. Capital gains sit on top of that income. The portion of long-term gains falling below the statutory threshold is taxed at 0%, while gains exceeding the threshold are taxed at 15% or 20%.
What is the Net Investment Income Tax (NIIT) and who pays it?
The Net Investment Income Tax is a 3.8% surtax established under Section 1411 of the Internal Revenue Code. It applies to individuals with modified adjusted gross income exceeding statutory thresholds: $200,000 for single filers, $250,000 for married couples filing jointly, and $125,000 for married individuals filing separately. The 3.8% tax applies to the lesser of your net investment income or the amount by which your MAGI exceeds the threshold.
Can capital losses offset ordinary income if my losses exceed gains?
Yes. Capital losses first offset capital gains dollar-for-dollar without limitation. If your total capital losses exceed your total capital gains for the tax year, you can deduct up to $3,000 of net capital loss ($1,500 if married filing separately) against ordinary income like wages or interest. Any remaining unused capital loss rolls forward indefinitely into future tax years.
Do states tax capital gains at preferential rates like the federal government?
Most states do not offer preferential capital gains tax rates. States such as California, New York, and New Jersey tax capital gains as ordinary state income, with top marginal state tax brackets exceeding 10% to 13.3%. Conversely, nine states impose no state income tax on investment gains: Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, and Wyoming.
How does the primary residence home sale capital gains exclusion work?
Under Internal Revenue Code Section 121, homeowners can exclude up to $250,000 of capital gain ($500,000 for married couples filing jointly) on the sale of their primary residence. To qualify, you must have owned and used the property as your principal residence for at least two of the five years preceding the sale date. This exclusion can generally be claimed once every two years.
