Selling stocks at a profit can create a tax obligation, but the amount owed depends on several factors. The capital gains tax on stocks generally applies when an investment is sold for more than its adjusted cost basis, rather than when its market value simply increases.
Holding period, taxable income, filing status, and the size of the gain can all influence the final tax result. Understanding how stock gains and losses are calculated, reported, and affected by rules such as the wash-sale provision can help investors make informed decisions.
When Capital Gains Tax on Stocks Applies
Capital gains tax on stocks generally applies when you sell shares for more than their adjusted cost basis. The gain is usually taxable in the year the sale occurs, not when the stock’s market value increases while you continue holding it.
A taxable gain may result from selling individual shares, exchange-traded funds, mutual funds, or other securities in a taxable brokerage account. Retirement accounts such as traditional IRAs and 401(k) plans generally follow different tax rules, so stock sales within them are not typically reported as immediate capital gains.
Your gain or loss is determined by comparing the sale proceeds with the shares’ adjusted basis, which commonly includes the purchase price and certain transaction costs. Reinvested dividends, stock splits, commissions, and other adjustments may affect this calculation.
Tax treatment can also depend on how long you owned the shares and whether the investment was held for personal, business, or investment purposes. Special rules may apply to inherited stock, gifted shares, employee stock, and certain corporate transactions.
Short-Term and Long-Term Stock Gains
The tax treatment of a stock gain depends largely on how long you held the investment before selling it. A holding period of one year or less generally produces a short-term capital gain, while a holding period exceeding one year generally produces a long-term capital gain.
Short-term gains are usually taxed as ordinary income, so the applicable rate depends on your federal income-tax bracket. Long-term gains may qualify for preferential federal rates, commonly 0%, 15%, or 20%, depending on taxable income and filing status. State taxes may apply separately.
The holding period generally begins on the day after purchase and ends on the sale date. Special rules can apply to inherited stock, gifted shares, employee compensation, and certain corporate actions. These rules may change the cost basis or holding period used to determine the applicable capital gains tax on stocks.
When shares were purchased at different times or prices, identifying which shares were sold can affect the gain, loss, and holding period. Brokerage-specific identification or the first-in, first-out method may apply, so transaction records should be reviewed carefully.
How to Calculate a Stock Capital Gain or Loss
A stock capital gain or loss is generally calculated by subtracting the investment’s adjusted cost basis from its selling price. A positive result is a gain, while a negative result is a loss.
- Selling price − adjusted cost basis = capital gain or loss
- Net proceeds should reflect commissions and transaction fees.
- The cost basis may include the purchase price, commissions, and reinvested dividends.
For example, purchasing shares for $4,000 and paying a $20 commission creates a $4,020 basis. If the shares are sold for $5,000 after a $25 fee, the proceeds are $4,975, producing a $955 gain.
When shares are purchased at different times or prices, each group may have a separate basis and holding period. Brokerage records typically identify these lots, but investors should verify the information, particularly after transfers, dividend reinvestment, stock splits, or corporate actions. The resulting gain or loss is then classified as short-term or long-term for capital gains tax on stocks.
Tax Rates for Stock Capital Gains
Federal tax rates for stock capital gains depend on how long you held the investment and your taxable income. Gains on stocks held for more than one year generally receive long-term treatment, while gains on assets held for one year or less are taxed as short-term gains.
Short-term gains are taxed at ordinary federal income tax rates, which range from 10% to 37% for the 2026 tax year, depending on filing status and taxable income. Long-term gains typically qualify for 0%, 15%, or 20% rates. The applicable threshold is based on taxable income, not total income.
High-income investors may also owe the 3.8% Net Investment Income Tax on certain investment income, including stock gains. State and local taxes can apply separately, and their rates vary by jurisdiction. Taxpayers should consult current IRS guidance when calculating their liability.
The Role of Income and Filing Status
Your taxable income helps determine which federal capital gains rate applies to stock profits. Long-term gains, from stocks held for more than one year, generally receive preferential rates of 0%, 15%, or 20%, depending on taxable income and filing status. Short-term gains are taxed as ordinary income.
Tax brackets are based on total taxable income, including wages, interest, and other income, as well as relevant capital gains. A stock sale may therefore move part of your income into a higher bracket, although only the amount within that bracket receives the higher rate.
Filing status—such as single, married filing jointly, married filing separately, or head of household—determines the income thresholds for these brackets. Married couples filing jointly usually have wider thresholds than single taxpayers, but the exact amounts change annually.
High-income investors may also owe the 3.8% Net Investment Income Tax on certain investment income, including stock gains. It generally applies when modified adjusted gross income exceeds statutory thresholds based on filing status.
Taxable Income and Capital Gains Brackets
Taxable income determines which federal tax rates may apply to stock gains. It generally includes wages, interest, dividends, and other income after eligible adjustments and deductions. Capital gains are then evaluated under the applicable tax rules.
Long-term gains from stocks held for more than one year use preferential rates based on taxable income and filing status. For the 2026 tax year, federal long-term capital-gains rates are generally 0%, 15%, or 20%, subject to specific income thresholds.
Short-term gains from stocks held for one year or less are taxed as ordinary income. Consequently, a taxpayer’s total taxable income can place these gains in a higher marginal bracket, even though only the portion within that bracket receives the higher rate.
Taxable income may change after deductions, retirement contributions, or other adjustments. Investors should therefore calculate taxable income before estimating their capital gains liability and verify the current-year thresholds with IRS guidance.
Filing Status Considerations
Filing status affects the income thresholds used to determine the tax rate on stock gains. Taxpayers generally file as single, married filing jointly, married filing separately, head of household, or qualifying widow(er), with different thresholds for each category.
For married couples, filing jointly often provides wider income brackets than filing separately. However, the appropriate status depends on legal and household circumstances, and filing separately can produce different results for deductions, credits, and investment-related taxes.
Your filing status is considered alongside taxable income, not investment income alone. A taxpayer with substantial wages, interest, or business income may reach a higher capital-gains bracket sooner, affecting the tax due on profits from selling stocks.
Filing status can also influence eligibility for the 0%, 15%, or 20% long-term capital-gains rates and the potential Net Investment Income Tax. Reviewing the applicable thresholds for the tax year can help estimate the effect of a stock sale.
The Net Investment Income Tax
The Net Investment Income Tax (NIIT) is an additional 3.8% federal tax on certain net investment income, including profits from selling stocks. It may apply when a taxpayer’s modified adjusted gross income exceeds:
- $200,000 for single or head-of-household filers
- $250,000 for married couples filing jointly
- $125,000 for married individuals filing separately
These thresholds are not indexed for inflation. The tax generally applies to the lower of net investment income or the amount by which modified adjusted gross income exceeds the applicable threshold.
For this purpose, net investment income can include capital gains, dividends, interest, and certain rental or passive business income. Wages, self-employment earnings, and tax-exempt interest generally do not qualify. Income from an active trade or business may also be excluded, depending on the circumstances.
When calculating capital gains tax on stocks, investors with substantial income should consider whether the NIIT increases their total federal tax liability. Properly documented losses and eligible deductions may reduce net investment income, but professional tax advice may be appropriate for complex situations.
Reporting Stock Sales on a Tax Return
Stock sales are generally reported on Form 8949, Sales and Other Dispositions of Capital Assets. This form records each transaction, including the asset description, purchase date, sale date, proceeds, cost basis, and resulting gain or loss.
The totals from Form 8949 are transferred to Schedule D, Capital Gains and Losses. Schedule D combines short-term and long-term transactions and calculates the overall capital gain or loss used on the federal income tax return.
Brokerage firms typically issue Form 1099-B showing reported proceeds and, in many cases, cost-basis information. Taxpayers should compare this form with their records because basis may be incomplete or require adjustments, such as those involving wash sales.
Accurate reporting helps determine the capital gains tax on stocks and prevents discrepancies with information submitted to the Internal Revenue Service. State tax returns may require separate reporting under applicable state rules.
Tax Treatment of Stock Capital Losses
Selling shares for less than their adjusted cost basis creates a capital loss, which may reduce the tax owed on profitable investments. For capital gains tax on stocks, the holding period determines whether the loss is short-term or long-term, and each type generally offsets gains of the same type before other gains.
- Short-term losses offset short-term gains first.
- Long-term losses offset long-term gains first.
- Remaining losses can offset gains of the opposite type.
After offsetting gains, an individual may generally deduct up to $3,000 of net capital losses against ordinary income each tax year, or $1,500 if married filing separately. Unused losses may be carried forward indefinitely until applied, subject to applicable tax rules.
Accurate records of purchase prices, sale proceeds, commissions, and prior-year carryovers help ensure losses are reported correctly. A loss may be disallowed under the wash-sale rule when substantially identical securities are repurchased within the restricted period; the disallowed amount is generally added to the replacement shares’ cost basis.
Offsetting Capital Gains With Losses
Capital losses can offset capital gains when calculating taxable investment income. If you sell one stock at a loss and another at a gain during the same tax year, the losses generally reduce gains of the same type before any remaining amounts are combined.
Short-term losses are first used against short-term gains, while long-term losses are first applied to long-term gains. If losses exceed gains within one category, the remaining loss may offset gains in the other category. This ordering can affect the tax treatment of stock transactions.
For example, a $3,000 short-term loss and a $2,000 short-term gain result in a $1,000 net short-term loss. That loss may then offset long-term gains, subject to applicable tax rules. Accurate records of purchase prices, sale proceeds, and holding periods are necessary when applying capital gains tax on stocks.
The Annual Capital Loss Deduction Limit
In the United States, individuals may generally deduct up to $3,000 of net capital losses against ordinary income each tax year. For married taxpayers filing separately, the annual limit is typically $1,500.
This limit applies after capital losses have offset capital gains. For example, if deductible stock losses exceed total gains by $8,000, only $3,000 may generally reduce other income for that year, subject to applicable tax rules.
The deduction can reduce taxable income from sources such as wages, interest, or business earnings. It does not mean the entire loss is immediately refundable, and the tax benefit depends on the taxpayer’s income and applicable marginal tax rate.
Any unused loss generally carries forward to future years until it is used. Taxpayers must continue applying losses against capital gains before claiming the permitted deduction against ordinary income. Accurate records are necessary to track these amounts and report capital gains tax on stocks correctly.
Carrying Losses Into Future Tax Years
If capital losses exceed capital gains for the year, taxpayers may generally deduct up to $3,000 of the excess against ordinary income, or $1,500 if married filing separately. Unused losses can be carried forward to future tax years.
These carryforwards retain their character as short-term or long-term losses. In each subsequent year, they are applied against gains of the corresponding type before remaining losses are used against the other type, following applicable tax rules.
There is generally no federal expiration date for unused capital losses, allowing them to continue carrying forward until fully used. Taxpayers must report the carryforward accurately each year, even when no stock sale occurs.
Accurate records of the original loss, amounts already applied, and remaining balance help prevent errors. State tax treatment may differ, so taxpayers should review the rules applicable to their state of residence.
Wash-Sale Rules and Repurchasing Stocks
The wash-sale rule can prevent investors from claiming a tax deduction for a loss when they sell stock and acquire substantially identical stock within 30 days before or after the sale. This rule directly affects the timing of deductions related to capital gains tax on stocks.
When a wash sale occurs, the disallowed loss is generally added to the cost basis of the replacement shares. The adjustment preserves the loss for potential recognition when those shares are later sold, provided another wash sale does not apply.
Investors should review purchases across taxable accounts, including automatic dividend reinvestments, because even a small replacement purchase can create reporting complications. The rule may also apply when a spouse or certain controlled accounts acquire substantially identical securities.
Brokerage statements often identify wash-sale adjustments, but they may not capture every transaction, particularly across different institutions or account types. Accurate records of sale dates, replacement purchases, adjusted basis, and holding periods help support correct tax reporting.
What Constitutes a Wash Sale
A wash sale occurs when an investor sells a stock at a loss and purchases the same or a substantially identical stock within the 30 days before or after the sale. The rule applies to transactions in taxable accounts.
The 61-day period includes the sale date, the 30 days preceding it, and the 30 days following it. For example, selling shares at a loss and repurchasing them 20 days later may trigger the rule. The same-stock purchase can occur in an individual account, a spouse’s account, or certain retirement accounts.
The rule may also apply when an investor acquires substantially identical securities, such as replacement shares, contracts, or options. Whether two investments are substantially identical depends on their specific terms and circumstances; similar but different stocks generally do not meet this test.
When the wash-sale rule applies, the loss is not immediately deductible. Instead, the disallowed loss is generally added to the cost basis of the replacement shares, affecting the tax treatment when those shares are eventually sold.
How Disallowed Losses Affect Cost Basis
When a wash sale occurs, the loss from selling stock is temporarily disallowed for tax purposes. Rather than eliminating the loss permanently, the rules generally add the disallowed amount to the cost basis of the replacement shares.
For example, if an investor sells stock for a $500 loss and repurchases substantially identical shares within the wash-sale period, the replacement shares’ basis generally increases by $500. This higher basis reduces the taxable gain or increases the deductible loss when those shares are eventually sold.
The holding period of the original shares may also transfer to the replacement shares. This can affect whether a later gain or loss is classified as short-term or long-term, which influences the applicable capital gains tax on stocks.
Accurate records are important because brokerage statements may report wash-sale adjustments only for identical securities purchased in the same account. Transactions involving multiple accounts, spouses, or retirement accounts may require additional review.
Common Wash-Sale Reporting Issues
Brokerage forms may not capture every wash sale. Form 1099-B generally reports adjustments for identical securities bought in the same account, but transactions across different accounts, brokers, spouses, or individual retirement accounts may require separate review.
Common reporting issues include:
- Using an unadjusted cost basis from a brokerage statement
- Overlooking replacement shares purchased within the 61-day wash-sale window
- Reporting a loss without adding the disallowed amount to the replacement shares’ basis
- Assuming an IRA transaction receives the same treatment as a taxable account
When a wash sale occurs, the disallowed loss is generally added to the cost basis of the replacement stock and deferred until that position is sold. However, special rules can apply when replacement shares are acquired in an IRA.
Taxpayers should compare Forms 1099-B with trade confirmations and year-end account records before reporting capital gains or losses. Accurate records of purchase dates, share quantities, adjusted basis, and related accounts help prevent errors in reporting capital gains tax on stocks.
Strategies for Managing Capital Gains Tax on Stocks
Investors may manage capital gains tax on stocks by considering how long they hold shares before selling. Waiting until an investment qualifies for long-term treatment may reduce the applicable federal tax rate, although market conditions and investment objectives should remain the primary considerations.
Tax-loss harvesting can help offset gains by selling investments that have declined in value. Investors should review the wash-sale rules before repurchasing substantially identical securities, since a disallowed loss generally becomes part of the replacement shares’ cost basis.
Spreading sales across different tax years may help manage taxable income and prevent avoidable movement into higher capital-gains brackets. Donating appreciated stock to an eligible charity may also avoid recognizing the gain, subject to applicable rules and deduction limits.
Accurate records support these strategies. Investors should track purchase dates, adjusted cost basis, reinvested dividends, stock splits, and previous wash-sale adjustments. Because tax outcomes vary by income, filing status, account type, and jurisdiction, professional advice may be appropriate for complex transactions.
Planning Stock Sales With Accurate Tax Records
Maintain complete records for every stock transaction, including purchase and sale dates, number of shares, execution prices, commissions, reinvested dividends, and corporate actions such as splits or mergers. These details establish your cost basis and holding period for calculating capital gains tax on stocks.
Before selling, review the basis reported by your brokerage against personal records. Brokerage information may not include older shares, inherited stock, gifted securities, or adjustments from reinvested dividends. Confirm whether a transaction involved a wash sale, since a disallowed loss can change the basis of replacement shares.
Tax-lot selection can affect both the gain amount and whether the gain is short-term or long-term. When available, specify the shares being sold rather than relying on an undetermined method, and retain trade confirmations and account statements.
Keep tax records for the period required by applicable law, particularly when losses are carried forward or property remains connected to a future transaction. Consult current tax guidance or a qualified professional when records are incomplete or transactions are complex.