Yes, capital gains affect Social Security taxation. When you sell an asset at a profit, the realized gain flows into your Adjusted Gross Income, which raises a figure called provisional income. Once provisional income crosses $25,000 for single filers or $32,000 for married couples filing jointly, up to 50% of your benefits become taxable; above $34,000 or $44,000, up to 85% do.1Office of the Law Revision Counsel. 26 USC 86 – Social Security and Tier 1 Railroad Retirement Benefits Those thresholds have never been indexed for inflation, so more retirees cross them every year.
How a Realized Gain Reaches Your Benefits
The IRS decides how much of your Social Security is taxable through one number: provisional income. The formula adds your Adjusted Gross Income, any tax-exempt interest, and half of the Social Security benefits you received during the year.2Internal Revenue Service. Social Security Income That total is then compared against the statutory thresholds.
Capital gains enter through AGI. When you sell a stock, mutual fund, or piece of property at a profit, the gain lands on Form 1040 and becomes part of AGI.3Internal Revenue Service. Instructions for Form 1040 It doesn’t matter whether the gain qualifies for long-term rates or is taxed as ordinary income. The full amount counts toward AGI, and therefore toward provisional income. Qualified dividends work the same way: preferential rates, but fully included in AGI.
Unrealized gains do nothing. If your brokerage account is up $200,000 on paper but you haven’t sold, your AGI and provisional income are unchanged. The tax consequence begins the moment you sell. That timing is the single biggest planning lever a retiree has.
The Thresholds That Trigger Taxation
The thresholds are set by federal statute and have not moved since 1993.1Office of the Law Revision Counsel. 26 USC 86 – Social Security and Tier 1 Railroad Retirement Benefits
Single filers and heads of household:
- Below $25,000: none of your benefits are taxable.
- $25,000 to $34,000: up to 50% of your benefits become taxable income.
- Above $34,000: up to 85% of your benefits become taxable income.
Married filing jointly:
- Below $32,000: none of your benefits are taxable.
- $32,000 to $44,000: up to 50% of your benefits become taxable income.
- Above $44,000: up to 85% of your benefits become taxable income.
Married taxpayers who file separately and lived with their spouse at any point during the year face the harshest rule: a $0 threshold, meaning up to 85% of benefits are immediately taxable regardless of income.4Internal Revenue Service. IRS Reminds Taxpayers Their Social Security Benefits May Be Taxable If you filed separately but lived apart for the entire year, you use the same $25,000 and $34,000 thresholds as single filers.5Internal Revenue Service. Publication 915 – Social Security and Equivalent Railroad Retirement Benefits
The 85% figure is a ceiling. No matter how large your capital gain, the IRS will not tax more than 85% of your benefits.1Office of the Law Revision Counsel. 26 USC 86 – Social Security and Tier 1 Railroad Retirement Benefits
What a Single Gain Can Do to Your Return
Retirees sometimes call the effect a “tax torpedo” because one sale can turn benefits that were largely tax-free into ordinary income.
Take a married couple filing jointly with $36,000 in Social Security and $24,000 in pension income. Their provisional income is $24,000 plus $18,000 (half of Social Security), or $42,000. That falls between $32,000 and $44,000, so up to 50% of their benefits are taxable, putting roughly $5,000 of Social Security on their return.
Now the same couple sells a stock for a $60,000 long-term gain. Provisional income jumps to $102,000, well past the $44,000 ceiling. Up to 85% of their $36,000 in benefits, or $30,600, is now taxable. The gain itself is still taxed at long-term rates, but it has dragged an additional $25,000 or so of Social Security into ordinary income. The real cost of the sale is the capital gains tax plus the ordinary tax on the newly taxable benefits, stacked.
Selling Your Home
The largest single gain many retirees ever realize is the sale of a home, and this is where a specific exclusion matters. You can exclude up to $250,000 of gain (single) or $500,000 (married filing jointly) if you owned and used the home as your primary residence for at least two of the five years before the sale.6Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
The excluded portion never appears on your return. It is not part of AGI, so it does not raise provisional income.7Internal Revenue Service. Selling Your Home A married couple selling for a $400,000 profit and qualifying for the full exclusion see zero effect on Social Security taxation.
The trouble starts when the gain exceeds the exclusion, or when you don’t meet the ownership and use test. A $350,000 gain on a single-filer sale puts $100,000 into AGI. If the ownership test isn’t met, the whole profit counts. Verify eligibility before you close, because a six-figure surprise addition to AGI can push benefits deep into the 85% tier.
How Losses Help
Losses from investment sales offset gains dollar for dollar, reducing the net capital gain that reaches AGI. Sell one stock for a $40,000 gain and another for a $25,000 loss, and only $15,000 of net gain flows through.
When losses exceed gains for the year, the IRS caps the amount you can deduct against other income at $3,000 per year, or $1,500 if married filing separately.8Internal Revenue Service. Topic No. 409, Capital Gains and Losses Excess loss carries forward. The $3,000 deduction lowers AGI and provisional income, but it’s small compared to the size of gains most retirees realize. Harvesting losses in the same year you take gains gives you far more room than saving the losses for later.
Ways to Limit the Hit
Every strategy below points at the same goal: keeping provisional income below a threshold, or at least out of the 85% tier, in any given year.
Harvest Losses Alongside Gains
Selling losing positions in the same year as winners offsets the gain directly. You don’t need to wait until December. If a large gain hits in March, review the portfolio then. Watch the wash sale rule: repurchasing a substantially identical security within 30 days before or after the sale disallows the loss.
Spread Gains Across Years
Selling a position in tranches over two or three years prevents a single-year spike. For real estate, an installment sale recognizes gain only as payments come in, spreading AGI over the term of the note.9Internal Revenue Service. Topic No. 705, Installment Sales Careful timing can keep each year in the 50% tier, or below the threshold entirely.
Realize Gains Before Benefits Start
If you haven’t yet filed for Social Security, large gains are cheaper because there are no benefits to push into taxable territory. A year when your pension income or Required Minimum Distributions happen to be lower also leaves more room to absorb a gain.
Keep Growth Assets in Roth Accounts
Gains inside a Roth IRA or Roth 401(k) never appear on your tax return. Qualified Roth distributions are tax-free and excluded from AGI, so they have no effect on provisional income. Aggressive growth positions held in a Roth will never contribute to Social Security taxation, regardless of size. Roth conversions of traditional IRA assets accomplish the same thing over time, though the conversion year raises AGI.
Use Qualified Charitable Distributions
If you’re 70½ or older and would otherwise take RMDs from a traditional IRA, a Qualified Charitable Distribution sends the money straight to charity and keeps it out of AGI. For 2026, you can transfer up to $111,000 per person. The distribution satisfies your RMD but is excluded from gross income, freeing up room that can absorb a capital gain without crossing a threshold.
Stay Within the 0% Long-Term Bracket
For 2026, single filers with taxable income up to $49,450 and joint filers up to $98,900 pay 0% federal tax on long-term capital gains.10Internal Revenue Service. Revenue Procedure 2025-32 Retirees whose main income is Social Security itself can often harvest gains slowly within this bracket, paying no capital gains tax while keeping the provisional income increase modest.
Medicare Premiums Are the Second Bill
Capital gains also feed the income figure Medicare uses to set Part B and Part D premiums. The Income-Related Monthly Adjustment Amount (IRMAA) is based on Modified Adjusted Gross Income, which is AGI plus tax-exempt interest.11Social Security Administration. Modified Adjusted Gross Income (MAGI)
For 2026, single filers with MAGI above $109,000 and joint filers above $218,000 pay surcharges on top of the standard Part B premium of $202.90 per month, and the top tier reaches $689.90 for Part B plus $91.00 added to Part D.12Centers for Medicare & Medicaid Services (CMS). 2026 Medicare Parts A and B Premiums and Deductibles
The delay catches people off guard: IRMAA uses tax data from two years prior, so a 2024 gain drives your 2026 premium even if your income has since dropped. If a one-time life event such as retirement, divorce, or the death of a spouse caused the spike, Form SSA-44 lets you request a recalculation. A voluntary asset sale on its own is not a qualifying event.
State Taxes Can Add Another Layer
Roughly nine states impose their own income tax on Social Security benefits as of 2026, though most offer exemptions tied to age or income. Colorado, Connecticut, Minnesota, Montana, New Mexico, Rhode Island, Utah, and Vermont each use different thresholds and phase-outs. West Virginia completed a multi-year phase-out and fully exempts benefits starting with 2026 returns. In one of these states, a capital gain that raises your state AGI can trigger state-level benefit taxation on top of the federal effect. The remaining states either have no income tax or fully exempt Social Security.