Capital Gains Netting
Before you calculate how much capital gains tax you owe, the IRS requires you to net—offset—all your short-term and long-term gains and losses together. The result determines whether you have a net gain (taxable), a net loss (potentially deductible), or break even. The netting follows strict rules about which gains and losses offset first.
The netting process is a mechanical but essential step on your Schedule D. It determines your final capital gain or loss for the year, which then feeds into your income calculation and ultimately your tax bill. Understanding the order of netting can occasionally help you plan trades.
The two categories: short-term and long-term
The IRS divides capital gains and losses into two buckets based on how long you held the asset. Short-term gains and short-term losses arise from assets held one year or less. Long-term gains and long-term losses come from assets held more than one year. These categories are taxed differently: short-term gains are taxed as ordinary income, while long-term gains receive preferential rates (typically 0%, 15%, or 20%, depending on your income).
Netting happens first within each category, then across categories.
The netting sequence
Step 1: Net within short-term. Combine all short-term gains and short-term losses for the year. If you realized a $5,000 gain on one stock and a $2,000 loss on another, both held less than a year, your net short-term result is a $3,000 gain.
Step 2: Net within long-term. Do the same for long-term items. Say you sold a property for a $20,000 gain (held three years) and had a mutual fund drop $8,000 (held five years and sold). Your net long-term result is a $12,000 gain.
Step 3: Net across categories. Here the rules become more nuanced. If you have both a net short-term loss and a net long-term gain (or vice versa), they offset each other. The order of offset matters and is set by statute.
If you have a net short-term loss and a net long-term gain, the short-term loss offsets the long-term gain dollar-for-dollar. A $3,000 net short-term loss against a $12,000 net long-term gain leaves you with a $9,000 net long-term gain.
If you have a net short-term gain and a net long-term loss, the long-term loss offsets the short-term gain. A $3,000 net long-term loss against a $12,000 net short-term gain leaves you with a $9,000 net short-term gain.
If both are gains or both are losses, they do not offset; they simply add together. Two gains total. Two losses total and are treated as a combined net loss eligible for the capital loss deduction.
Why the order matters for losses
When you have one category in gain and one in loss, the law specifies that losses are used to offset gains without regard to whether the loss is short-term or long-term. In practice, tax software and IRS guidance treat it as a simultaneous offset: the smaller of the two numbers reduces the larger, and the remainder keeps its category.
This matters psychologically but not numerically. If you have a $2,000 net short-term loss and a $10,000 net long-term gain, you end up with an $8,000 net long-term gain. If you have a $2,000 net long-term loss and a $10,000 net short-term gain, you end up with an $8,000 net short-term gain. The netting is symmetric—order doesn’t affect the calculation, only which category the remainder falls into.
However, the result does affect your tax bill. An $8,000 short-term gain is taxed as ordinary income. An $8,000 long-term gain receives the preferential long-term rate. So which loss you harvest, and which gain is left standing, can meaningfully change your tax.
Illustrated example
Suppose you have:
- $6,000 gain on shares of Stock A (held 8 months, short-term)
- $3,000 loss on a bond fund (held 4 months, short-term)
- $15,000 gain on real estate (held 3 years, long-term)
- $2,000 loss on a preferred stock (held 2 years, long-term)
Step 1 (short-term netting): $6,000 − $3,000 = $3,000 net short-term gain.
Step 2 (long-term netting): $15,000 − $2,000 = $13,000 net long-term gain.
Step 3 (across-category netting): You have a net short-term gain and a net long-term gain. No offset occurs. Your final result is $3,000 short-term + $13,000 long-term = $16,000 total net gain.
The $3,000 short-term is taxed as ordinary income. The $13,000 long-term is taxed at the preferential long-term rate.
Now suppose the bond fund had a $7,000 loss instead:
Step 1 (short-term netting): $6,000 − $7,000 = $1,000 net short-term loss.
Step 2 (long-term netting): Still $13,000 net long-term gain (unchanged).
Step 3 (across-category netting): The $1,000 short-term loss offsets $1,000 of the $13,000 long-term gain, leaving $12,000 net long-term gain.
Your final result is $12,000 net gain, all taxed at the long-term rate. The short-term loss eliminated the tax-least-favorable short-term gain from the picture, a happy accident—but also one you might plan for.
Netting and the capital loss deduction
After netting, if your final result is a net loss, you can deduct up to $3,000 of it against ordinary income in the current year. Any excess carries forward to future years. Again, the IRS does not distinguish between short-term and long-term once the net loss is calculated—a $5,000 net loss is a $5,000 net loss, regardless of which bucket it came from.
Netting on Schedule D
The IRS Schedule D is structured to enforce this netting automatically. You report short-term gains and losses in one section, calculate their net, then do the same for long-term, and finally combine them. Most tax software populates this for you once you enter your transactions.
The mechanical nature of netting means there is little discretion in how it happens—the rules are deterministic. However, the timing of when you realize gains and losses remains under your control. A well-timed tax loss harvest (selling a losing position before year-end) can swing your final netting result from a taxable gain to a deductible loss or smaller gain. This is the main planning lever available to investors.
See also
Closely related
- Capital Loss Carryforward — how unused net losses carry forward to future years
- Three-Thousand-Dollar Loss Deduction — the annual cap on deducting net losses
- Cost Basis — determining your gain or loss on each sale
- Schedule D — the IRS form where netting occurs
- Tax Loss Harvesting — deliberately realizing losses to improve your netting outcome
Wider context
- Capital Gains Tax (Investor) — taxation of investment gains
- Qualified Dividend — preferential income treated similarly to long-term gains
- Wash Sale — rules preventing loss recognition on quickly repurchased securities
- Long-Term Capital Gain Tax — preferred tax rates for long-term holdings