Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesiTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Selling shares in a taxable brokerage account to pay for a renovation, tuition, home, vehicle or another major purchase usually creates a capital gain or loss. Federal tax is generally based on the gain—the sale proceeds minus the adjusted basis of the shares sold—not on all the cash you withdraw. The result depends on the specific tax lots, holding period, tax year, filing status and your other income.
This guide covers the federal rules for a U.S. individual investor. State and local taxes, retirement accounts, employee equity and options can follow different rules, so treat the federal framework as a starting point rather than a personal tax calculation.
What is taxed when you sell shares?
The sale is a disposition of a capital asset. The IRS describes the calculation this way: “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.” Your reason for selling does not change that formula. Funding a kitchen remodel, college bill or other large purchase is not itself a deduction.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Amount realized is generally the sale proceeds after transaction costs. Adjusted basis is your tax investment in the shares, adjusted for items such as commissions, transfer fees, reinvested dividends, splits, mergers and other corporate actions. The difference is the gain or loss for the shares actually sold.
#1 Best Overall
- Tax prep made smarter: With AI Tax Assist, you can get real-time expert answers from start to finish.
- Step-by-step Q&A and guidance
- Quickly import your W-2, 1099, 1098, and last year's personal tax return, even from TurboTax and Quicken software
- Itemize deductions with Schedule A
- Accuracy Review checks for issues and assesses your audit risk
Illustrative calculation
Suppose you sell shares for $40,000 and the adjusted basis of those shares is $25,000. The capital gain is $15,000. Selling $40,000 of stock does not automatically make $40,000 taxable. If the basis were $45,000 instead, the transaction would produce a $5,000 capital loss.
The example does not determine your bill. The gain must be combined with your other capital transactions, classified as short-term or long-term, and considered alongside your taxable income and filing status.
Which shares you sell can change the result
Buying the same company’s stock at different times creates separate tax lots. Each lot can have a different basis, holding period and unrealized gain or loss. Before placing an order, review the broker’s tax-lot choices and select the lots deliberately when the brokerage allows specific identification.
Recommended Free Tools
Specific-lot identification
To use a particular lot, you generally identify it with the broker when you sell and obtain confirmation of the shares sold. Selling high-basis lots can realize less gain than selling low-basis lots, while selling a loss lot may offset gains elsewhere. A lot’s age also determines whether its result is short-term or long-term.
FIFO when lots are not adequately identified
If you cannot adequately identify the shares sold, first-in, first-out (FIFO) generally applies. FIFO treats the oldest shares as sold first. That can produce a different gain and holding period from the lots you had in mind, so save the broker’s confirmation and verify the final Form 1099-B.
Rank #2
- TurboTax Desktop Edition is download software which you install on your computer for use
- Requires Windows 11 or macOS Sonoma or later (Windows 10 not supported)
- Recommended if you own a home, have charitable donations, high medical expenses and need to file both Federal & State Tax Returns
- Includes 5 Federal e-files and 1 State via download. State e-file sold separately. Get U.S.-based technical support (hours may vary).
- Live Tax Advice: Connect with a tax expert and get one-on-one advice and answers as you prepare your return (fee applies)
Average basis is not the general stock rule
Average-basis treatment has limited exceptions, including certain mutual-fund shares and dividend-reinvestment-plan arrangements. Do not apply an average basis to ordinary individual stock merely because the account contains many purchases. Check the security type and the broker’s method.
Check whether the basis is complete
Brokers generally report basis for covered securities, but older or otherwise noncovered shares may have incomplete or missing basis information. Compare the 1099-B with trade confirmations, account statements, reinvested-dividend records and corporate-action notices. You remain responsible for correcting an inaccurate or incomplete basis before filing.
Short-term versus long-term gains
The holding period normally controls the character of the gain. Shares held one year or less before disposition produce short-term results. Shares held more than one year produce long-term results. The purchase date is generally not counted as day one; use the broker’s dates and the applicable tax instructions when the dates are close.
Short-term treatment
Net short-term capital gains are taxed at graduated ordinary-income rates. They are combined with your other ordinary taxable income rather than receiving the preferential long-term capital-gains brackets.
Long-term treatment
Net long-term capital gains may qualify for lower rates, depending on taxable income and the tax year. For tax year 2025, IRS Topic 409 lists 0%, 15% and 20% brackets for most net capital gains. The thresholds below are taxable-income thresholds for that tax year, not a permanent rate card:
Rank #3
- Premium: Windows 10 or higher and Business: Windows 11
- Tax prep made smarter: With AI Tax Assist, you can get real-time expert answers from start to finish.
- Quickly import your W-2, 1099, 1098, and last year's personal tax return, even from TurboTax and Quicken software
- Five free federal e-files and unlimited federal preparation and printing
- Free e-file included for most business forms
| Filing status | 0% rate up to | 15% rate up to | 20% rate generally applies above |
|---|---|---|---|
| Single or married filing separately | $48,350 | $533,400 | More than $533,400 |
| Married filing jointly or qualifying surviving spouse | $96,700 | $600,050 | More than $600,050 |
| Head of household | $64,750 | $566,700 | More than $566,700 |
These figures come from the IRS for the 2025 tax year. A different sale year can have different thresholds, and the rates do not apply identically to every type of gain. The IRS identifies exceptions such as collectibles, qualified small-business stock and unrecaptured section 1250 gain.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →How losses, wash sales and other gains interact
Capital gains and losses are netted under the applicable rules. Losses can offset gains, including gains from other investments. If total capital losses exceed total capital gains, the deduction against other income is generally limited to $3,000 per year, or $1,500 for married filing separately. Unused losses generally carry forward to later years.
Wash-sale risk after selling at a loss
A loss is not always immediately usable. IRS Publication 550 discusses the wash-sale rule, which can defer a loss when you buy substantially identical securities within 30 days before or after the loss sale. The rule can apply even when the replacement purchase occurs in another account, and broker reporting may not capture every cross-account situation. Keep a complete record of purchases around the sale date and do not assume a reported loss is currently deductible without checking the rule.
Losses do not turn the purchase into a deduction
The cash you spend after selling shares remains a personal expenditure unless a separate tax rule applies to the underlying activity. A capital loss may reduce investment gains or, within the annual limit, other income; it does not make a personal purchase deductible.
How the sale appears on your tax return
Most stock sales are reported on Form 8949 and summarized on Schedule D (Form 1040). Your broker generally sends Form 1099-B showing proceeds and, for covered securities, acquisition date, basis and whether the transaction is short-term or long-term.
Rank #4
- TurboTax Desktop Edition is download software which you install on your computer for use
- Requires Windows 11 or macOS Sonoma or later (Windows 10 not supported)
- Recommended if you are self-employed, an independent contractor, freelancer, small business owner, sole proprietor, or consultant
- Includes 5 Federal e-files and 1 State via download. State e-file sold separately. Get U.S.-based technical support (hours may vary)
- Live Tax Advice: Connect with a tax expert and get one-on-one advice and answers as you prepare your return (fee applies)
Reconcile the broker data
- Match each sale to the correct security, date, quantity and tax lot.
- Verify basis adjustments for commissions, reinvested dividends, splits, mergers and other corporate actions.
- Correct missing or inaccurate basis for noncovered shares using your own records.
- Check that short-term and long-term classifications agree with your holding periods.
- Enter adjustments required by wash-sale or other rules rather than copying every 1099-B field without review.
Keep confirmations and basis documentation with your tax records. A broker’s covered-security report is useful evidence, but it does not relieve you of reconciling the return.
Could a large sale require estimated tax payments?
A large gain can increase the tax due for the year and may create an estimated-payment issue. Under the IRS’s general individual test, estimated payments may be required when both conditions apply:
- You expect to owe at least $1,000 after withholding and credits for the current year.
- Your withholding and credits are below the smaller of 90% of your current-year tax or generally 100% of your prior-year tax. For certain higher-income taxpayers, the prior-year comparison is 110%.
The IRS’s estimated-tax FAQ states: “Generally, you must make estimated tax payments for the current tax year if both of the following apply.” The safe-harbor comparison is not the same as the final tax liability. Your result depends on total income, withholding, credits, the timing of the sale and when payments are made. Recalculate after a substantial transaction and use the applicable year’s IRS instructions.
When the 3.8% net investment income tax can apply
The net investment income tax (NIIT) is separate from the ordinary capital-gains rates. It can apply at 3.8% to the lesser of your net investment income or the amount by which modified adjusted gross income exceeds the applicable threshold. Stock gains are generally among the income types considered in net investment income.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
| Filing status | Modified adjusted gross income threshold |
|---|---|
| Single or head of household | $200,000 |
| Married filing jointly or qualifying surviving spouse | $250,000 |
| Married filing separately | $125,000 |
Do not simply add 3.8% to every stock sale. The tax depends on both the threshold test and the amount of net investment income, as well as the rest of your return.
Best Value
- TurboTax Desktop Edition is download software which you install on your computer for use
- Requires Windows 11 or macOS Sonoma or later (Windows 10 not supported)
- Recommended if you have a partnership, own an S or C Corp, Multi-Member LLC, manage a trust or estate, or need to file a separate tax return for your business
- Includes 5 Federal e-files. Business State forms sold separately via download. Get U.S.-based technical support (hours may vary).
- Prepare and file your business or trust taxes with confidence
A practical way to choose lots for a large cash need
Tax is one input in a sale decision, not the only one. Compare the available lots using the following sequence:
- Set the cash target. Include the amount needed for the purchase, expected trading costs and a cash reserve so you do not have to sell again immediately.
- List every candidate lot. Record quantity, purchase date, adjusted basis, unrealized gain or loss and the broker’s covered or noncovered status.
- Classify holding periods. Separate lots that are already long-term from those that would be short-term if sold now. If a near-term holding-period date matters, weigh the market risk of waiting against the possible tax difference.
- Model the tax interaction. Consider gains and losses elsewhere in the year, available capital-loss carryforwards, your expected ordinary income and possible NIIT exposure. A tax professional or tax software that supports Forms 8949 and Schedule D can help with a complex return.
- Check portfolio risk. Selling a low-gain lot may save tax but leave you concentrated in one company or sector. Selling a high-gain lot may be preferable if it materially reduces concentration or meets the cash deadline.
- Confirm the order. Use the broker’s specific-lot election, save the confirmation and recheck the final 1099-B.
This framework does not identify a universally best lot. The right choice depends on your tax year, portfolio, purchase deadline, risk tolerance and records.
Worked example with two tax lots
Assume you need $30,000 and own two lots of the same stock:
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match| Lot | Value sold | Adjusted basis | Holding period | Illustrative result |
|---|---|---|---|---|
| A | $15,000 | $5,000 | More than one year | $10,000 long-term gain |
| B | $15,000 | $14,000 | One year or less | $1,000 short-term gain |
Selling both lots raises the same $30,000, but it creates two different tax characters and a combined $11,000 gain. Selling only one lot would change both the gain amount and the holding-period mix. The table is an illustration, not a prediction of the tax due; your other income, deductions, losses and filing status determine the applicable rates.
Situations that need extra care
Employee shares, options and restricted equity
Employer stock plans and options can have separate ordinary-income, basis and holding-period rules. The amount included as compensation may affect basis, and a later sale can create an additional capital gain or loss. IRS Topic 427 addresses stock options. Do not rely on a standard brokerage workflow when the shares came from compensation.
Retirement accounts
This guide assumes a taxable investment account. Sales inside retirement arrangements generally follow different tax mechanics, so do not transfer these rules directly to an IRA or other retirement account.
State and local tax
The federal framework above does not establish your state or local liability. Residence, state sourcing rules and local taxes can change the total cost of selling. Check the rules for the jurisdiction where you file.
Free tools Windows power users keep installed
One-click scans. No signup required.
Records and questions to resolve before selling
- Which account holds the shares, and is it taxable or retirement?
- Are any shares from an employee plan, option exercise or restricted award?
- Can you identify the exact lots, and do your records support their basis?
- Will the sale be short-term or long-term for each lot?
- Do you have other gains, losses or loss carryforwards this year?
- Could the gain push modified adjusted gross income above an NIIT threshold?
- Will withholding and credits satisfy an estimated-tax safe harbor?
- Have you bought substantially identical securities within the 30-day wash-sale windows?
- Which federal tax year applies, and what state or local rules also apply?
Resolve these questions before trading when possible. For missing basis, employee equity, a very large gain, uncertain wash-sale exposure or NIIT and estimated-payment questions, individualized advice is safer than relying on a proceeds-only estimate.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

