At 65, He’ll Sell One Stock for a $120,000 Gain and Another for a $100,000 Loss. Medicare Will See Only the $20,000 Net Gain, and His Premium Won’t Move

A friend's warning about a six-figure stock gain spiking Medicare premiums sent this retiree into a panic, but the IRS calculates capital gains in a way that Social Security may never even notice the transaction.

Published October 10, 2026, 10:00am ET · 4 min read

The Full Benefits Desk desk. Editor: Gerelyn Terzo.

This post may contain links from our sponsors and affiliates, and Flywheel Publishing may receive compensation for actions taken through them.

A close-up of a smiling elderly man with white hair and wrinkles on the right side of the frame. On the left, a blurred background reveals a financial planning mind map on white paper, with 'PERSONAL FINANCIAL PLANNING' at its center, connected to various red-outlined bubbles such as 'MAJOR PURCHASES,' 'ESTATE,' and 'EDUCATION.' A black calculator displaying '852291' and a small stack of coins are also visible on a light wooden surface.
A smiling senior individual is juxtaposed with a personal financial planning mind map, a calculator, and coins, illustrating thoughtful wealth management for retirement and considerations like Medicare. © Canva | RapidEye from Getty Images Signature and Narcisa Palici's Images

He’s 65, married, with both spouses on Medicare. Before year-end he wants to clean up a taxable brokerage account. One stock shows a $120,000 gain. Another shows a $100,000 loss. A friend warned that a six-figure gain will increase his Medicare premiums. If he sells both in the same tax year, the tax return shows a $20,000 net gain. For these two sales, Medicare sees the $20,000 net capital gain that flows into adjusted gross income (AGI), not the $120,000 gross gain.

Whether that $20,000 matters for Medicare depends on where the rest of his household income lands.

Medicare’s Income-Related Monthly Adjustment Amount (IRMAA) reaches about 8% of people with Part B. If your household income is well below $218,000 on a joint return or $109,000 as a single filer, this decision doesn’t affect your premiums. The offset rule still shapes your tax bill.

How His Tax Return Turns $120,000 Into $20,000

IRS rules require investors to add up short-term gains and losses separately from long-term ones, then combine the results. If the total of your capital gains is more than the total of your capital losses, the difference is taxable. His AGI picks up only that difference. If losses topped gains, he could deduct up to $3,000 ($1,500 if married filing separately) a year and carry the rest forward.

Medicare Reads One Line, and It Shows the Net

IRMAA is set by Social Security based on modified adjusted gross income (MAGI). Your MAGI is your total AGI and tax-exempt interest income. Interest from municipal bonds counts even though it feels tax-free. The agency looks back two years at your filed income, so 2024 income set 2026 premiums, and a sale in 2026 shows up in 2028.

Suppose the couple’s pensions, IRA withdrawals and taxable Social Security put their MAGI at $190,000 before any trades. Adding the $20,000 net gain brings them to $210,000, which is under the $218,000 joint line. Each of them keeps paying the standard $202.90 Part B premium with no Part D surcharge. Their premiums stay where they are.

If he sells only the winner, their MAGI rises to $310,000. That lands in the $274,000 to $342,000 level, which adds $202.90 a month to Part B and $37.50 a month to Part D for each spouse.

Scenario Household MAGI Monthly extra premium for each individual (Part B + Part D) Annual surcharge, couple
Both sales, $190,000 base $210,000 $0 $0
Both sales, $205,000 base $225,000 $81.20 + $14.50 $2,296.80
Winner only, $190,000 base $310,000 $202.90 + $37.50 $5,769.60

That last row works out to $2,884.80 per spouse for a full year, all from a single year of income. IRMAA is one of several Medicare surcharges that catch retired people off guard (we laid out the rest in a free guide here: Medicare’s Hidden Bills).

Why $20,000 Can Still Hurt Close to a Bracket

Capital gains simply add to MAGI. Whether the $20,000 matters depends on where the rest of your income is. With a $190,000 base, the couple has $28,000 of room. With a $205,000 base, the same net gain pushes them over the line into the lowest surcharge bracket. Crossing a threshold by even a dollar triggers the full level amount.

Timing can also break the netting. Gains and losses only offset each other within the same tax year. If he sells the winner in December and the loser in January, his 2026 MAGI lands at $310,000. On the 2027 return he can deduct just $3,000 of the loss, which leaves MAGI at $187,000 and carries $97,000 forward. The loss shows up a year too late to help his 2028 premium. Form SSA-44 applies only when income drops because of certain life events, such as stopping work or the death of a spouse. A voluntary stock sale never qualifies.

Run These Numbers Before December 31

  1. Total your realized gains and losses so far this year. Download the year-to-date report from your brokerage. Add estimated pension income, IRA withdrawals, taxable Social Security and interest from municipal bonds. Then compare the total with the 2026 brackets as a rough guide to 2028.
  2. Keep offsetting sales in one calendar year. Your holding period ends on the trading date, so the trade date determines which return a sale lands on. If you plan to buy back a position you sold at a loss, check the wash-sale rule first.
  3. Look at all your sales together. A big gain only matters for Medicare after it’s offset against your losses. If your estimated MAGI is within $20,000 of a bracket, a fee-only advisor who models tax-efficient retirement income can test different orders of sales before the year ends.

For Medicare, the timing of the loss can matter just as much as the size of the gain.

Contact [email protected] for any questions or corrections.

Gerelyn Terzo

Gerelyn Terzo is the author of dividend investing handbook "Dividend Investing Strategies: How to Have Your Cake & Eat It Too." A veteran financial journalist, she covers agri-finance for outlets like Global AgInvesting and the broader stock market and personal finance for 24/7 Wall Street. She began at CNBC and later helped launch Fox Business in New York. Gerelyn currently resides in Woodland Park, Colorado and dabbles in nature photography as a hobby.

All articles →