Can Medical Expenses Offset Capital Gains? (w/Examples) + FAQs

No, your medical expenses cannot directly offset your capital gains. A capital loss is used to directly cancel out a capital gain on one tax form, but medical expenses work differently on a separate form to lower your total income, which can indirectly reduce the tax you pay on those gains.

The primary conflict is created by 26 U.S. Code § 213, which establishes the 7.5% Adjusted Gross Income (AGI) “floor” for medical deductions. This rule means the very capital gain you hope to shelter with your medical bills actually increases your AGI. A higher AGI makes it harder to claim the deduction, creating a frustrating tax planning paradox where your investment success actively weakens your potential tax relief from healthcare costs.

This is a significant hurdle, especially since the Tax Cuts and Jobs Act (TCJA) made it so only about 10% of taxpayers now benefit from itemizing deductions at all. Many people with high medical bills are surprised to find they get no tax benefit from them.  

Here is what you will learn to solve this complex problem:

  • 🏥 Understand the two major hurdles—the 7.5% AGI floor and the standard deduction—that stop most people from ever getting this tax break.
  • 📉 Discover the real, indirect way medical deductions can lower your capital gains tax by causing a “bracket drop,” potentially saving you thousands.
  • 💡 Walk through three real-world scenarios showing exactly how this works for retirees, high-earners, and average families, with clear before-and-after numbers.
  • ❌ Learn the six most common and costly mistakes people make, like trying to deduct gym memberships or expenses already paid by an HSA.
  • ⚖️ Compare this strategy side-by-side with more powerful tools like Tax-Loss Harvesting and Health Savings Accounts (HSAs) to see which is best for you.

The Two Worlds of Your Tax Return: Schedule D vs. Schedule A

Your tax return is like a big puzzle with many different pieces. Two of the most important pieces in this puzzle are Schedule D and Schedule A. They live in separate worlds and handle completely different parts of your financial life.

A capital gain is simply the profit you make when you sell something for more than you paid for it. This “something” is usually an investment, like stocks, bonds, or real estate, and is called a capital asset. All of these sales are reported on a tax form called Schedule D, Capital Gains and Losses.  

A medical expense deduction is a potential tax break for the money you spent on healthcare. It is a type of itemized deduction, which is a list of specific expenses you can subtract from your income. These are all reported on a completely different form called Schedule A, Itemized Deductions.  

These two forms do not talk to each other directly. You can’t take a medical bill and subtract it from your stock profit on Schedule D. The magic happens much later, after the numbers from both forms flow onto your main Form 1040 tax return.

The Catch-22: How Your Capital Gain Sabotages Your Medical Deduction

Before you can deduct a single dollar of medical costs, you must overcome a major obstacle created by the IRS called the “AGI floor.” This rule is the main reason why this tax strategy is so tricky and often fails.

Your Adjusted Gross Income (AGI) is a critical number on your tax return. Think of it as your total income for the year—including wages, interest, and, importantly, your capital gains—minus a few specific adjustments like student loan interest or HSA contributions. This number is calculated before you get to most of your big deductions.  

The law states you can only deduct the portion of your unreimbursed medical expenses that is more than 7.5% of your AGI. This is the “floor.” If your AGI is $100,000, the floor is $7,500. If you had $10,000 in medical bills, the first $7,500 is completely ignored by the IRS; you can only begin to deduct the remaining $2,500.  

Here is the trap: that $50,000 capital gain you made from selling stock gets added into your AGI. This pushes your AGI higher, which in turn raises that 7.5% floor. A higher floor means more of your medical bills become non-deductible, making the deduction less powerful right when you need it most.

The Indirect Connection: How a “Bracket Drop” Can Lower Your Capital Gains Tax

While medical expenses can’t directly cancel out capital gains, they can lower the tax you pay on them through an indirect, multi-step process. The entire strategy hinges on lowering one key number on your tax return: your taxable income.

Your tax return follows a specific path. First, you calculate your Gross Income (all money in). Then you subtract adjustments to find your AGI. From your AGI, you subtract either the standard deduction or your total itemized deductions (including medical expenses) to arrive at your final Taxable Income.  

This final taxable income number is what determines your tax rate for long-term capital gains. The federal government has special, lower tax rates for profits on investments held for more than a year: 0%, 15%, or 20%. Which bracket you fall into depends entirely on your taxable income.  

This is where the medical deduction does its work. A very large medical expense deduction can significantly lower your taxable income. If it lowers it enough, it can push you from a higher capital gains bracket into a lower one. This is the “bracket drop” phenomenon, and it’s the only way your medical bills can truly reduce the tax on your investment profits.

The Big Choice: Taking the Easy Money or Doing the Math

Before you can even think about the 7.5% AGI floor, you have to make a bigger decision: should you take the standard deduction or itemize your deductions? You cannot do both, and for most people, this choice makes the medical expense deduction irrelevant.

The standard deduction is a fixed amount of money the government lets you subtract from your income, no questions asked. It’s the easy route. For 2024, these amounts are substantial :  

Filing Status2024 Standard Deduction
Single$14,600
Married Filing Jointly$29,200
Head of Household$21,900

Export to Sheets

Itemizing means you add up all your individual deductible expenses for the year, including state and local taxes (up to $10,000), mortgage interest, charitable donations, and your qualifying medical expenses. You should only itemize if your grand total is more than the standard deduction amount for your filing status. Because the standard deductions are so high, most people find that their itemized expenses don’t add up to enough to make it worthwhile.  

Standard DeductionItemized Deductions
What It Is: A fixed, no-hassle deduction amount set by the IRS based on your filing status.What It Is: A list of specific, eligible expenses you add up, including medical costs, state taxes, and mortgage interest.
Who Should Use It: Anyone whose total itemized deductions are less than the standard deduction amount. This is most taxpayers.Who Should Use It: Only those whose total itemized deductions are more than their standard deduction amount.

Export to Sheets

Real-World Scenarios: See How the Numbers Actually Work

Let’s look at three common situations to see the real-world impact. These examples use 2024 tax rules.

Scenario 1: The Retiree’s Stock Windfall

A retired couple, filing jointly, has $60,000 in pension income. They sell a long-held stock, creating a $90,000 long-term capital gain. One spouse has a major medical issue, resulting in $25,000 of unreimbursed medical bills. Their AGI is $150,000 ($60,000 + $90,000).

Financial EventTax Consequence
AGI Calculation: $150,000The 7.5% AGI floor is $11,250. This means the first $11,250 of their medical bills are not deductible.
Medical Deduction: $13,750Their deductible amount is $25,000 (total bills) – $11,250 (AGI floor).
Taxable Income: $103,950Their AGI of $150,000 is reduced by their standard deduction and their medical deduction.
Capital Gains Tax: A portion is now taxed at 0%.The medical deduction lowered their taxable income enough to push a part of their $90,000 gain into the 0% capital gains bracket (which goes up to $94,050 for joint filers), saving them thousands.

Export to Sheets

Scenario 2: The High-Earner’s Unexpected Surgery

A single professional earns a $400,000 salary and has a $50,000 long-term capital gain. An unexpected surgery leaves them with $45,000 in medical bills. They also have $15,000 in other itemized deductions (like state taxes). Their AGI is $450,000.

Financial EventTax Consequence
AGI Calculation: $450,000The 7.5% AGI floor is a massive $33,750. This high income makes a huge portion of the medical bills non-deductible.
Medical Deduction: $11,250Their deductible amount is $45,000 (total bills) – $33,750 (AGI floor).
Total Itemized Deductions: $26,250The $11,250 medical deduction is added to their other $15,000 in deductions. This is greater than the $14,600 standard deduction, so they itemize.
Capital Gains Tax: Drops from 20% to 15%.The deduction lowers their taxable income just enough to fall below the $518,900 threshold for the 20% capital gains bracket. Their entire $50,000 gain is now taxed at 15%, a direct savings of $2,500 on that gain alone.

Export to Sheets

Scenario 3: The “Is It Even Worth It?” Case

A Head of Household taxpayer earns $150,000 and has a $20,000 long-term capital gain. They have $15,000 in medical bills and $8,000 in state and local taxes. Their AGI is $170,000.

Financial EventTax Consequence
AGI Calculation: $170,000The 7.5% AGI floor is $12,750.
Medical Deduction: $2,250Their deductible amount is $15,000 (total bills) – $12,750 (AGI floor).
Total Itemized Deductions: $10,250The $2,250 medical deduction is added to their $8,000 in state taxes.
Final Deduction Choice: They take the Standard Deduction.Their total itemized deductions of $10,250 are less than the $21,900 standard deduction for a Head of Household. They get no benefit from their medical expenses because taking the standard deduction saves them more money.

Export to Sheets

What Counts? The Official IRS-Approved List of Medical Expenses

The IRS defines a medical expense as a cost for the “diagnosis, cure, mitigation, treatment, or prevention of disease”. This is a broad definition that covers many common and uncommon costs. Here are some of the most important qualifying expenses you can include :  

  • Payments to Professionals: Fees paid to doctors, dentists, surgeons, chiropractors, psychiatrists, and psychologists.
  • Hospital and Facility Care: Costs for inpatient hospital stays, including meals and lodging, and treatment at addiction centers.
  • Prescription Medications: The cost of any legally prescribed drug, including insulin.
  • Insurance Premiums: Money you pay with after-tax dollars for medical, dental, and qualified long-term care insurance, including Medicare Part B and D premiums.
  • Medical Aids: The cost of glasses, contact lenses, hearing aids, crutches, and wheelchairs.
  • Transportation: The cost of getting to and from medical care, including mileage on your car (21 cents per mile in 2024), bus fare, or ambulance services.  
  • Specific Treatments: Costs for acupuncture, physician-prescribed weight-loss programs for a specific disease, and smoking cessation programs.
  • Dental and Vision: Payments for non-cosmetic dental work like fillings and braces, as well as eye exams and eye surgery like LASIK.

Mistakes to Avoid: The Six Most Common and Costly Errors

Claiming this deduction is tricky, and making a mistake can lead to a denied deduction or even an IRS audit. Here are the top errors people make.

  1. Double-Dipping with an HSA or FSA. You cannot deduct medical expenses that you paid for using funds from a Health Savings Account (HSA) or Flexible Spending Arrangement (FSA). That money is already tax-advantaged, and trying to deduct it again is a major mistake.  
  2. Deducting General Wellness Costs. The IRS is very clear that expenses for your general health are not deductible. This includes gym memberships, vitamins, diet foods, and non-prescription medications like pain relievers (unless specifically prescribed by a doctor).  
  3. Forgetting the 7.5% AGI Floor. Many people mistakenly add up all their medical bills and try to deduct the total. You must first subtract 7.5% of your AGI from your total medical expenses; only the amount leftover is potentially deductible.  
  4. Ignoring the Standard Deduction. You cannot take the medical expense deduction and the standard deduction. You must itemize, and that only makes sense if your total itemized deductions are higher than the standard deduction.  
  5. Including Reimbursed Expenses. You can only deduct costs that you paid for out-of-pocket. If your insurance company or employer paid for or reimbursed you for a medical bill, you cannot include that amount in your deduction.  
  6. Having Messy Records. A large medical expense deduction is a known audit flag for the IRS. If you claim it, you must have excellent records, including receipts, invoices, and Explanation of Benefits (EOB) statements from your insurer to prove your costs were not reimbursed.  

A Step-by-Step Guide to the Math on Schedule A

The actual calculation for the medical expense deduction happens on Lines 1 through 4 of Schedule A. Understanding these lines demystifies the entire process.

  • Line 1: Medical and Dental Expenses. On this line, you enter your grand total of all qualifying, unreimbursed medical expenses you paid during the year. This is where your careful record-keeping pays off.  
  • Line 2: Enter the amount from Form 1040, line 11. This line simply asks you to copy your Adjusted Gross Income (AGI) from your main tax form. This number includes all your income, from wages to capital gains.  
  • Line 3: Multiply line 2 by 7.5% (0.075). Here, the IRS makes you calculate your AGI floor. This is the amount of your medical bills that you are not allowed to deduct.  
  • Line 4: Subtract line 3 from line 1. This is the final step. If the result is zero or less, you get no deduction. If the number is positive, this is your official medical expense deduction, which gets added to your other itemized deductions.  

Better Tools for the Job: Comparing Advanced Tax Strategies

The medical expense deduction is a reactive tool used after a financial hardship has already occurred. For proactive tax planning, especially for investors, there are far more powerful and reliable strategies available.

Bunching: A Simple Timing Strategy

Because the AGI floor and standard deduction are so high, it’s often hard to qualify for the medical deduction each year. “Bunching” is a strategy where you try to schedule and pay for as many non-urgent medical procedures as possible—like new glasses, dental work, or elective surgeries—in a single year. This can push your total expenses over the thresholds in one year, allowing you to itemize and get a large deduction, while you simply take the standard deduction in the “off” years.  

Medical Expense DeductionTax-Loss Harvesting
How it Works: Indirectly reduces tax on gains by lowering your overall taxable income.How it Works: Directly cancels out capital gains with capital losses on Schedule D, dollar-for-dollar.
Best For: A last-resort option for taxpayers with unexpectedly massive medical bills and no other planning tools available.Best For: The primary and most effective strategy for any investor with a taxable brokerage account to manage taxes on gains.

Export to Sheets

Medical Expense DeductionHealth Savings Account (HSA)
Tax Benefit: A “below-the-line” itemized deduction that requires overcoming high thresholds.Tax Benefit: A “triple tax advantage”: contributions are tax-deductible, funds grow tax-free, and withdrawals for medical costs are tax-free.
Best For: Reactively dealing with medical costs you’ve already paid out-of-pocket.Best For: Proactively saving for healthcare costs. The “above-the-line” deduction is more powerful and available to everyone, even those who don’t itemize.

Export to Sheets

Pros and Cons of the Medical Expense Deduction

ProsCons
Provides Relief in a Crisis: It can offer significant tax savings in a year with catastrophic and unexpected medical costs.High AGI “Floor”: The 7.5% threshold makes it very difficult to qualify, especially if you have high income or capital gains.
Broad Range of Expenses: The IRS allows a very wide variety of costs to be included, from ambulance rides to acupuncture.Must Itemize Deductions: The high standard deduction means most people will never be able to use this, even if they meet the AGI floor.
Can Create a “Bracket Drop”: In the right circumstances, it can indirectly lower the tax rate on your long-term capital gains.Less Powerful Than Other Tools: It is almost always less effective than proactive strategies like using an HSA or tax-loss harvesting.
Can Be “Bunched”: You can strategically time expenses to maximize the deduction in a single year.Increases Audit Risk: A large medical expense deduction is a known red flag that can attract unwanted attention from the IRS.
Available for Dependents: You can include expenses you paid for your spouse and qualifying dependents.Complex Record-Keeping: Requires meticulous tracking of receipts and insurance reimbursements to prove your claim.

Export to Sheets

State Law Nuances: Your State Might Be More Generous

While this article focuses on federal tax law, it’s crucial to remember that your state may have its own, separate rules for deducting medical expenses. Some states are far more generous than the IRS.

For example, New Jersey allows taxpayers to deduct medical expenses that exceed just 2% of their AGI, a much lower and more accessible threshold than the federal 7.5% floor. Other states, like North Carolina, have chosen to align their rules with the federal 7.5% threshold. Because of these differences, you might get a valuable state tax deduction even if you don’t qualify for a federal one.  

Frequently Asked Questions (FAQs)

Can I deduct my health insurance premiums? Yes, but only if you pay them with after-tax money and itemize your deductions. Premiums paid with pre-tax money through an employer plan are not deductible because you already received a tax benefit.  

Are my COBRA premiums tax deductible? Yes. COBRA premiums are considered a medical expense. You can include them in your total medical costs on Schedule A, but they are still subject to the 7.5% AGI floor and itemizing requirements.  

Can I deduct medical expenses I paid for my adult child? Yes, if they qualify as your dependent. You may even be able to deduct expenses for a relative who would be your dependent except they earned too much income to officially qualify.  

What kind of records do I need to keep? You must keep detailed records, including receipts from providers, bank or credit card statements showing payment, and Explanation of Benefits (EOB) forms from insurance to prove which expenses were not reimbursed.  

Does claiming a large medical deduction increase my audit risk? Yes. A medical expense deduction that is unusually large compared to your income is a known red flag for the IRS. Meticulous record-keeping is essential to defend your claim if you are audited.  

Can I deduct medical bills I paid with a credit card? Yes. The expense is deductible in the year you charge it to your card, not the year you pay the credit card bill. This rule allows you to time deductions for strategic “bunching”.