top of page
blue logo transparent

The Simple "Cheat Code": How to Pay 0% Tax on Stock Sales with Capital Gains Harvesting

  • Writer: Gin
    Gin
  • Dec 12, 2025
  • 6 min read
A field of wheat with a single wheat stock replaced with a dollar sign as a metaphor for capital gains harvesting

In my last post, we talked about how long-term capital gains stack on top of ordinary income when calculating your federal taxes. We also looked at the magical unicorn of tax brackets: the 0% long-term capital gains bracket.


This “stacking” concept doesn’t just help reduce your taxes today—it can also shrink your tax bill years from now by intentionally using the 0% tax bracket. And that’s where capital gains harvesting comes in. Yes, “harvesting,” as if we’re out in a field gathering crops instead of filling out forms for the IRS.


Right now, my wife and I are living off cash savings. But eventually we’ll start selling the stocks in our taxable brokerage account, which (sadly) will trigger taxes. Capital gains harvesting is the strategy we plan to use to lower those taxes later—and honestly, when I first learned about it, I thought it was the closest thing taxes have to a cheat code.


Before we get into the fun stuff, let’s do a quick recap so everything makes sense. The IRS may enjoy confusion, but we don’t.


CAPITAL GAINS RECAP (LONG-TERM VS SHORT-TERM)

  • A capital gain is what you get when you sell a stock for more than you paid. Buy Apple for $40,000, sell for $200,000? Congrats—you just created $160,000 in capital gains and probably a slightly inflated sense of financial genius.

  • Hold a stock for one year or less? That’s a short-term capital gain. This type of gain is taxed at the same rate as your ordinary income. It’s the IRS’s polite way of saying, “full tax rates apply, have fun.”

  • Hold for more than a year? That’s a long-term capital gain. These get their own tax brackets, including the coveted 0% bracket—a rare kindness from the IRS.


WHY YOU SHOULD MAXIMIZE THE 0% CAPITAL GAINS TAX RATE

Any time you sell a stock in a taxable account for a profit, you’ll owe taxes. Using the Apple example above, you’d have $160,000 of gains. Sounds great! Until Uncle Sam smirkingly says, “Nice gain you got there. Be a shame if someone…taxed it.”


Let’s look at a simple scenario to see how this actually plays out. Assume:

  • You have no ordinary income

  • You’re living solely off long-term capital gains

  • You file jointly

  • You use the standard deduction


So basically, it’s you, your spouse, a pile of stocks, and the IRS trying to mind their own business.



With no ordinary income, that $160,000 falls into the 2025 long-term brackets like this:

  • $96,700 at 0%

  • $63,300 at 15%


But after applying the $31,500 standard deduction, only $31,800 is actually taxed at 15%. That works out to $4,770.


Not terrible. But also: why pay $4,770 if you don’t have to?


Enter: capital gains harvesting.


HOW TO DO CAPITAL GAINS HARVESTING AND RESET YOUR STOCK COST BASIS

Two grocery items—one labeled "Old Cost Basis: $40,000 (expired)" and the other labeled "New Cost Basis: $110,000 (fresh!)" as a metaphor for resetting cost basis

Capital gains harvesting is basically a way to reset your cost basis while deliberately staying inside the 0% capital gains tax bracket. Resetting your cost basis simply means “telling the IRS you paid more for your stock so they can’t tax as much of your profit later.”


(If this strategy were a movie character, it would be the charming rogue who gets away with things by following the rules just cleverly enough.)


Here’s the idea:

  • You sell appreciated stock while you’re in the 0% bracket

  • You immediately buy it back (yes, this is allowed for capital gains)

  • Your new cost basis becomes the higher amount you just repurchased it for

  • Later—specifically over a year later to qualify for long-term capital gain tax rates—when you eventually sell the stock to actually fund your life, your gains are much smaller

  • Smaller gains = smaller tax bill = future you giving past you a high-five


Let’s go back to Apple:

  • You bought stock years ago for $40,000

  • They're now worth $110,000 in 2025

  • You sell them and realize $70,000 of gains

  • Then you immediately rebuy them for $110,000

  • Your cost basis is now $110,000 instead of $40,000

  • Your holding period also resets, so make sure to hold the stocks for more than a year to qualify for the 0% tax rate

  • Over a year later, when they grow to $200,000, you sell them again and realize only $90,000 of gains, not $160,000


At this point, you might say, “Okay, but…those gains are still gains. I still owe taxes, right? What’s the point?”


Ah, but the difference is that you’re no longer realizing all the gains at once. Without capital gains harvesting, you would have realized your $160,000 in capital gains as one giant lump sum. That large amount would push you into higher tax brackets.


With capital gains harvesting, you essentially break up the gains into smaller chunks of $70,000 and $90,000 over multiple years. And this is where the 0% long-term capital gains bracket swoops in, wearing a cape.


In 2025, married couples filing jointly can have:

  • $96,700 of long-term capital gains tax-free

  • Plus the standard deduction of $31,500

  • For a total of $128,200 in possible tax-free long-term capital gains


So in our example, in 2025, you could harvest:

  • $70,000 in Apple gains

  • PLUS $58,200 in other gains

  • All at 0% tax


And because you raised your cost basis, those future gains—when you eventually sell for real—may also fall inside the 0% bracket…if you plan like you mean it.


Going back to the Apple example, assume you repurchased your stocks immediately after selling them in 2025. Your cost basis is $110,000. Then, over one year later in 2026, you resell the stock for $200,000. Your realized capital gains are $90,000.


Per the 2026 tax brackets, married couples filing jointly can have:

  • $98,900 of long-term capital gains tax-free

  • Plus the standard deduction of $32,200

  • For a total of $131,100 in possible tax-free long-term capital gains at 0% tax


So that $90,000 in capital gains could be entirely tax-free, depending on other income you may have. You go from paying $4,770 in taxes on $160,000 in capital gains to no taxes by splitting the gains into $70,000 and $90,000.


Now you can see why people get almost giddy talking about this strategy.


4 IMPORTANT RULES FOR CAPITAL GAINS HARVESTING

1. This only works in taxable accounts.

Don’t go trying this inside retirement accounts.

  • Traditional IRA withdrawals? Always ordinary income.

  • Roth IRA withdrawals? Already tax-free, so harvesting gives you nothing except wasted mouse clicks.


2. You want to use as much of the 0% bracket as possible.

In our example, you realized $70,000 in Apple gains and used the remaining $58,200 for living expenses.


But if you had additional cash savings for living expenses, you could harvest the full $128,200 in gains instead.


On a personal note, my wife and I will be living entirely off of savings during our first few years of early retirement. We’ll be maxing out the 0% bracket every year like we’re harvesting coupons. But cooler.


3. Ordinary income still messes with your capital gains brackets.

The 0% bracket applies only to long-term gains, but the stacking principle means ordinary income shoves your gains upward.


Ordinary income includes but is not limited to:

  • Short-term capital gains

  • Ordinary dividends

  • Interest

  • Rental income

  • Gambling winnings (hey, it happens)

  • Pension and annuity income

  • Traditional IRA distributions


Basically, if the IRS considers it “ordinary,” it’s here to complicate your life.


4. Do NOT try to harvest losses the same way (this is not capital gains harvesting).

A capital loss happens when you sell for less than you paid.


And yes, you might think: “Ooooh, what if I sell at a loss, claim it on my taxes, and then immediately buy the stock back? That’s basically free money!”


And the IRS, from somewhere in the distance, whispers: “The Wash Sale Rule says no.”


A washing machine with a sign that says "No Losses Allowed" as a metaphor for the IRS Wash Sale Rule.

If you sell a stock at a loss, you cannot buy it back for 30 days. Not in the same account. Not in another account. Not after putting on sunglasses and pretending to be someone else.

The IRS does not play around.


THE BOTTOM LINE: HARVESTING YOUR 0% CAPITAL GAINS TAX RATE

Capital gains harvesting is one of those rare strategies that is simple, legal, extremely effective, and somehow still not widely used. By intentionally realizing gains while you’re in the 0% bracket, you can reduce your future taxes in a way that feels almost unfair—in the best possible way.


This isn’t about tricking the system. It’s about actually using the rules the IRS wrote…even if the IRS doesn’t remember writing them.


If you’re planning early retirement, low-income years, sabbaticals, gap years, or any period where your ordinary income dips, this strategy can pay off huge later.


And don’t worry if figuring out how to stay within the 0% tax bracket seems complicated. I've been working on a spreadsheet to take some of the guesswork out. I'll share that with you in an upcoming post.


If you found learning about capital gains harvesting to be exciting, drop me a comment below.


See you at the finish line!

Disclaimer: I may hold shares of some of the companies mentioned. I’m not a licensed financial professional. This blog shares my personal experiences and opinions around money, investing, and early retirement. It’s for informational and educational purposes only—not financial, legal, or tax advice. Always do your own research or consult with a qualified professional before making any financial decisions.

Comments


© 2025 by FIRE before 50

bottom of page