ACCT-351 · Lesson 9 of 12 · 26 min

Capital gains I: basis, holding periods, rates and losses

Capital gains have been taxed since the income tax began in 1913, but long-term gains have usually been taxed at lower rates than ordinary income. This lesson covers the mechanics under sections 1001 to 1092 and 1211 to 1223: what counts as a capital asset, how the amount realized and adjusted basis are measured, how the holding period separates short-term from long-term gains, how gains and losses are netted and taxed, how losses are limited and carried over, how specific shares are identified when only some are sold, and several anti-abuse rules, including the wash sale rule. Lesson 10 covers home sales, gifts, inheritances and like-kind exchanges.

Capital assets and realization

Section 1221 defines a capital asset as any property held by the taxpayer except inventory and property held for sale to customers, depreciable or real property used in a business, certain self-created intangibles, accounts receivable from the business and a few other categories. Stocks, bonds, mutual fund shares, digital assets held as investments, a personal residence, a car used personally, and collectibles are capital assets. Business real estate and equipment held more than a year are section 1231 property (lesson 7). Gain or loss is recognized when property is sold or exchanged, which is called realization; an increase in value while the property is held is not taxed.

Gain or loss under section 1001 equals the amount realized minus the adjusted basis. The amount realized is the money received plus the fair market value of any property or services received, plus any liabilities of the seller that the buyer assumes, minus selling expenses such as commissions. Basis is generally cost, including purchase commissions and fees, adjusted under section 1016: increased by capital improvements and reinvested dividends, decreased by depreciation and returns of capital. Brokers report the proceeds and, for covered securities bought after 2010, the basis of stock sales on Form 1099-B, and taxpayers report each sale on Form 8949 and summarize on Schedule D.

Holding periods and rates

A gain is long-term if the asset was held more than one year, counting from the day after acquisition to the day of sale, and short-term otherwise. Net short-term gains are taxed as ordinary income. Net long-term gains, together with qualified dividends, are taxed at 0, 15 or 20 percent, depending on where they fall when stacked on top of ordinary taxable income. For 2026 the 0 percent rate applies to such income up to $49,450 of taxable income for single filers ($98,900 joint, $66,200 head of household), the 15 percent rate up to $545,500 single ($613,700 joint, $579,600 head of household), and 20 percent above that. Gains on collectibles such as art, coins and precious metals are taxed at up to 28 percent, and unrecaptured section 1250 gain at up to 25 percent. The net investment income tax of 3.8 percent may apply on top (lesson 8).

The holding period of property received by gift includes the donor's holding period if the donor's basis carries over, and inherited property is always treated as held long-term. The preferential rates are justified on several grounds: part of a nominal gain merely reflects inflation; corporate profits behind share gains have already borne corporate tax; and high rates would lock investors into assets they would otherwise sell. Critics respond that the preference mainly benefits high-income taxpayers and invites efforts to convert ordinary income into capital gains.

Identifying shares sold

When a taxpayer owns shares of the same stock bought at different times, the regulations require the shares sold to be identified. If the taxpayer adequately identifies specific shares, by instructing the broker at the time of sale and receiving written confirmation, the basis and holding period of those shares are used. Otherwise, the first-in, first-out (FIFO) rule applies: the earliest shares bought are treated as sold first. Shares of regulated investment companies (mutual funds) and stock in dividend reinvestment plans may instead use the average basis method. Choosing high-basis lots for a sale, or long-term lots when a gain is unavoidable, can reduce tax significantly.

The program below computes Leah's 2026 capital gains. She owns 500 shares of Maple Grid Corp., an invented public company, bought in two lots, and sells 400 of them without identifying lots. She also sells index ETF units at a long-term gain, sells shares of Bayline Energy at a loss but buys them back within the month, and sells a digital asset at a short-term loss.

# Leah's 2026 sales: FIFO versus specific identification, a wash sale, netting (illustrative)
lots = [("2019-05-10", 300, 40.00, 15), ("2021-08-02", 200, 55.00, 15)]   # date, shares, price, fee
sold, price, fee = 400, 68.00, 20
amount_realized = sold * price - fee

def basis_of(selection):
    total = 0.0
    for (date, n, px, f), take in zip(lots, selection):
        total += take * (px + f / n)
    return total

fifo = basis_of([300, 100])
spec = basis_of([200, 200])
print(f"Amount realized               {amount_realized:>10,.2f}")
print(f"FIFO basis (300 + 100)        {fifo:>10,.2f}  gain {amount_realized - fifo:>9,.2f}")
print(f"Specific ID basis (200 + 200) {spec:>10,.2f}  gain {amount_realized - spec:>9,.2f}")

gain_maple = amount_realized - fifo          # Leah did not identify lots, so FIFO applies
gain_etf = 3_644.00                          # long-term
wash_loss, short_term_other = -1_500.00, -800.00
print(f"Bayline loss {wash_loss:,.2f} disallowed under the wash sale rule; basis of new shares rises")
long_term = gain_maple + gain_etf
short_term = short_term_other                # a short-term loss on crypto held 5 months
net = long_term + short_term
print()
print(f"Net long-term gain   {long_term:>10,.2f}")
print(f"Net short-term loss  {short_term:>10,.2f}")
print(f"Net capital gain     {net:>10,.2f}  (taxed at the preferential rates)")
Output
Amount realized                27,180.00
FIFO basis (300 + 100)         17,522.50  gain  9,657.50
Specific ID basis (200 + 200)  19,025.00  gain  8,155.00
Bayline loss -1,500.00 disallowed under the wash sale rule; basis of new shares rises

Net long-term gain    13,301.50
Net short-term loss     -800.00
Net capital gain      12,501.50  (taxed at the preferential rates)

Because Leah did not identify lots, FIFO treats the 300 shares bought in 2019 and 100 of those bought in 2021 as sold, giving a basis of $17,522.50, including a proportionate share of the purchase commissions, and a long-term gain of $9,657.50. Had she identified the 200 high-cost 2021 shares and 200 of the 2019 shares, the gain would have been $8,155, about $225 less federal tax at 15 percent. With the ETF gain her net long-term gain is $13,301.50; the $800 short-term loss on the digital asset offsets it, leaving a net capital gain of $12,501.50, all taxed at the preferential rates. The $1,500 Bayline loss is disallowed under the wash sale rule, explained below.

Netting and capital losses

Gains and losses are netted in stages. Short-term gains and losses are netted with each other, and long-term gains and losses with each other. If one category is a net gain and the other a net loss, they are netted against each other. A net capital gain, meaning net long-term gain in excess of net short-term loss, gets the preferential rates. If the overall result is a loss, up to $3,000 a year ($1,500 married filing separately) offsets ordinary income, and the rest carries forward indefinitely, keeping its short-term or long-term character. Unused capital losses of a deceased individual expire with the final return.

Losses on personal-use property, such as a car, a boat or a personal residence, are not deductible, although gains on such property are taxable unless an exclusion applies. Losses on stock that becomes worthless are treated as arising on the last day of the tax year. Section 1244 allows an individual who was the original purchaser of stock in a small business corporation to deduct a loss on that stock as an ordinary loss, up to $50,000 a year ($100,000 joint), rather than a capital loss subject to the $3,000 limit. At the other end, section 1202 excludes all or part of the gain on qualified small business stock held for several years; the 2025 act expanded the exclusion for stock issued after 4 July 2025, allowing a partial exclusion after three years and raising the per-issuer cap. ACCT-352 covers small business stock in more detail.

Flow diagram of US capital gain netting. Short-term gains and losses net to a short-term result; long-term gains and losses net to a long-term result. The two results are netted. A net long-term gain is taxed at 0, 15 or 20 percent; a net short-term gain at ordinary rates; a net loss offsets up to 3,000 dollars of ordinary income with the rest carried forward.
Netting capital gains and losses on Schedule D.

Section 1091 disallows a loss on the sale of stock or securities if, within the 61-day period beginning 30 days before and ending 30 days after the sale, the taxpayer acquires substantially identical stock or securities, or a contract or option to acquire them. The disallowed loss is added to the basis of the replacement shares, and the holding period of the old shares is added to the new ones, so the loss is deferred rather than lost. The IRS has ruled that buying the replacement shares in one's own IRA triggers the rule, and in that case the loss is lost permanently because the IRA basis does not increase. Digital assets such as cryptocurrency are property, not stock or securities, so the wash sale rule has not applied to them, although proposals to extend it have been made. Separately, section 267 disallows losses on sales to related parties, such as family members and controlled corporations; the related buyer can use the disallowed loss to reduce a later gain.

Leah sold 100 Bayline Energy shares for a $1,500 loss on 18 November 2026 and bought 100 again on 2 December. The loss is disallowed; the new shares' basis is their cost plus $1,500, and their holding period includes the old shares'. Had she waited 31 days, or bought a different energy company's shares or a broad energy fund that is not substantially identical, the loss would have been allowed. Tax-loss harvesting, realizing losses to offset gains, is legitimate planning; the rule simply requires the taxpayer to give up the investment for 30 days or substitute something that is not substantially identical.

Restrictions and special rules for capital losses.
RuleProvisionEffect
Wash sales. 1091Loss disallowed and added to basis of replacement; holding period tacks
Related-party sales. 267Loss disallowed; buyer may use it to reduce later gain
Personal-use propertys. 165(c)Losses not deductible; gains taxable
Capital loss limits. 1211(b)$3,000 of net loss against ordinary income per year
Capital loss carryovers. 1212(b)Indefinite, keeping its character
Section 1244 stocks. 1244Ordinary loss up to $50,000 ($100,000 joint) on qualifying small business stock

Installment sales and other timing rules

When property other than inventory or publicly traded securities is sold and at least one payment is received after the year of sale, the installment method in section 453 applies automatically unless the taxpayer elects out. Each payment is divided into a return of basis and gain in proportion to the gross profit ratio, so the gain is recognized as cash is received. Depreciation recapture is recognized in full in the year of sale, and interest is charged on the deferred tax for large installment obligations. Other timing rules include the constructive sale rules of section 1259, which treat certain hedges of appreciated positions as sales, and the mark-to-market regime for dealers and electing traders.

Worked problem

Tax on the Brandts' capital gain

The Brandts' 2026 net capital gain is $12,501.50 and their qualified dividends are $2,000. Their ordinary taxable income, excluding these, is about $110,358. What federal tax applies to the gain? What would change if their ordinary taxable income were only $90,000?

Show solution
  1. Preferential income is stacked on top of ordinary taxable income. The 0 percent band ends at $98,900 for joint filers.
  2. With ordinary taxable income of $110,358, the 0 percent band is already used, so all $14,501.50 of preferential income is taxed at 15 percent.
  3. Tax on the gain: 15% × $12,501.50 = $1,875.23 (and $300 on the dividends).
  4. If ordinary taxable income were $90,000, the first $8,900 of their $14,501.50 of preferential income would fall in the 0 percent band, and the rest would be taxed at 15 percent.

Answer: About $1,875 of federal tax on the gain at 15 percent; less if more of the 0 percent band were available.

Common mistakes

  • MistakeUsing the average cost of all shares held.

    InsteadFIFO applies unless specific shares were identified at the time of sale; average basis is only for fund shares and DRIPs.

  • MistakeDeducting a $10,000 net capital loss in full against wages.

    InsteadOnly $3,000 a year offsets ordinary income; the rest carries forward.

  • MistakeRepurchasing within 30 days in an IRA to avoid the wash sale rule.

    InsteadThe IRS treats IRA purchases as triggering the rule, and the loss is then lost permanently.

  • MistakeClaiming a loss on the sale of a personal car.

    InsteadLosses on personal-use property are not deductible.

  • MistakeApplying the 15 percent rate to a short-term gain.

    InsteadGains on assets held one year or less are taxed at ordinary rates.

Summary and key terms

  • Gain is the amount realized minus adjusted basis; long-term means held more than one year.
  • Long-term gains and qualified dividends are taxed at 0, 15 or 20 percent, with breakpoints at $98,900 and $613,700 for joint filers in 2026.
  • Collectibles are taxed at up to 28 percent and unrecaptured section 1250 gain at up to 25 percent.
  • Shares sold are identified specifically or by FIFO; fund shares may use average basis.
  • Leah's 2026 net capital gain is $12,501.50, all long-term.
  • Net capital losses offset $3,000 of ordinary income a year and carry forward indefinitely.
  • Wash sale losses are disallowed when substantially identical securities are bought within 30 days before or after.
  • The installment method spreads gain as payments are received, except recapture.
Capital asset
Property other than the categories excluded by section 1221, such as inventory and business property.
Adjusted basis
Cost adjusted for improvements, depreciation and other items under section 1016.
Amount realized
Money and fair market value of property received, plus liabilities assumed by the buyer, less selling costs.
Holding period
The time an asset is held, which determines whether a gain is short-term or long-term.
Wash sale
A sale at a loss with a purchase of substantially identical securities within 30 days before or after.
Net capital gain
Net long-term capital gain in excess of net short-term capital loss.
Capital loss
A loss on the disposition of capital property.
Proceeds of disposition
The amount received or deemed received on a disposition.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Shares bought: 100 at $10 (2020) and 300 at $14 (2023). Under FIFO, what is the basis of 150 shares sold?

    Show answer

    100 × $10 + 50 × $14 = $1,700.

  2. In the program, change the Maple Grid sale price to $45. What happens under FIFO?

    Show answer

    Amount realized $17,980 against basis $17,522.50 gives a gain of $457.50; net capital gain becomes $3,301.50.

  3. What happens to a decedent's unused capital loss carryover?

    Show answer

    It expires; it cannot be used after the final return.

  4. Leah sells stock at a loss on 1 December and buys it back on 5 January. Is the loss disallowed?

    Show answer

    No; the repurchase is more than 30 days after the sale.

  5. What is the maximum rate on long-term gains from collectibles?

    Show answer

    28 percent.

  6. When does the installment method not apply?

    Show answer

    To inventory, dealer property and publicly traded securities, and to depreciation recapture, which is recognized at once.

  7. Why can wash sale planning not use an IRA?

    Show answer

    The IRS treats IRA purchases as triggering the rule, and the loss cannot be added to IRA basis.

  8. What does section 1244 provide?

    Show answer

    Ordinary loss treatment, up to $50,000 ($100,000 joint), for losses on qualifying small business stock.

  9. Name two kinds of collectibles.

    Show answer

    For example art, antiques, coins, gems and precious metals.

  10. In the program, what would the Maple Grid gain be with specific identification?

    Show answer

    $8,155.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz