Realized profit and loss, usually written as realized P&L, is the actual gain or loss you lock in when you sell, close, or otherwise dispose of an investment. Until the sale closes, any change in value is just a number on your screen. Once it closes, the difference between what you paid and what you received is permanent, and that figure is what the IRS taxes and what you report on your return.
What Makes a Gain or Loss Realized
A position produces realized P&L the moment you give it up. Before that, price swings are theoretical; the share can double or crash the next morning without changing a realized figure by a penny, because you no longer hold it.
Federal tax law treats that sale as the trigger. Under the Internal Revenue Code, your gain is the amount you received minus your adjusted basis in the asset; if your basis exceeds what you received, you have a realized loss.1Office of the Law Revision Counsel. 26 U.S.C. 1001 – Determination of Amount of and Recognition of Gain or Loss No sale, no realization, no tax.
How to Calculate Realized P&L
The formula is simple: net sale proceeds minus adjusted cost basis. Getting each side of that subtraction right is where investors slip up.
Adjusted Cost Basis
Basis starts with what you paid, plus the costs of acquiring the asset: brokerage commissions, transfer fees, and regulatory charges. Buy 100 shares at $50 with a $5 commission and your basis is $5,005, not $5,000.
Basis can also move after purchase. Reinvested dividends buy additional shares and add to your total basis. A stock split leaves total basis alone but spreads it across more shares, lowering the per-share figure. Missing these adjustments is a common way to overpay tax, because a lower basis means a bigger reported gain.
Net Proceeds
Net proceeds are what the sale actually puts in your pocket after selling costs. Those costs include brokerage commissions along with small regulatory charges like the SEC fee and FINRA’s Trading Activity Fee, which brokers pass through to sellers.2FINRA. Trading Activity Fee Frequently Asked Questions The SEC fee hits only sales of exchange-listed equities, not purchases.3Investopedia. SEC Fee Explained: Definition, Rates, and Equity Impact
A Worked Example
Take those 100 shares bought at $50 with a $5 commission, giving a $5,005 basis. Five months later you sell all 100 at $55 and pay a $7 commission. Gross sale is $5,500; net proceeds are $5,493. Subtract the $5,005 basis from the $5,493 proceeds and your realized profit is $488.
Which Shares Count as Sold
If you built the position over time at different prices and sell only part of it, the shares you treat as sold change the result. Most brokerages default to first-in, first-out, so the oldest lot goes first. You can also use specific identification to pick the exact lot, or average cost for mutual fund shares. Specific identification offers the most tax control, but you have to elect it at the time of the sale.
Realized Versus Unrealized P&L
Unrealized P&L is the paper gain or loss on a position you still hold. Buy at $50, see $60 today, and you have a $10 unrealized gain per share. Your portfolio is worth more, but you can’t spend the gain and you don’t owe tax on it. The number also changes every trading day and can disappear if the market reverses.
Realized P&L, by contrast, is a historical fact. Selling converts the gain to cash you can reinvest or withdraw, and it fixes the tax result for that year.
Tax Treatment of Realized Gains
Selling is the taxable event. Appreciation doesn’t cost you anything in tax until you dispose of the asset.1Office of the Law Revision Counsel. 26 U.S.C. 1001 – Determination of Amount of and Recognition of Gain or Loss Once you sell, the gain or loss has to appear on your return for that year.
Short-Term and Long-Term Rates
Holding period controls the rate. Assets held one year or less produce short-term capital gains, taxed at ordinary income rates. For 2026, the top ordinary rate is 37%, reached at $640,600 of taxable income for single filers and $768,700 for married couples filing jointly.4Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026
Assets held more than one year get preferential long-term rates of 0%, 15%, or 20%, depending on taxable income.5Internal Revenue Service. Topic No. 409, Capital Gains and Losses For 2026, single filers pay 0% on long-term gains up to $49,450 of taxable income, 15% from there to $545,500, and 20% above that. Married couples filing jointly reach the 15% bracket at $98,900 and the 20% bracket at $613,700. The spread between a 37% short-term rate and a 15% or 20% long-term rate is why holding periods are worth watching before you click sell.
The Net Investment Income Surtax
Higher earners owe an additional 3.8% on net investment income, including realized capital gains. The surtax applies when modified adjusted gross income exceeds $200,000 for single filers, $250,000 for married couples filing jointly, or $125,000 for married filing separately.6Office of the Law Revision Counsel. 26 U.S.C. 1411 – Imposition of Tax Those thresholds are not indexed for inflation, so more households cross them every year.7Internal Revenue Service. Net Investment Income Tax
How Sales Get Reported
Your brokerage reports every sale to you and the IRS on Form 1099-B. The form lists gross proceeds, cost basis for covered securities, and the acquisition and sale dates so the IRS can check your return against the broker’s record.8Internal Revenue Service. Instructions for Form 1099-B You carry the information to Schedule D of Form 1040. Check the reported basis carefully for shares acquired through dividend reinvestment, gifts, or transfers from another broker, because older or inherited records are often incomplete.
When Losses Exceed Gains
Realized losses offset realized gains dollar for dollar. Short-term losses offset short-term gains first, long-term losses offset long-term gains first, and anything left over then crosses over to the other category.
If total realized losses still exceed total realized gains for the year, you can deduct up to $3,000 of the excess against ordinary income, or $1,500 if married filing separately.9Office of the Law Revision Counsel. 26 U.S.C. 1211 – Limitation on Capital Losses Anything beyond that carries forward to future years indefinitely until it’s used up, which makes tracking the carryforward balance important long after the original sale.5Internal Revenue Service. Topic No. 409, Capital Gains and Losses
The Wash Sale Rule
Investors sometimes try to realize a loss while buying the same stock right back to stay in the market. The IRS blocks that. Under the wash sale rule, selling a security at a loss and buying a substantially identical one within 30 days before or after the sale disallows the loss.10Office of the Law Revision Counsel. 26 U.S.C. 1091 – Loss From Wash Sales of Stock or Securities
Because the 30 days run in both directions, you have a 61-day blackout around the sale. The disallowed loss isn’t gone; it gets added to the basis of the replacement shares, and your holding period for the new shares includes the time you held the old ones, so you recover the loss when you eventually sell the replacements.11Internal Revenue Service. Publication 550 – Investment Income and Expenses
The rule also catches purchases by your spouse and purchases inside your IRA or Roth IRA. The IRA case is harsh: because IRA shares don’t carry individual basis for tax purposes, a disallowed loss there may be permanently lost rather than preserved in basis.
A Narrow Exception: Real Estate Like-Kind Exchanges
One well-known exception to realizing gain on sale applies to investment real estate. Under a Section 1031 like-kind exchange, you can sell an investment property and defer the entire realized gain by reinvesting the proceeds into another qualifying property.12Internal Revenue Service. Like-Kind Exchanges – Real Estate Tax Tips
The rules are narrow. The property must be real property held for business or investment use, not a primary residence and not inventory held for resale. Both sides of the exchange must qualify, though they don’t have to be the same type of real estate; an apartment building can be swapped for vacant land. U.S. real estate cannot be exchanged for foreign real estate, and any cash or non-qualifying property received in the trade is taxable to that extent. The deferral doesn’t apply to stocks, bonds, or other securities.