Beginner Guide

How to Calculate Capital Gains Tax on Investments

A step-by-step guide to calculating your capital gain, identifying whether it is short-term or long-term, and applying the correct 2024 tax rate.

Short-Term vs Long-Term: The Key Difference

The single most important variable in capital gains tax is how long you held the asset before selling. Assets held for one year or less are subject to short-term capital gains rates, which are the same as your ordinary income tax rates — potentially as high as 37%. Assets held for more than one year are taxed at preferential long-term capital gains rates of 0%, 15%, or 20%.

This distinction creates a strong incentive to hold investments for at least one year and one day before selling. On a $50,000 gain, the difference between short-term and long-term rates can mean paying $11,000 in taxes versus $7,500 — a $3,500 difference simply from waiting a few extra months.

The holding period starts the day after you purchased the asset and ends on the day you sell it. For stocks purchased at different times, each lot has its own holding period. Many brokerage platforms track this and identify which lots are short-term and which are long-term, which helps you make informed decisions about which shares to sell.

Step 1 - Calculate Your Capital Gain

Your capital gain or loss is the difference between your sale proceeds and your cost basis. The cost basis is what you originally paid for the asset, including any commissions or fees paid at purchase. For investments purchased in multiple lots at different prices, each lot has its own cost basis.

Sale proceeds are the price you received when selling, minus any commissions or fees paid at sale. For real estate, sale proceeds are the net proceeds after deducting real estate commissions, title insurance, and other selling costs.

If the result is positive, you have a capital gain. If negative, a capital loss. Capital losses can be used to offset capital gains dollar for dollar. If losses exceed gains in a given year, you can deduct up to $3,000 of net losses against ordinary income, with any remaining loss carried forward to future years.

Step 2 - Determine Your Holding Period

Review your purchase records to find the exact date you acquired the asset. Count forward from the day after purchase to the day of sale. If the total is 365 days or fewer, it is short-term. If 366 days or more, it is long-term.

For inherited assets, a special rule applies: inherited assets are automatically treated as long-term regardless of when the deceased originally acquired them, and the basis is stepped up to the fair market value at the date of death. This step-up provision can eliminate significant taxable gains on appreciated assets.

For gifted assets, the holding period includes the giver's holding period — the recipient takes on the giver's original acquisition date for purposes of calculating whether the gain is short-term or long-term.

Step 3 - Apply the Correct Tax Rate

For short-term gains, simply add the gain to your other ordinary income and apply your regular marginal income tax rate. If you are in the 24% bracket and have a $10,000 short-term gain, you owe roughly $2,400 in federal tax on that gain.

For long-term gains in 2024, the rates are based on your taxable income. Single filers pay 0% on long-term gains if taxable income is $47,025 or below, 15% on gains if taxable income is between $47,026 and $518,900, and 20% on gains above that threshold. Married filers have higher thresholds: 0% up to $94,050, 15% from $94,051 to $583,750, and 20% above.

Note that some high-income taxpayers may also owe a 3.8% Net Investment Income Tax (NIIT) on top of the regular long-term rate. This applies to single filers with MAGI above $200,000 and married filers with MAGI above $250,000.

Step 4 - Calculate What You Owe

Multiply your taxable capital gain by the applicable rate to find the tax owed. For a $20,000 long-term gain taxed at 15%, the federal capital gains tax is $3,000. If any portion of your gain pushes you into the 20% bracket, apply 15% to the gain up to the threshold and 20% to the portion above.

State taxes on capital gains vary. Most states tax capital gains as ordinary income at the state income tax rate. California, for example, taxes all capital gains at the regular income tax rate with no preferential treatment. A few states have no income tax at all. Check your state's specific rules.

Report capital gains on Schedule D of your federal tax return, along with Form 8949 which shows each individual transaction. Your brokerage provides a 1099-B form each year that lists all your taxable transactions and the information needed to complete Schedule D.