How does cost-basis optimization work across multiple accounts?
Cost-basis optimization for multi-account portfolios means managing which specific shares (tax lots) you sell, and from which account, in order to reduce taxable capital gains, take advantage of losses, and improve after-tax returns. Investors who actively optimize cost basis consider: which account holds each asset (taxable, tax-deferred, Roth), the holding period for long‑ vs short‑term rates, broker lot records, and rules such as wash sales. This isn’t just bookkeeping — it can change your tax bill materially.
Why it matters
Selling the wrong lots from the wrong account can needlessly increase capital gains taxes or forfeit valuable losses. Conversely, thoughtful optimization can:
- Reduce near‑term tax bills by realizing losses or longer‑term gains at lower tax rates.
- Preserve carryforward loss capacity (offsets against future gains or up to $3,000 of ordinary income per year for individuals) per IRS rules (see IRS Publication 550).
- Improve lifetime, after‑tax wealth through better asset location and harvesting choices.
Key building blocks
- Account types and their tax behavior
- Taxable brokerage accounts: Sales generate capital gains or losses reported on Form 1099‑B; basis matters here. Brokers issue 1099‑B showing proceeds and, for many securities, the broker‑reported cost basis (covered securities).
- Tax‑deferred accounts (traditional IRAs, 401(k)s): Transactions inside these accounts do not produce capital gains or losses; withdrawals may be taxable as ordinary income.
- Tax‑free accounts (Roth IRAs): Capital growth is sheltered; selling inside a Roth has no capital gains tax if rules are met.
- Lot methods and broker reporting
- FIFO (first in, first out) is the default tax-lot method if you don’t specify another method.
- Specific identification lets you tell your broker which lots you’re selling (best for optimization), but you must make that election at the time of sale and follow the broker’s procedures.
- Brokers began reporting adjusted cost basis for many securities starting in 2011, and the list of “covered securities” expanded later. You’ll typically receive a Form 1099‑B that lists proceeds and basis information — review it carefully against your records (IRS, Form 1099‑B instructions).
-
Holding period: short‑term vs long‑term
Capital gains tax rates differ by holding period. Selling the lot that qualifies for long‑term treatment (held > 1 year) will generally lower tax than selling short‑term lots. That consideration often guides which lot you choose to sell first. -
Wash sale rule
The wash sale rule disallows a loss if you (or your spouse or a related party) buy a substantially identical security within 30 days before or after the sale. Critically, a repurchase in any account you control — including IRAs — can trigger a wash sale. Losses disallowed under the wash sale rule generally cannot be claimed (see IRS Publication 550 on wash sales). For example, selling a loss in a taxable account and buying the same stock inside your IRA within 30 days may permanently disallow the loss.
Practical optimization strategies
-
Prioritize tax-inefficient assets for tax-deferred accounts
Place bonds, REITs, and high‑turnover active funds in tax‑deferred accounts where ordinary income or short‑term realized gains would otherwise be taxed at higher rates. This is classic asset location and pairs with cost‑basis optimization across accounts (see our guide on tax‑efficient asset location). -
Use specific identification in taxable accounts
When you need to sell, instruct your broker to use specific identification and name the lot(s) you want sold. Doing this lets you choose lots that yield long‑term gains or larger losses when advantageous. Note: the election must be clear and timely per your broker’s rules and tax reporting requirements. -
Harvest losses thoughtfully across accounts
Tax‑loss harvesting — selling losing positions to realize losses and immediately replacing exposure with a similar (but not substantially identical) security — can reduce taxes now and provide wash‑sale protection when implemented correctly. For multi‑account portfolios, coordinate harvests across all your accounts; you can inadvertently trigger wash sales if you repurchase a substantially identical security in another account. For a deeper workflow, see our article on Maximizing tax‑loss harvesting across multiple accounts. -
Strategically harvest gains
If you expect to be in a lower tax bracket in the future, consider deferring gains. Conversely, in a low‑income year, realize long‑term gains up to the 0% or lower bracket for capital gains (if eligible) to lock in tax‑free or low‑tax gain recognition. -
Reconcile broker records and Form 1099‑B
Brokers report lot and basis data, but their records may not reflect transfers, inherited shares, or broker adjustments. Reconcile your own ledger to the 1099‑B before filing. If you disagree with the broker’s basis, provide supporting records and correct your tax return as needed (See IRS guidance on basis reporting and Form 1099‑B instructions).
Example (illustrative)
You hold 100 shares of Fund X across two taxable accounts and an IRA:
- Taxable A: 50 shares purchased at $10 (long‑term)
- Taxable B: 30 shares purchased at $25 (short‑term)
- IRA: 20 shares purchased at $5 (inside tax‑deferred)
You want to sell 50 shares. If your goal is to minimize taxes today, specific‑identify the 50 long‑term shares from Taxable A. Selling those yields lower tax than selling the short‑term lots. Selling in the IRA has no capital gains consequence, but you cannot “harvest” a loss in an IRA for current tax use.
Common pitfalls to avoid
- Assuming losses can be harvested when you repurchase the same security inside an IRA — wash‑sale rules likely block that loss.
- Forgetting that lot elections often must be made at sale time and communicated to the broker.
- Neglecting cost basis on inherited assets: many inherited shares receive a step‑up in basis to fair market value at death; verify broker entries and tax reporting.
- Letting default FIFO sales generate short‑term gains when specific identification would have produced long‑term gains.
Tools and operational tips
- Use tax‑lot reporting tools: Many brokerages offer tax‑lot views and sale‑time selection menus. Third‑party portfolio software can consolidate lots across multiple brokers.
- Create a consolidated lot ledger: Keep a master worksheet that records original purchase dates, prices, transfers, and any corporate actions (splits, mergers, dividends reinvested).
- Coordinate with your tax preparer before year‑end: For near‑year‑end trades, confirming lot choices and harvest opportunities can affect last‑minute tax planning.
Who benefits most
- Investors with multiple taxable accounts at different brokers.
- Households balancing taxable accounts with IRAs and Roths.
- Advisors and wealth managers who implement tax‑aware trading for clients.
When cost‑basis optimization won’t help
- In accounts where transactions don’t generate tax (e.g., Roth): cost basis inside the Roth does not produce tax consequences for typical qualified distributions.
- When trading costs or tracking complexity outweigh tax savings. Small-dollar optimizations can be swallowed by commissions or time costs.
Related topics and next steps
-
If you want practical implementations, read our deeper pieces on tax‑loss harvesting and asset location: “Maximizing tax‑loss harvesting across multiple accounts” and “Tax‑Efficient Asset Location Across Accounts”. These guides explain workflows and allocation decisions for multi‑account households.
-
For an overall approach to after‑tax returns, see our guide on “Tax‑Aware Investing for Better After‑Tax Returns”.
(Internal links)
- Maximizing tax‑loss harvesting across multiple accounts: https://finhelp.io/glossary/maximizing-tax-loss-harvesting-across-multiple-accounts/
- Tax‑Efficient Asset Location Across Accounts: https://finhelp.io/glossary/tax-efficient-asset-location-across-accounts/
- Tax‑Aware Investing for Better After‑Tax Returns: https://finhelp.io/glossary/tax-aware-investing-for-better-after-tax-returns/
Authoritative sources and further reading
- IRS Publication 550, Investment Income and Expenses (wash sale rules, capital gains treatment).
- IRS Form 1099‑B instructions and cost‑basis reporting guidance (broker reporting of covered securities).
- SEC: Basics of Investing (for general investor education).
Professional disclaimer
This article is educational and for general informational purposes only. It does not constitute personalized tax, legal, or investment advice. Tax law changes and the details of your situation can materially affect outcomes; consult a qualified tax professional or financial advisor before implementing strategies described here.
Final checklist for implementation
- Consolidate lot data from all brokerages and custodians.
- Decide asset‑location targets (which assets in taxable vs tax‑deferred vs Roth).
- When selling in taxable accounts, use specific identification when beneficial and confirm broker procedures.
- Avoid repurchasing substantially identical securities in any account within 30 days of a loss sale.
- Reconcile Form 1099‑B against your records each year and retain supporting documentation.
If you’d like a worksheet or template to consolidate lots across brokers, consult a financial advisor or use third‑party portfolio software that supports cross‑broker tax‑lot accounting.

