A capital gain is the profit realized when you sell an asset for more than its original purchase price (cost basis). Short-term capital gains (assets held ≤ 1 year) are taxed as ordinary income. Long-term capital gains (assets held > 1 year) are taxed at preferential rates of 0%, 15%, or 20%, depending on your income.
Capital gains taxation is governed primarily by Internal Revenue Code §1221–§1231. The tax treatment depends on two factors: the type of asset and how long you held it before selling. Short-term capital gains (holding period ≤ 1 year) are included in ordinary income and taxed at your marginal rate — up to 37% for high earners in 2024. Long-term capital gains (holding period > 1 year) qualify for preferential rates: 0% for taxpayers in the 10–15% brackets, 15% for most middle-income filers, and 20% for filers in the 37% bracket. An additional 3.8% Net Investment Income Tax (NIIT) applies to high-income filers (modified AGI over $200,000 single / $250,000 joint) on investment gains, dividends, and other net investment income. For real estate, special rules apply: a primary residence exclusion allows individuals to exclude up to $250,000 ($500,000 married filing jointly) of capital gains if they lived in the home for 2 of the last 5 years (IRC §121). The IRS Publication 550 and Publication 544 cover capital gains in detail. The difference between short- and long-term treatment creates the holding period strategy: waiting one day past one year can shift a gain from ordinary income rates to long-term rates — a significant tax optimization for larger gains.
A capital loss occurs when you sell an asset below its cost basis. Capital losses can offset capital gains dollar-for-dollar. Net losses up to $3,000 can be deducted against ordinary income annually; excess losses carry forward indefinitely. This is called tax-loss harvesting when done strategically.
Cost basis is your original purchase price plus any commissions or fees paid, adjusted for stock splits or dividends reinvested. Accurate cost basis records are your responsibility — brokers report it on Form 1099-B.