Can Federal Employees Pay a 0% Tax on Investment Gains?

How do capital gains taxes work? Can they ever be avoided entirely?

Maybe you’re a new federal employee, or perhaps you’re a seasoned vet who will soon be shifting to a single-income household. Maybe you’re taking leave without pay (LWOP) or retiring at Minimum Retirement Age (MRA) + 10 years of service with a reduced pension and no FERS supplement. Regardless of the reason, a low tax bracket is a terrible thing to waste. So, how do you take advantage of it? By analyzing your capital gains.

What is a Capital Gain?

“When you sell a capital asset, the difference between the adjusted basis in the asset and the amount you realized from the sale is a capital gain or a capital loss” (IRS Topic 409). In plain English, a capital gain or capital loss is the difference between what you paid for something and what you sell it for.

Let’s break it down a little more. What is a capital asset? It’s anything you own that can be sold. Homes, boats, cars, stocks, cryptocurrency, etc.

What about basis? Basis is usually the purchase price, but it can get more complicated, especially with houses. When the IRS says “realized”, that just means when you actually sell the asset. You can have unrealized losses or gains, which are “realized” when you sell the asset. 

An important thing to note. This isn’t how an employer plan like the Thrift Savings Plan (TSP) or an Individual Retirement Arrangement (IRA) works. Because you got a tax break for traditional (pre-tax) contributions, you’ll pay ordinary income tax, not capital gains tax, when you withdraw money from your pre-tax balance. Roth contributions do not provide a tax break when you contribute, but your money grows tax-free, and qualified distributions are tax-free.

How are Capital Gains Taxed?

Short-Term Capital Gains (STCG)

If you own the asset for one year or less, your gain is an STCG and is generally taxed as ordinary income. Ordinary income tax rates are the marginal tax rates you pay on your W2 income. The current marginal brackets are 10%, 12%, 22%, 24%, 32%, 35% and 37%.

Long-Term Capital Gains (LTCG)

If you hold the asset for more than one year, your gain is an LTCG and generally receives favorable tax treatment. The current LTCG brackets are 0%, 15%, and 20%. There are times when you sell an asset and may have to pay more than 20% capital gains tax, such as with depreciation recapture, or when taking profits from collectibles such as art, jewelry, and precious metals. For the sake of simplicity, we’re only going to talk about plain vanilla capital gains in this article.

2024 Long-Term Capital Gains Tax Brackets

Filing Status0% Tax15% Tax20% Tax(+) 3.8% NIIT
SingleUp to $47,025$47,026 – $518,900Over $518,900Over $200,000
Married filing jointlyUp to $94,050$94,051 – $583,750Over $583,750Over $250,000
Married filing separatelyUp to $47,025$47,026 – $291,850Over $291,850Over $125,000
Head of householdUp to $63,000$63,001 – $551,350Over $551,350Over $200,000
Source: IRS


Can realizing capital gains increase your ordinary tax bracket and make your W2 income taxed at a higher rate? No! 

There’s a lot of confusion with this. Some people worry that if they’re near the top of one marginal tax bracket and then realize capital gains, their ordinary income is going to be pushed into the next marginal tax bracket.

Luckily, that’s not how it works. Your capital gains sit on top of your taxable income, after applying deductions. This sequence and stacking actually benefits the taxpayer. Conversely, your taxable ordinary income can push you into a higher capital gains tax bracket. Don’t worry, there’s an example below in the tax gain harvesting section.

Tax-LOSS Harvesting and Carry Forward

Let’s say you bought a stock for $10,000 and sold it for $6,000; you have a $4,000 capital loss. You also bought cryptocurrency for $1,000 and sold it for $1,050, a $50 capital gain.

In this scenario, you’ve got a net capital loss of $3,950 ($4000 loss + $50 gain). You pay no capital gains tax on the crypto profit because your capital losses can offset your capital gains. 

This is why when the stock market crashes, you’ll hear people talking about tax-loss harvesting

This strategy involves selling both losers (stocks with losses) and winners (stocks with gains) so that the profits from the winners are offset by the losers.

You might be asking yourself, “What if you have so many losses that all of your gains are wiped out, and you’re still at a net loss for the year?” Good news! You can use $3,000 worth of losses each year and reduce your ordinary W2 income. What’s even better is that the IRS will allow you to carry forward losses above that $3,000 indefinitely until the losses are zeroed out. 

So, in this case, we would take a $4,000 loss minus a $50 (capital gain offset) minus $3,000 (ordinary income offset), leaving us with $950 in losses carried forward next year to reduce capital gains or ordinary income. Tax loss harvesting is only for a taxable brokerage account; this doesn’t work in a tax-advantaged retirement account such as the TSP or an IRA.

If you’re going to use this strategy, beware of the “wash sale rule”. This rule prevents you from recognizing a loss if you buy the same security 30 days before or after selling at a loss. You can’t sell for a loss and buy the same stock within 30 days of selling and still get the tax benefit of off-setting gains. This would be a “disallowed loss”, which results in an adjustment of your original cost basis.

If you want to stay invested in the market (which we do), just buy another stock that’s not substantially identical. One example of avoiding a wash sale would be to sell an S&P 500 fund and then buy a U.S. Total Stock Market Index fund. This keeps you invested in something similar, but not substantially identical.

Tax-GAIN Harvesting

Let’s say you have ABC stock worth $1,000. You bought it a few years ago for $500. You’ve now got a $500 capital gain. What if your other taxable income dips that year? If you drop low enough to be in the 10% or 12% federal marginal tax bracket, your LTCG tax bracket is 0%.

Let’s do a quick example of this stacking concept. 

2024: You make $121,000 W2 income minus the $29,200 Married Filing Joint standard deduction equals $91,800 of taxable income. The 2024 0% LTCG tax bracket goes up to $94,050. This means you could sell stock and have up to a $2,250 LTCG (profit) and pay $0 tax on that $2,250 gain.

The next day you could go back and buy those same stocks and reset your basis, so when you sell in the future, your new profit is based on that new purchase price. Higher cost basis equals a lower realized profit in the future which in turn results in a lower tax burden. What’s even better? There is no wash sale rule with harvesting gains, only when harvesting losses.

It should be noted that there are times when harvesting gains can have adverse consequences. Gains are income that will increase your Adjusted Gross Income (AGI) and therefore could increase how much of your Social Security is taxable. Maybe you’re on the cusp of a tax credit or deduction and realizing gains could eliminate those favorable tax treatments.

There are also state taxes, healthcare Premium Tax Credits, and medical expense deductibility limits of which to be cognizant. Just like with losses, tax-gain harvesting is only for a taxable brokerage account, this doesn’t work in a tax-advantaged retirement account such as the TSP or an IRA. 

Net Investment Income Tax (NIIT)

For high earners, there is an additional 3.8% tax you may have to pay on your net investment income if your Modified Adjusted Gross Income (MAGI) is above $250,000 (Married Filing Joint), $200,000 (single or HOH), or $125,000 (Married Filing Separately). NIIT applies to taxable interest, dividends, rental income, annuities, and royalties. NIIT generally doesn’t apply to selling business assets or if you’re classified as an “active participant” in real estate.

Key Takeaways

Federal employees who find themselves in the 0% capital gains tax bracket, or the lower marginal federal tax brackets like the 10%, 12%, or 22%, should consider tax strategies that may reduce their lifetime tax bill. Don’t forget that when the tax provisions of the 2017 Tax Cuts & Jobs Act (TCJA) expire in 2026, the current federal marginal tax brackets are scheduled to increase to the pre-TCJA rates.

Tax-loss and tax-gain harvesting are just two tactics that may reduce your overall tax obligation. If you’re unsure of your unrealized gains and losses, your custodian (e.g., Vanguard, Fidelity, and Schwab) will most likely list your unrealized gains and losses when you log in and view your account summary.

Finally, you should try to hold your investments for more than one year, if aligned with your overall investing strategy, to get the LTCG tax treatment.

Tyler Weerden is a financial planner and the owner of Layered Financial. In addition to being a financial planner, Tyler is a full-time federal agent with 14 years of law enforcement experience. He holds a Bachelor of Science degree, a Master of Science degree, the Series 65 license, and is a Certified Fraud Examiner (CFE).