Schwab Cost Basis Methods: Which Shares Sell First and Why It Matters

When you sell part of a position at Schwab, the cost basis method on the order decides which of your shares are treated as sold. It does not change what you get for them. It changes the gain or loss you report, and whether that gain counts as short-term or long-term. If you never chose a method, your account's default is used, and the IRS fallback when nothing is identified is that the first shares you bought are the first ones sold.
This page covers the six methods Schwab's thinkorswim platform lists, how to change the method for one order or for the whole account, the IRS rules underneath, and what happens when software places the sell for you. It also has a worked example on real prices. We took the same sale, a third of a position built up over three years, and ran it under each method on eight stocks and funds. At the median, selling the oldest shares first reported a gain equal to 47% of the money received. Selling the highest-cost shares first reported 4%. Same number of shares, same day, same price.
One caution before the detail. This is an explanation of how the methods work, not tax advice. Which method suits you depends on your income, your other gains and losses and your plans for the shares you keep, and a tax professional is the person to ask.
Schwab's cost basis methods in one table
Every time you buy, the shares you get form a tax lot: a batch with its own purchase date and price. Sell fewer shares than you own and something has to decide which lots the sale comes from. The thinkorswim manual lists six tax lot methods and describes each in a line.
| Method | Which shares are sold first | What that usually does | Can be the account default? |
|---|---|---|---|
| First In First Out (FIFO) | The oldest shares | In a stock that has risen, the oldest lots tend to have the biggest gains, and they are the most likely to be long-term | Yes |
| Last In First Out (LIFO) | The most recent shares | Recent lots are closer to today's price, so the gain is often smaller, and more likely to be short-term | Yes |
| High Cost Lot | The shares with the highest cost | Reports the smallest gain or the largest loss available | Yes |
| Low Cost Lot | The shares with the lowest cost | Reports the largest gain available | Yes |
| Best Tax | Chosen so that "the tax impact of each sale is minimized" | Aims at the tax owed, not at cost alone. The manual does not spell out the order it uses | Yes |
| Specified Lot | The lots you pick by hand, in the order you pick them | Full control over each sale | No. The manual says it "cannot be set as default" |
Two notes on names. Schwab's website uses the name Tax Lot Optimizer for its tax-minimizing method, and thinkorswim's manual lists a method called Best Tax with the same stated aim. And mutual funds can also use an average cost method, which the IRS allows for mutual fund shares and certain dividend reinvestment plans but not for ordinary shares of stock. Schwab's own pages refuse automated readers, so we could not confirm that those two names are one method, read how it orders lots, or check which method a new account starts with. Look at your own account's cost basis settings for all three.
How to change the cost basis method at Schwab
For one order, in thinkorswim
- Build the sell order as usual in the Order Entry tool.
- Click the settings icon at the far right of the order line. That opens Order Rules.
- Pick a tax lot method from the list. For Specified Lot, choose the lots and the order they are sold in.
- Read the summary at the bottom of the window, click Save, then Confirm and Send.
The manual adds two details that catch people. A saved order does not keep the choice: "the tax lot information cannot be saved with orders." And the gain or loss you see during the day is figured with your default method; it is "updated using your Specified Lot instructions the following business day." So a specified-lot sale can look wrong on the day you make it and right the next morning.
For the whole account
The default is not set in thinkorswim. The manual says "your default tax lot method can be changed on Schwab.com." Because we cannot read Schwab's site by machine, we are not quoting the menu path; look for the cost basis method in your account's settings. A change can only affect later sales, since the IRS wants the shares identified at the time of each sale.
When to decide
Before the order goes in. IRS Publication 550 says that when a broker holds your shares, you have identified the shares sold if you "tell your broker or other agent the particular stock to be sold or transferred at the time of the sale or transfer" and get a written confirmation "within a reasonable time." Choosing the method on the order, or having a default on the account, is how that instruction gets recorded. You cannot go back in February and pick a better lot for a sale made in November.
The IRS rules underneath
- If you identify the shares, their basis is what you paid for those shares. Publication 550: "If you can adequately identify the shares of stock or the bonds you sold, their basis is the cost or other basis of the particular shares of stock or bonds."
- If you do not, the oldest go first. "If you buy and sell securities at various times in varying quantities and you cannot adequately identify the shares you sell, the basis of the securities you sell is the basis of the securities you acquired first."
- No averaging for ordinary stock. "Except for certain mutual fund shares," the same passage says, "you cannot use the average price per share to figure gain or loss on the sale of the shares."
- One year is the line. "If you hold investment property more than 1 year, any capital gain or loss is a long-term capital gain or loss." The count starts the day after the trade date of the purchase and ends on the trade date of the sale, not the settlement date.
- The two kinds of gain are taxed differently. Per IRS Topic 409, long-term gains are taxed at 0%, 15% or 20% depending on taxable income, with a few exceptions, while "net short-term capital gains are subject to taxation as ordinary income at graduated tax rates."
- Your broker reports it. For shares bought after 2010, Publication 550 says "your broker should send you a Form 1099-B that shows your basis." The lots Schwab's records show as sold are the lots on that form.
One more rule sits beside these. A loss is not deductible if you buy the same or a substantially identical stock within 30 days before or after the sale. Methods that reach for losing lots first make that rule matter more, and so does any system that sells and rebuys the same symbol. The wash sale rule, explained has the 61-day window in detail.
The same sale under five methods, on real prices
To see how far apart the methods land, we built the same position in eight names: $1,000 bought at the close on the first trading day of every month for 36 months, December 2023 through November 2026. Then, on November 17, 2026, we sold one-third of the shares. Twenty-four of the 36 lots had been held more than a year on that date. The only thing that changes from column to column below is which lots the sale is taken from.
| Position | FIFO | LIFO | High Cost | Low Cost | Loss-first |
|---|---|---|---|---|---|
| Apple | 46% gain | 19% gain | 19% gain | 47% gain | 34% gain |
| Amazon | 33% gain | 6% gain | 5% gain | 34% gain | 11% gain |
| AMD | 70% gain | 51% gain | 49% gain | 78% gain | 60% gain |
| Nvidia | 57% gain | 20% loss | 20% loss | 58% gain | 20% loss |
| Palantir | 88% gain | 29% gain | 29% gain | 88% gain | 42% gain |
| Tesla | 47% gain | 2% loss | 5% loss | 49% gain | 4% loss |
| SPY (S&P 500 ETF) | 30% gain | 3% gain | 3% gain | 30% gain | 7% gain |
| QQQ (Nasdaq-100 ETF) | 34% gain | 1% gain | 1% gain | 34% gain | 5% gain |
| Median of the eight | 47% gain | 5% gain | 4% gain | 48% gain | 9% gain |
The gap is large. Across the eight positions, the method that reported the most gain and the method that reported the least were a median 31 percentage points of proceeds apart, and never less than 27. Put in dollars: on $10,000 of stock sold, the median FIFO sale reported about $4,650 of gain and the median High Cost sale about $400.
Nvidia shows the extreme. Its price on the sale date was below what 16 of the 36 monthly purchases had paid, but far above the earliest ones. Under FIFO the sale reported a gain equal to 57% of proceeds. Under High Cost the very same sale reported a loss equal to 20% of proceeds.
| Position | FIFO | LIFO | High Cost | Low Cost | Loss-first |
|---|---|---|---|---|---|
| Apple | 0% | 14% | 14% | 0% | 0% |
| Amazon | 0% | 5% | 2% | 0% | 1% (loss) |
| AMD | 0% | 20% | 20% | 0% | 1% (loss) |
| Nvidia | 0% | 17% (loss) | 17% (loss) | 0% | 17% (loss) |
| Palantir | 0% | 1% | 1% | 0% | 2% (loss) |
| Tesla | 0% | 2% (loss) | 3% (loss) | 0% | 4% (loss) |
| SPY (S&P 500 ETF) | 0% | 1% | 1% | 0% | 1% (loss) |
| QQQ (Nasdaq-100 ETF) | 0% | 1% (loss) | 1% (loss) | 0% | 3% (loss) |
The second table is why the smallest gain is not automatically the smallest tax bill. FIFO sold only shares held more than a year in all eight cases, so its gain, though the largest, was entirely long-term. High Cost reported the smallest total every time, but in Apple 14% of the proceeds came back as short-term gain, the kind taxed as ordinary income. Our loss-first ordering reported more total gain on Apple (34% of proceeds against 19%) and none of it short-term. Which of those is cheaper depends on the seller's tax bracket, which is exactly the judgment a tax-minimizing method or a tax professional is making.
Two limits on what this shows. It is one buying pattern on one sale date in a stretch when most of these prices rose a great deal; a falling market would reverse which method looks kind. And no method makes a gain disappear. Selling high-cost lots today leaves the low-cost lots in the account, with their larger gain still waiting. The choice moves tax between years and between short-term and long-term. It does not delete it.
What an automated sell uses
Software that trades a Schwab account does it through the Schwab Trader API. An order sent that way can carry a tax lot method. The schwab-py library's list of accepted values is FIFO, LIFO, HIGH_COST, LOW_COST, AVERAGE_COST, SPECIFIC_LOT and LOSS_HARVESTER. If the order does not carry one, the account's default applies, the same as an order you place by hand without opening Order Rules. Schwab API with Python covers the library itself.
Here is what ours does, read from our own integration code. When JorgAI sells shares in a Schwab account it sends the instruction, the symbol and the number of shares. It does not send a tax lot method and it does not pick lots. Schwab applies whatever default is set on the account. So the setting that governs every automated sale is the one on schwab.com, and it is worth choosing before automation is switched on, not after the first year of trades. How to automate trading in a Schwab account covers the rest of the connection, and the stop and bracket order guide covers the exit orders those sales come from.
Three things follow for anyone running rules on a taxable account. An exit that sells a whole position has no lot question at all, because every lot is sold. A system that buys the same stock several times and sells part of it does. And a system that sells at a loss and buys the same symbol back inside 30 days can turn that loss into a wash sale no matter which method is set. None of this applies inside an IRA, where sales are not taxed as they happen; automated trading inside an IRA covers that case. Order conditions built in thinkorswim itself are a separate route, described in can you automate thinkorswim.
Quick answers
What is the default cost basis method at Schwab?
It is whatever is set on your account, and you can see it in the account's cost basis settings on schwab.com. If no shares are identified for a sale, the IRS rule is first in, first out: the shares bought first are treated as sold first.
How do I change the tax lot method for one trade at Schwab?
In thinkorswim, click the settings icon on the order line to open Order Rules and pick a tax lot method before you send the order. The choice has to be made at the time of the sale.
What is Schwab's Tax Lot Optimizer?
It is Schwab's name for a method that chooses lots to keep the tax on each sale low. thinkorswim lists a method called Best Tax and describes it as one where "the tax impact of each sale is minimized." The exact order Schwab uses is on its own site, which we could not read by machine.
Is FIFO or LIFO better for stocks?
Neither in general. In our example FIFO reported the larger gain on every position, a median 47% of proceeds against 5% for LIFO, but all of FIFO's gain was long-term. The answer depends on your tax bracket and on whether you would rather pay now or later.
What does HIFO mean?
Highest in, first out: sell the shares with the highest cost first. Schwab's platform lists it as High Cost Lot. It reports the smallest gain or largest loss available, without regard to how long the shares were held.
Can I use average cost for stocks at Schwab?
Not for ordinary shares of stock. The IRS allows the average basis method for mutual fund shares and certain dividend reinvestment plans; for other stock, Publication 550 says you cannot use the average price per share.
Which tax lots does a trading bot sell?
Whichever the order or the account says. The Schwab Trader API accepts a tax lot method on an order; if the software does not send one, the account default applies. JorgAI does not send one, so your Schwab default decides.
Can I change the lots after a sale?
The IRS requires the shares to be identified at the time of the sale, with a written confirmation from the broker. Plan the method before the order.
Sources, read November 18, 2026: the thinkorswim Learning Center's Order Entry Tools page (Order Rules and Saved Orders); IRS Publication 550 (2025), Investment Income and Expenses; IRS Topic 409, Capital Gains and Losses (reviewed November 9, 2026); the schwab-py library's order definitions for the Trader API's tax lot values; and JorgAI's own Schwab integration code. Schwab's website refuses automated readers, so nothing here describes schwab.com's screens from a reading of them. The example uses Yahoo Finance closing prices, adjusted for splits, and is arithmetic by JorgAI. Schwab, thinkorswim and Tax Lot Optimizer are names of Charles Schwab & Co., Inc., and JorgAI is not affiliated with or endorsed by Schwab.
If you want exits placed by rules you set once, connecting a Schwab account to JorgAI takes a few minutes, and the start page walks through the settings before any order is placed.
This article explains how cost basis methods work and is not tax, legal or investment advice or a recommendation of any broker, security or method. Tax rules change and depend on your circumstances; consult a qualified tax professional. JorgAI is software that carries out the rules you set in your own brokerage account; it is not an investment adviser and does not give tax advice. Past price behavior is descriptive only. Trading involves risk of loss.
More in Getting Started
Keep reading
Let the AI do the trading.
Set it up in minutes. 7 day free trial on Starter, Plus and Pro.
Get started freeGet the weekly market read and new tools by email
One email a week: what moved, what the data says, and the next free tool when it ships. No spam, unsubscribe in one click.
More from the blog
Every other post, newest first
260 more posts
Stops, targets and a daily loss limit, enforced for you.
JorgAI runs the rules you set inside your own brokerage account. Zero withdrawal permissions, disconnect anytime.
Showing 18 of 260. Keep scrolling.




















