Can I Trade Stocks in My 401(k)? Rules, Taxes, and Penalties

Yes, you can trade stocks in your 401(k), but only if your employer has added a self-directed brokerage account (sometimes called a brokerage window) to the plan. Without that feature, you’re limited to the mutual funds and target-date funds on the plan’s core menu, with no exceptions. And even when stock trading is available, the tax rules inside a 401(k) work very differently from a regular brokerage account, which can either help you or cost you depending on how you use it.

How to Check Whether Your Plan Allows It

Start with your Summary Plan Description, which your plan administrator is legally required to give you for free.1U.S. Department of Labor. Plan Information It’s usually posted on your HR portal or the plan provider’s site. Search the document for “brokerage window,” “self-directed brokerage account,” or “SDBA.” If none of those terms appear, your plan doesn’t support stock trading and you’re stuck with the core lineup.

Also read the fee disclosure your plan sends each year. Federal rules require plans to spell out any fees that can be charged to your individual account based on what you do.2U.S. Department of Labor. Fact Sheet – Final Rule to Improve Transparency of Fees and Expenses to Workers in 401(k)-Type Retirement Plans The disclosure will tell you whether the brokerage window requires a minimum balance, what trading costs apply, and which securities are restricted. Some plans require you to keep a minimum in the core funds (often in the $5,000 to $10,000 range) before you can open a brokerage window, or to reserve a percentage of your balance in core funds to cover administrative fees. These conditions vary, so read the disclosure carefully before moving money.

Opening the Brokerage Window and Moving Money In

Once you confirm the feature exists, you’ll typically fill out an application or sign an electronic agreement on the plan provider’s website. That agreement almost always includes a disclosure making clear that any investment losses in the self-directed portion fall on you, not the plan fiduciaries. Federal law backs that up: when a plan offers a broad range of options and gives you enough information to choose, the fiduciaries are generally not liable for your trading decisions.3Office of the Law Revision Counsel. 29 USC 1104 – Fiduciary Duties – Section: Control Over Assets by Participant or Beneficiary

After the account opens, you fund it by selling some of your existing core-menu holdings and directing the cash to the brokerage window. Mutual funds may take a business day or more to settle. Stocks and ETFs settle the next business day under the current T+1 rule. Plan for a short gap between selling out of your core funds and having cash available to trade.

What the Window Costs

Brokerage windows aren’t free. Recordkeepers generally charge a quarterly maintenance fee, and some providers add an annual account fee on top.4U.S. Department of Labor. Understanding Brokerage Windows in Self-Directed Retirement Plans Most providers offer commission-free online trading for stocks, ETFs, and many mutual funds, though broker-assisted trades, options, and certain bonds still carry transaction fees. Mutual funds inside the window may impose short-term redemption fees if you sell within 60 to 90 days of buying. For frequent traders, these costs can add up quickly against what you’d have paid holding a low-cost core fund.

What You Can and Cannot Trade

Most brokerage windows allow U.S.-listed stocks, ETFs, mutual funds outside the core lineup, corporate bonds, and Treasury securities. Some also permit options trading and American depositary receipts for foreign companies. What no 401(k) brokerage window will let you do is trade on margin or sell stocks short. Both involve borrowing, and federal law treats a loan between a plan and a party in interest as a prohibited transaction.5Office of the Law Revision Counsel. 29 USC 1106 – Prohibited Transactions6Office of the Law Revision Counsel. 26 USC 4975 – Tax on Prohibited Transactions Most platforms simply block those order types. Plans also typically exclude futures, commodities, foreign securities not listed on U.S. exchanges, municipal bonds, real estate, and collectibles.

How Stock Trades Are Taxed Inside a 401(k)

This is where the 401(k) environment diverges most sharply from a taxable brokerage account, and the difference cuts both ways.

The Upside: No Tax on Individual Trades

Inside a traditional 401(k), you can buy and sell stocks without owing capital gains tax on each profitable trade. There’s no short-term versus long-term distinction while the money stays in the account. You can rebalance, take profits, cut losses, and reinvest the full proceeds without the IRS taking a slice along the way. For active traders, that tax deferral is a real advantage.

The Downside: Ordinary Income on the Way Out

When you eventually withdraw from a traditional 401(k), every dollar is taxed as ordinary income, regardless of whether the gains came from stock appreciation, dividends, or bond interest.7Office of the Law Revision Counsel. 26 USC 402 – Taxability of Beneficiary of Employees Trust In a taxable brokerage account, stocks held more than a year qualify for the lower long-term capital gains rate. That preferential rate disappears inside a 401(k). If you’re a successful stock picker generating large gains, you could pay a higher tax rate on those gains than you would have in a taxable account. The deferral is valuable, but the rate penalty grows with your gains.

The Roth 401(k) Flip

If your plan offers a Roth 401(k) alongside a brokerage window, the math changes. Roth contributions go in after tax, so there’s no upfront deduction. But qualified withdrawals, including all the gains from your stock trades, come out completely tax-free and penalty-free, as long as you’re at least 59½ and the account has been open for at least five years. For someone who expects strong appreciation, a Roth 401(k) with a brokerage window eliminates the ordinary-income problem entirely. Not every plan offers both, but if yours does, it’s worth serious consideration.

Wash Sales Between Accounts

Advice circulating online sometimes claims the wash sale rule doesn’t apply to retirement accounts. That’s misleading. In Revenue Ruling 2008-5, the IRS held that selling stock at a loss in a taxable account and repurchasing the same stock within 30 days inside an IRA does trigger the wash sale rule, disallowing the loss.8Internal Revenue Service. Revenue Ruling 2008-5 The ruling addressed IRAs specifically, and the IRS hasn’t issued equivalent guidance for 401(k) purchases, but the same reasoning could reach a 401(k). If you hold the same stock in a taxable account and inside your 401(k), be careful about a loss sale in one paired with a purchase in the other during the 30-day window. For trades made entirely within the 401(k), the rule is practically irrelevant, because you can’t deduct losses from inside the account anyway.

Early Withdrawal Penalty on Trading Profits

If you withdraw money from your 401(k) before age 59½, the distribution is generally hit with a 10% additional tax on top of the ordinary income tax.9Internal Revenue Service. 401(k) Resource Guide – Plan Participants – General Distribution Rules Trading profits are treated no differently. You can’t sell a stock at a gain and pull the profit out penalty-free just because it feels like investment income rather than retirement money.

Several exceptions waive the 10% penalty, including:

  • Separation from service in or after the year you turn 55 (age 50 for qualified public safety employees), applied to that employer’s plan.
  • Total and permanent disability, or distribution to a beneficiary after the account holder’s death.
  • A series of substantially equal periodic payments calculated based on your life expectancy.
  • Distributions to an alternate payee under a qualified domestic relations order.
  • Unreimbursed medical expenses above 7.5% of your adjusted gross income.
  • Up to $22,000 for qualified federally declared disaster losses.

The full list of exceptions is longer.10Internal Revenue Service. Retirement Topics – Exceptions to Tax on Early Distributions The takeaway is that early access to trading profits is expensive unless you fit a specific carve-out.

Two Traps to Watch Inside the Brokerage Window

Unrelated Business Taxable Income

Most stock trades won’t create anything unusual. But certain investments available through brokerage windows, particularly master limited partnerships and some leveraged ETFs structured as partnerships, can generate unrelated business taxable income. If total positive UBTI from all such holdings in your retirement account reaches $1,000 or more in a year, the plan trust must file IRS Form 990-T and pay tax on that income.11Internal Revenue Service. 2025 Instructions for Form 990-T The tax is paid out of the retirement account itself, reducing your balance. If you’re buying MLPs in the window, watch the K-1 statements.

Prohibited Transactions

Federal law bars sales, loans, and transfers of plan assets between the plan and “disqualified persons,” which includes plan fiduciaries, the employer, and certain related parties.6Office of the Law Revision Counsel. 26 USC 4975 – Tax on Prohibited Transactions A prohibited transaction can cause the IRS to treat the entire account as distributed on the first day of the year, triggering full income tax on the balance and potentially the 10% early withdrawal penalty.12Internal Revenue Service. Retirement Topics – Prohibited Transactions Buying and selling publicly traded stocks through a mainstream brokerage window is very unlikely to put you in this territory, and platforms are set up to block the common risks. Anything more creative with plan assets calls for professional advice first.

Company Stock and Net Unrealized Appreciation

If your 401(k) holds shares of your employer’s stock, a strategy called net unrealized appreciation can save you significant tax at retirement. NUA is the difference between what the company stock originally cost in the plan (its cost basis) and its market value when you take it out. If you take a lump-sum distribution of everything in the plan and receive the company stock in kind, meaning actual shares transferred to a taxable brokerage account rather than sold inside the plan, you pay ordinary income tax only on the original cost basis. The appreciation is taxed at the long-term capital gains rate when you later sell, no matter how quickly you sell after the distribution.

To qualify, you generally need a triggering event first, such as separation from service, disability, or reaching age 59½. The stock must come out as shares, not roll into an IRA. Roll employer stock into an IRA and sell it there, and the entire amount comes out later as ordinary income, with the NUA benefit lost. This strategy applies only to employer stock held within the plan, not to other stocks you traded in the brokerage window. For employees whose company stock has appreciated substantially, the savings can be meaningful.

If You’re Self-Employed: The Solo 401(k)

If you’re self-employed or run a business with no employees other than a spouse, a solo 401(k) gives you significantly more flexibility. You act as both employer and participant, so you pick the plan provider and can choose one that supports individual stocks from the start. There’s no employer to petition and no waiting for a brokerage window to be added. Some solo 401(k) providers focus on brokerage-based plans that support stocks, ETFs, and mutual funds. Others offer self-directed solo 401(k) plans that reach further into alternative investments like real estate and private equity. The same federal rules on prohibited transactions, contribution limits, and withdrawal penalties still apply, but the investment menu is yours to build.