What Is a Capital Gain?

Photo by Justin Morgan on Unsplash
A capital gain arises when you sell a capital asset — stocks, bonds, real estate, collectibles, cryptocurrency — for more than your cost basis (what you paid for it, adjusted for commissions, stock splits, and improvements). The taxable gain is the sale price minus the cost basis. If you sell for less than your cost basis, you have a capital loss.
Capital gains are not taxed until realised — unrealised appreciation in a still-held asset is not a taxable event, which creates a powerful incentive to defer realisation.
The cost basis calculation can be straightforward (you bought 100 shares at $20 each, so your basis is $2,000) or complex (you reinvested dividends over 20 years, each reinvestment creating a new lot with its own basis and holding period). Keeping accurate records is essential because you are responsible for reporting accurate basis to the IRS, even if your brokerage does not.
Not all assets qualify as capital assets. Inventory held for sale by a business, accounts receivable, and certain other business property are excluded. But for most individual investors, nearly everything they own and sell — securities, real estate, collectibles, and increasingly cryptocurrency — is treated as a capital asset.
Short-Term vs. Long-Term Rates

Photo by Towfiqu barbhuiya on Unsplash
Holding period is the most important variable in capital gains taxation. Assets held for one year or less generate short-term capital gains, taxed as ordinary income at rates up to 37%. Assets held for more than one year generate long-term capital gains, taxed at preferential rates: 0% for taxpayers in the 10–12% brackets; 15% for most middle- and upper-middle-income taxpayers; 20% for those with taxable income above approximately $583,750 (single) or $731,200 (MFJ) in 2024.
The rate difference between short- and long-term treatment can be enormous. The same gain taxed at 22% as short-term versus 15% as long-term is a 7 percentage point difference. For large gains, waiting 366 days instead of 365 can save thousands of dollars.
Holding period begins the day after you acquire the asset and ends on the day you sell it. If you buy shares on January 1, 2024, your one-year holding period is satisfied on January 2, 2025 — not January 1, 2025. This seemingly minor distinction matters when timing year-end sales.
For inherited assets, the holding period is automatically treated as long-term regardless of how long either the decedent or the heir actually held the asset. For gifted assets, the recipient generally inherits the donor's holding period, which can be beneficial when the donor has held the asset for many years.
The Net Investment Income Tax

Photo by Mediamodifier on Unsplash
High earners pay an additional 3.8% Net Investment Income Tax (NIIT) on investment income above $200,000 (single) or $250,000 (MFJ). This tax, introduced by the Affordable Care Act in 2013, applies to net capital gains, dividends, interest, rents, and passive activity income — but not to wages or active business income.
For taxpayers above the threshold, the effective top federal rate on long-term capital gains is 23.8% (20% + 3.8% NIIT), and on short-term gains it is 40.8% (37% + 3.8% NIIT). State income taxes on capital gains vary widely and can add substantially to this total.
The NIIT threshold is not indexed for inflation, which means it captures an increasing number of households over time. Unlike the ordinary income brackets, the $200,000/$250,000 thresholds have not changed since the tax was enacted. The tax applies to the lesser of net investment income or the amount by which modified adjusted gross income exceeds the threshold — so a taxpayer who is only slightly above the threshold pays NIIT only on the excess, not on all investment income.
Taxpayers near the threshold may be able to reduce NIIT exposure by maximising contributions to tax-deferred accounts, which reduce modified adjusted gross income. Self-employed individuals and active business participants should be aware that income from active participation in a trade or business generally escapes NIIT even if it flows through a partnership or S corporation.
Capital Losses and Netting Rules

Photo by Jakub Żerdzicki on Unsplash
Capital losses offset capital gains, reducing taxable gains dollar-for-dollar. The netting rules require first offsetting within the same type: short-term losses against short-term gains, then long-term losses against long-term gains. Net losses from one category can then offset gains in the other.
If total capital losses exceed total capital gains, up to $3,000 of net losses can offset ordinary income per year. Remaining losses carry forward indefinitely to future tax years — there is no expiration. A taxpayer with a $50,000 net capital loss and no capital gains deducts $3,000 this year and carries $47,000 forward to offset future gains or income.
The order of netting matters for tax efficiency because short-term gains are taxed at higher rates. If a long-term loss offsets a short-term gain, the taxpayer effectively converts a high-rate tax offset into a low-rate one — a suboptimal outcome. Taxpayers with losses in both categories should be aware of how the netting sequence applies before deciding which positions to sell.
Capital loss carryforwards retain their character — a long-term loss carried forward continues to be treated as a long-term loss in future years. This means a large carryforward is most valuable when there are future short-term gains to offset, since it converts those high-rate gains into tax-free income rather than simply replacing a 15–20% gain with a 15–20% offset.