Is Margin Interest Deductible Against Capital Gains?

Margin interest is deductible against capital gains, but how much you can deduct depends on which kind of gains you have. Short-term capital gains count toward the limit automatically. Long-term capital gains and qualified dividends do not, unless you file an election that gives up their lower tax rate. Either way, the deduction is capped each year at your net investment income, and anything you cannot use rolls forward.

The Net Investment Income Cap

The IRS limits your investment interest deduction to your net investment income (NII) for the year. Pay $8,000 in margin interest with only $3,000 of NII, and $3,000 is deductible now while the remaining $5,000 carries forward to next year.1Office of the Law Revision Counsel. 26 USC 163 – Interest

Net investment income is your gross investment income minus your investment expenses (other than interest itself). Investment income includes taxable interest, non-qualified dividends, and short-term capital gains from investment property. It does not include long-term capital gains or qualified dividends by default, because those already receive preferential tax rates.2Internal Revenue Service. Form 4952 – Investment Interest Expense Deduction That single exclusion is the whole reason long-term gains and margin interest do not mix without extra steps.

Short-Term Gains Count Automatically

Short-term capital gains are taxed at ordinary income rates, so they flow into your NII with nothing else required.3Internal Revenue Service. Topic No. 409, Capital Gains and Losses If you sold positions held a year or less and cleared $10,000 in short-term gains, that $10,000 raises the ceiling on your margin interest deduction dollar for dollar. Add any taxable interest or non-qualified dividends on top. No election, no trade-off, no lost preferential rate. This is the clean case.

Long-Term Gains Require an Election

Long-term capital gains and qualified dividends stay out of NII unless you affirmatively pull them in. You do this by electing on your tax return to treat some or all of them as ordinary investment income. The IRS lets you pick a specific dollar amount rather than forcing an all-or-nothing choice.2Internal Revenue Service. Form 4952 – Investment Interest Expense Deduction

The cost is exactly what it sounds like. Every dollar you elect to include in NII loses its preferential rate and gets taxed at your ordinary rate. Many investors would see those elected dollars jump from 15% to 22%, 24%, or higher. You are trading cheap-taxed income for a larger interest deduction, and the trade only works when the deduction is worth more than the rate difference.

The election is made on line 4g of Form 4952. Once made, it can be revoked only with IRS consent, so it sticks for that tax year. You generally have to make it on a timely filed return, though the IRS allows a late election on an amended return filed within six months of the original due date, not counting extensions.2Internal Revenue Service. Form 4952 – Investment Interest Expense Deduction

When the Election Pays Off

The math turns on your ordinary bracket, the size of the disallowed interest, and how long you expect a carryforward to sit idle. For 2026, long-term capital gains are taxed at 0%, 15%, or 20% depending on taxable income, while ordinary rates run from 10% to 37%.4Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026, Including Amendments from the One, Big, Beautiful Bill

Take an investor in the 24% ordinary bracket with $20,000 of long-term gains normally taxed at 15% and $12,000 of margin interest that would otherwise be disallowed. Elect $12,000 of the long-term gains into NII. The extra tax on those reclassified gains is $1,080 (the 9-point spread between 24% and 15%, times $12,000). The deduction saves $2,880 (24% of $12,000). Net benefit: $1,800.

The election tends to be favorable when:

  • Your ordinary rate is low. In the 10% or 12% bracket, the gap between ordinary and preferential rates is small or zero, and the trade-off is nearly painless.
  • You are sitting on a large carryforward. Years of accumulated disallowed interest make a deduction today more valuable than the theoretical future benefit of waiting.
  • Your gains would be taxed at 0% anyway. Single filers with 2026 taxable income under $49,450 (or $98,900 for joint filers) already pay 0% on long-term gains, so reclassifying those gains costs nothing in lost preference if the income stays in the 0% bracket.

The election usually hurts if you sit in the 32% to 37% brackets while your gains would otherwise be taxed at 15%. That spread of 17 to 22 points typically outweighs a current-year deduction unless the carryforward is enormous and unlikely to be absorbed later.

Not All Margin Interest Qualifies

Even interest from a genuine margin account is not automatically investment interest. The IRS allocates interest by how the borrowed money was used, not by what secures the loan. Borrow on margin to buy stocks and the interest is investment interest. Borrow on margin, withdraw the cash, and buy a car, and the interest becomes non-deductible personal interest.5eCFR. 26 CFR 1.163-8T – Allocation of Interest Expense Among Expenditures (Temporary)

The regulations put it bluntly: a taxpayer who pledges investment stock as collateral for a loan but spends the proceeds on personal expenses gets no investment interest deduction. Collateral does not matter. Use does. If you have run any margin cash through personal spending, you need to trace each disbursement to figure out what portion of the interest still qualifies.

Interest on borrowing used to buy tax-exempt securities such as municipal bonds is non-deductible regardless of category.6Internal Revenue Service. Topic No. 505, Interest Expense

You Have to Itemize

Investment interest is an itemized deduction, so it only helps if your itemized total beats the standard deduction. For 2026, the standard deduction is $16,100 for single filers and $32,200 for married couples filing jointly.4Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026, Including Amendments from the One, Big, Beautiful Bill

If your margin interest is $3,000 but your total itemized deductions reach only $14,000, the standard deduction wins and the margin interest write-off effectively disappears. Investors without a mortgage or in low-tax states often struggle to justify itemizing, which puts the deduction out of reach in practice even when the NII math works.7Internal Revenue Service. Deductions for Individuals: The Difference Between Standard and Itemized Deductions, and What They Mean The disallowed interest still carries forward, so a year when itemizing does make sense can absorb it later.

How to File It

Anyone deducting investment interest completes Form 4952, which runs the NII calculation and produces the allowable amount.8Internal Revenue Service. About Form 4952, Investment Interest Expense Deduction Line 1 is your total investment interest for the year, including carryforward from prior years. Lines 4a through 4f build the NII figure. Line 4g is where you enter any long-term gains or qualified dividends you are electing to include. Line 8 is your allowable deduction, and it moves to Schedule A (Form 1040), line 9. Anything disallowed carries forward automatically and lands on next year’s line 1.2Internal Revenue Service. Form 4952 – Investment Interest Expense Deduction

If you use the line 4g election, you also have to switch to the Schedule D Tax Worksheet in the Schedule D instructions instead of the standard Qualified Dividends and Capital Gain Tax Worksheet when figuring the tax on Form 1040, line 16. That extra step is what actually taxes the elected gains at ordinary rates.

Carrying Forward Unused Interest

Margin interest that exceeds your NII carries forward indefinitely. The carryover keeps its character as investment interest expense and gets pulled into next year’s Form 4952, where it faces the NII ceiling again.1Office of the Law Revision Counsel. 26 USC 163 – Interest

There is no expiration date, but the carryforward does not survive the taxpayer’s death. Die with unused investment interest and the deduction is lost. For married couples with joint brokerage accounts, the surviving spouse can generally carry forward only their share of the expense, not the deceased spouse’s.

Big carryforward balances are common for investors who run substantial margin against a growth-stock portfolio that generates little current income. If that describes you, it is worth rerunning the election math every year. A low-income year, or a year when your long-term gains would fall into the 0% bracket, can turn a frozen deduction into real tax savings.

The 3.8% Net Investment Income Tax Is a Separate Calculation

Higher-income investors face a parallel rule. The 3.8% Net Investment Income Tax (NIIT) applies to individuals with modified adjusted gross income above $200,000 (single) or $250,000 (married filing jointly).9Internal Revenue Service. Topic No. 559, Net Investment Income Tax The NIIT uses its own definition of net investment income, broader than the Section 163(d) version, and it already includes long-term capital gains and qualified dividends without any election.

The Section 163(d) margin interest deduction reduces your Schedule A taxable income but does not reduce the NII figure used for the 3.8% surtax. They are separate code sections and separate calculations. If you are above the NIIT thresholds, factor the surtax into any election analysis, because pulling long-term gains into Section 163(d) investment income does not pull them out of NIIT exposure.