I didn't think about taxes on selling until my taxable brokerage account grew big enough to matter. Inside a 401(k), IRA, or HSA, buying and selling has no tax effect. It's invisible to the IRS until you withdraw. But in a taxable brokerage account, every single sale is a tax event. Every purchase creates a separate tax lot with its own price and date, and years of regular contributions through raises and job changes, plus daily automatic Bitcoin buys, left me with hundreds of separate lots.

At first, tracking all of it felt overwhelming. Then something clicked. Two choices were sitting right in front of me the entire time: whether to use losses when the market dips, and which specific shares to sell when I do sell. Selling the same 100 shares can cost $1,350 in taxes under one cost basis method or $600 under another. That's a $750 difference on a single trade, just by changing a setting.

How Tax-Loss Harvesting Works (And Why It Feels Like Free Money)

You sell a fund that's currently below what you paid for it, book that loss on your taxes, and immediately buy a similar but not substantially identical fund so you stay fully invested. You're not timing the market or changing your allocation. You're just capturing a tax benefit while your money keeps working.

Losses offset your capital gains first, dollar for dollar. If you have more losses than gains, up to $3,000 of the remaining loss offsets your ordinary W-2 income each year. Anything left over carries forward indefinitely until it's used up. A big loss in a down year isn't wasted. It can reduce your taxes for years to come.

One robo-advisor reports harvesting more than $3 billion in losses for its clients over a decade, an estimated $1 billion in tax savings by its own count, much of it deferred rather than erased. The tax deferral value alone can add up to roughly 0.30% to 0.42% in excess returns annually, depending on your tax bracket.

I saw losses offset gains in my own portfolio in 2021. I sold stocks to help fund our rental properties, and that same year I exited positions on two real estate crowdfunding platforms at a loss. Those losses offset the gains from the stock sales, and the net result was a much smaller tax bill than I'd expected. A losing investment isn't inherently bad. It's a tool when you redirect the money into something better and capture the tax benefit along the way.

The Wash Sale Rule: It's 60 Days, Not 30

The IRS wash sale rule under Section 1091 says if you buy the same or a "substantially identical" security within 30 days before or after selling at a loss, the loss is disallowed. That's a 60-day window total, 30 days on each side of the sale.

What counts as "substantially identical"? The IRS hasn't defined it precisely, but the edges are clear. Different share classes of the same fund, like a total stock market ETF and the mutual fund version of it, are substantially identical because they track the same index from the same provider. A total stock market fund from one provider and an S&P 500 fund from another are not, because they track different indexes from different providers. That distinction is what makes the substitute fund strategy work.

The rule applies across every account you own. Sell a total stock market index fund at a loss in your brokerage account, and your Roth IRA buys the same fund through an automatic contribution two weeks later? Wash sale. Your spouse's account does a dividend reinvestment into the same fund within the window? Wash sale. Even a small automatic purchase counts. This is where people get tripped up. Say you sell at a loss in your taxable brokerage, then buy the same or a "substantially identical" fund inside another account within 30 days. Here's how that plays out by account:

  • IRA and Roth IRA: a buy there counts as a wash sale, and the loss is gone for good, because it can't be added to an IRA's cost basis. That includes money you move in through a backdoor Roth once it gets invested.
  • 401(k), 403(b) and HSA: the IRS has never said either way. The cautious reading is to treat them like an IRA, and that's how I've set up my accounts.
  • Losses inside any of these accounts: never a problem. A loss inside a retirement account or HSA isn't deductible in the first place, so there's nothing for the rule to take away.

I handled this by mapping which specific funds I hold in which accounts. My brokerage account holds one family of index funds, my traditional 401(k) and HSA hold a different set, my Roth IRA holds a Bitcoin ETF, and none of them overlap with the brokerage. That way, the automatic contributions in my retirement accounts never accidentally trigger a wash sale. Working with a tax consultant helped me build that cross-account awareness.

The practical solution is a substitute fund list. Before I need to harvest, I already know which fund I'll swap into. If my total stock market index fund drops, I sell it and buy an S&P 500 fund from a different fund family. After 31 days, I can swap back if I want.

One more thing: the wash sale rule only applies to losses. Sell at a gain and buy it right back with no issue. That matters when you're harvesting and rebalancing at the same time.

Cost Basis Methods: Why the Default Is Costing You Money

Every time you sell shares, your brokerage needs to know which shares left your account so it can calculate the gain or loss. The cost basis method makes that decision. Most brokerages default to FIFO (first in, first out), which sells your oldest shares first. For a long-term investor who's been dollar-cost averaging for years, those oldest shares are usually the cheapest ones, which means the biggest taxable gain.

Specific identification changes everything. Instead of letting the brokerage choose, you pick exactly which lots to sell. Want the smallest possible gain? Sell the highest-cost long-term lots. Want to harvest a loss? Sell the lots that are below your purchase price. Need to avoid short-term gains? Skip any lot you've held for less than a year. That's how the 100-share example I mentioned earlier cuts the tax bill by more than half: same shares, same sale price, but specific identification picks the lots that minimize the gain.

Average cost is the third option, and it's common for mutual funds. It divides the total cost of all your shares by the number of shares, giving you one blended number. It's simple, but it takes away the control that makes tax-loss harvesting and tax-efficient asset placement so powerful.

Changing the setting takes a few minutes and pays off on every future sale. Most brokerages keep it under account features or preferences, labeled cost basis or tax lot method. Modern platforms show lot-level detail and let you pick exactly which shares to sell. Whenever I sell, I use specific identification: for a gain, I pick the lots with the highest cost basis instead of the oldest shares, and for a loss, the lots with the biggest loss. That has consistently reduced my realized gains. Before any sale in my brokerage account, I pull up the lot list and choose myself rather than letting the default decide.

ESPP, Employer Stock, and the Double-Tax Trap

Employer stock is where cost basis trips up the most people. With an ESPP, the discount you receive (15% in my case) is taxed as ordinary income on your W-2. Your cost basis should reflect that discount, but the brokerage form often shows only the price from your paycheck. If you don't adjust it, you pay tax on the discount twice: once as W-2 income and again as a capital gain when you sell.

This is one place where you need to check your 1099-B carefully. Brokerages report cost basis to the IRS, but for ESPP shares, the reported basis often excludes the discount already taxed as W-2 income. File using those numbers without adjusting, and you overpay. Your W-2 and brokerage confirmation from the purchase date together show the correct adjusted basis.

Selling each ESPP purchase as soon as it settles keeps this simple. The discount gets taxed once as wages, the sale itself shows almost no gain because I held the shares only briefly, and the proceeds go straight into my low-cost index funds. I do the same with RSUs and other stock pay: sell, then reinvest.

Tax Gain Harvesting and the Zero-Tax Connection

Tax-loss harvesting gets all the attention, but tax gain harvesting is a strategy worth knowing, especially if you have kids. If a fund in your child's UTMA account, an investment account in the child's name, has appreciated, you can sell it at a profit, realize the gain tax-free up to a small yearly limit before the kiddie tax applies, and buy a similar fund to reset the cost basis higher.

The bigger connection is to retirement. When you harvest losses, your cost basis drops, which means larger gains when you eventually sell. That sounds like a problem until you factor in the zero-tax retirement structure. The loss you harvested saved you real money at your working tax bracket, and the gain that results can cost you nothing in retirement if it fits in the 0% bracket, the long-term capital gains rate for years when your taxable income is low, as it can be once the paycheck stops. That's not just deferral. It's elimination.

Start Harvesting Before December: Your Future Self Will Thank You

Tax-loss harvesting isn't a December project. Since 1980, the S&P 500 has averaged an intra-year decline of roughly 14%, yet still finished the calendar year with a positive return about three out of every four years. If you only check in December, you miss the dip entirely. Set a simple trigger: when the market drops sharply, open your brokerage account and scan for lots that are below your purchase price. That's it.

During sharp drops, I'll sell a losing position, like I do with Bitcoin, to realize the tax loss. Under current law, the wash sale rule doesn't apply to Bitcoin held directly as coins, so I can buy back right away. That's staying invested with a tax benefit. Congress has proposed extending the rule to crypto (a bill the House Ways and Means Committee approved in September 2026 would reach sales from that month), and brokers already treat a Bitcoin ETF like any other fund for wash sales, so I do too. A crypto loss can then offset the gain when I sell stocks to move money between funds.

Before I discovered FIRE, I bought individual stocks of companies I recognized and never thought about the tax side of selling them. Some of those early positions lost value, and back then I didn't know tax-loss harvesting existed, so I never used those dips to bank a loss while staying invested. That's a tax benefit I can never get back, and it's a big part of why I want every reader to start paying attention from day one. The account fill order determines where your dollars land, and the cost basis method determines what you keep when those dollars come back out.

Taxes on investment sales aren't a fixed cost. They're a controllable expense.

Open your brokerage account settings and switch your cost basis method to specific identification. From then on, every sale lets you choose the lots that cost you the least tax.

Real estate has a tax playbook of its own.

What You Need to Remember

  • Tax-loss harvesting captures a tax benefit without changing your portfolio allocation or timing the market.
  • The wash sale rule spans 60 days total, 30 before and 30 after the sale, across every account you own.
  • Switching your cost basis from FIFO to specific identification can cut your tax bill on the same sale by more than half.
  • Unused losses carry forward indefinitely and offset gains, then up to $3,000 of ordinary income each year.
  • A lower cost basis from harvesting works in your favor if your retirement income keeps your gains in the 0% capital gains bracket.

Questions I Always Get

Can I tax-loss harvest in my 401(k), IRA, or HSA? No. Tax-loss harvesting only works in taxable brokerage accounts. Sales inside a 401(k), IRA, Roth IRA, or HSA don't generate taxable gains or deductible losses. The tax event happens when you withdraw, not when you trade. You can still rebalance freely inside those accounts without any tax impact. Focus your harvesting entirely on your taxable accounts.

What happens if I accidentally trigger a wash sale? In a taxable account, the loss isn't gone forever. The disallowed loss gets added to the cost basis of the replacement shares, so you'll eventually get the benefit when you sell those shares later. If the repurchase happened in your IRA or Roth IRA, though, the loss is gone for good, because it can't be added to an IRA's cost basis. It's annoying, not catastrophic: in a taxable account it only delays the tax benefit and makes your record-keeping messier. Keep your fund families separated across accounts to avoid it in the first place.

Is tax-loss harvesting worth it for small portfolios? Absolutely, for most people. Even $3,000 of harvested losses saves you real money at most income levels; the exception is when your income is low enough that your gains already land in the 0% bracket. At a 22% marginal tax rate, that's $660 back in your pocket for that year. Losses above $3,000 carry forward and keep reducing future taxes. The strategy doesn't require a large portfolio; it requires a dip in the market and the willingness to make a swap.

Does tax-loss harvesting just defer taxes rather than eliminate them? Mostly, yes. Your lower cost basis means a larger gain when you eventually sell. But deferral has real value because you invest the tax savings and let them compound. And if you sell those lower-basis shares during retirement when you're in the 0% long-term capital gains bracket, the deferred tax disappears entirely. That's bracket arbitrage, and it turns deferral into permanent savings.

Do I need to track each tax lot manually? Not anymore. Most modern brokerages show lot-level detail for every holding: purchase date, cost basis, unrealized gain or loss, and holding period. When you sell, you can select specific lots right on the order screen. The brokerage handles the record-keeping and reports it on your 1099-B. Your job is just to pick the right lots at the right time.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *