Learn how stock sales are tracked from an accounting perspective, including cost basis, realized gains and losses, settlement timing, wash sales, and the records individual taxpayers should keep.
What you need to know
Selling stock is not simply a matter of comparing what you received with what you paid. From an accounting and tax-record perspective, each sale needs to be connected to the specific shares sold, their cost basis, any reinvested dividends or adjustments, and the date of the transaction. That information determines whether the sale created a gain or loss and supports the amounts reported on a tax return.
For most individual investors, a brokerage statement and tax forms provide much of the starting information. Still, the investor remains responsible for checking that the reported basis, holding period, and share selection are accurate—especially when shares were transferred between brokers, inherited, received as a gift, or affected by a stock split or similar corporate action.
Start With the Core Accounting Equation for a Stock Sale
At its simplest, a stock sale produces a realized gain or loss:
Sale proceeds − adjusted cost basis − selling costs = realized gain or loss
The terms matter:
- Sale proceeds are generally the gross amount received from the sale before applicable selling expenses.
- Cost basis generally begins with what was paid for the shares, including certain acquisition costs where applicable.
- Adjusted basis reflects later changes to basis, such as certain reinvested distributions, stock splits, return-of-capital distributions, or other corporate actions.
- Selling costs may reduce the amount realized. A broker’s reporting typically reflects the transaction details, but the presentation should be reviewed rather than assumed.
A gain or loss is generally *realized* when the shares are sold. A stock that rises or falls in value while it remains in the account has an unrealized gain or loss. Unrealized changes may be meaningful for investment planning, but they ordinarily are not reported as a completed sale simply because the market value changed.
For an individual investor, this distinction is practical: portfolio value may change every day, while the reportable transaction is tied to the completed disposition of shares.
Hypothetical scenario: a straightforward sale
Assume Jordan bought 20 shares for a total of $1,000 and later sold them for $1,300. Assume no basis adjustments or transaction costs for simplicity.
- Sale proceeds: $1,300
- Adjusted cost basis: $1,000
- Realized gain: $300
The $300 is the economic gain on the sale. Tax treatment can depend on the holding period and other facts, but the accounting record begins with documenting the purchase and sale accurately.
You do not need to diagnose the issue before reaching out.
Cost Basis Depends on Which Shares Were Sold
Many investors purchase the same stock more than once. When that happens, the account may contain separate lots of shares acquired on different dates and at different prices. The lot selected for sale can change both the amount of gain or loss and the holding period.
For example, suppose Morgan owns:
| Purchase lot | Shares | Total cost | Purchase timing | |---|---:|---:|---| | Lot A | 10 | $500 | Earlier purchase | | Lot B | 10 | $800 | Later purchase |
If Morgan sells 10 shares for $700, the outcome differs depending on the lot sold:
- Selling Lot A produces a $200 gain before other adjustments.
- Selling Lot B produces a $100 loss before other adjustments.
Brokerage platforms may use a default method to identify shares when no instruction is provided. Investors should understand that default before placing a sale order. If a taxpayer specifically identifies shares to sell, documentation of that instruction and the broker’s confirmation can be important.
A related issue is the holding period. In general, shares held for more than one year before sale may receive different tax treatment than shares held for one year or less. The correct acquisition date for the particular lot sold is therefore as important as its purchase price.
Brokerage Tax Forms Are Important, but They Are Not the Entire Record
After the end of the year, a broker may issue a tax statement that reports proceeds from securities transactions and, for many transactions, cost basis and whether the basis was reported to the tax authorities. These forms are valuable, but they should be treated as reporting documents to reconcile—not as a substitute for maintaining records.
Review the statement against your own transaction history when any of these circumstances apply:
- Assets were transferred from another brokerage account. Historical basis data may not always transfer completely or correctly.
- Shares were inherited or received as a gift. Basis rules can differ from a standard cash purchase and depend on the facts.
- A stock split, merger, spinoff, return of capital, or similar event occurred. These events can alter the basis allocation among shares.
- Dividends were reinvested. Reinvested amounts can create additional share lots with their own basis and acquisition dates.
- You exercised options, received employer stock, or participated in an employee stock plan. The basis shown by a broker may require adjustment depending on prior income reporting and plan details.
- You sold securities at a loss and repurchased substantially identical securities near the sale date. Wash-sale rules may affect the currently deductible loss.
The goal is not to recreate every brokerage calculation from scratch. It is to identify transactions where the broker may not have all the information needed to reflect your full tax basis.
Hypothetical scenario: reinvested dividends create another lot
Assume Casey purchased shares for $2,000. Later, a $75 dividend was automatically reinvested and used to buy additional shares. If the dividend was taxable when paid, the reinvestment generally creates an additional basis amount in the newly acquired shares.
If Casey later sells all shares, using only the original $2,000 purchase amount would likely overstate the gain. The records should account for the separate shares acquired through dividend reinvestment and their associated basis.
Trade Date, Settlement Date, and the Timing of a Sale
Investors often see both a trade date and a settlement date on brokerage confirmations. The trade date is generally the date the sale was executed. The settlement date is when the exchange of cash and securities is completed under market settlement procedures.
For many tax-reporting purposes, the trade date is the key date used to determine the year of sale and the start or end of a holding period. However, unusual transactions and specific account circumstances can require closer review. It is sensible to retain the broker confirmation showing both dates rather than relying on memory or the date cash became available to withdraw.
Hypothetical scenario: a year-end sale
Assume Taylor sells stock in the final days of a calendar year, but settlement occurs in the following year. The trade confirmation should be reviewed carefully because the transaction may be treated as a sale in the year of the trade date for reporting purposes. The availability of cash after year-end does not necessarily control the reporting year.
This is one reason year-end tax planning should account for transactions already executed, not just cash movements in the brokerage account.
Stock Losses Require Extra Attention to Wash-Sale Rules
A loss on the sale of stock may be meaningful for tax planning, but not every economic loss is immediately available for tax purposes. Under wash-sale rules, selling stock or securities at a loss and acquiring substantially identical stock or securities within the relevant window may defer the loss rather than allow it currently.
The rule can be more complicated than it first appears. Potential replacement purchases may occur before or after the loss sale, and automatic dividend reinvestment or purchases in another account may be relevant. The analysis may also involve transactions connected to a spouse, depending on the facts.
When a wash sale applies, the disallowed loss is generally not simply erased. Instead, it is generally added to the basis of the replacement shares, potentially affecting gain or loss when those shares are sold later. The holding period may also require adjustment.
Hypothetical scenario: loss sale followed by a repurchase
Assume Avery sells shares for $900 that had an adjusted basis of $1,200, creating a $300 loss. Shortly thereafter, Avery purchases substantially identical shares. Depending on the timing and facts, wash-sale rules may apply.
If they do, Avery may not be able to use the $300 loss currently. Instead, the replacement shares may receive a basis adjustment related to the disallowed loss. This is why an investor should review the entire purchase-and-sale pattern rather than evaluating each transaction alone.
Broker systems may flag certain wash sales within the same account, but investors should not assume all relevant activity across accounts will be captured automatically.
Build a Practical Recordkeeping Process for Stock Sales
A consistent process makes tax preparation easier and helps preserve information that may not be available years later. Keep records for the purchase, sale, and any events that changed the basis of the investment.
A useful stock-sale file can include:
- Trade confirmations for purchases and sales
- Annual brokerage statements and tax forms
- Documentation of share-lot selection instructions
- Records of transferred accounts and original basis details
- Corporate-action notices, including splits, mergers, spinoffs, and return-of-capital notices
- Dividend reinvestment records
- Documentation related to gifts, inheritances, employee stock, options, or stock-plan transactions
For taxpayers who make only occasional sales, a spreadsheet that lists each lot, purchase date, shares, original cost, adjustments, sale date, and proceeds can be enough. More active investors may benefit from brokerage tools or professional assistance, particularly where multiple accounts, transferred assets, or wash-sale concerns are involved.
The accounting objective is straightforward: create a clear trail from the shares acquired to the shares sold and reconcile that trail to the year-end brokerage reporting. That foundation supports more accurate tax reporting and gives you better information when considering future investment decisions.
This article provides general educational information. Tax and accounting decisions depend on the facts of your situation and may require advice from qualified tax and legal professionals.



