How to Calculate Capital Gains Tax With Examples
Learn to calculate the tax on profits from selling assets. Our guide provides a clear framework for determining your gain or loss and its impact on your taxes.
Learn to calculate the tax on profits from selling assets. Our guide provides a clear framework for determining your gain or loss and its impact on your taxes.
When you sell an asset for more than you paid for it, the profit is a capital gain and is subject to tax. This applies to the profitable sale of personal or investment property, including items like real estate, stocks, bonds, valuable collections, and even cryptocurrency.
A capital asset includes most property you own for personal or investment purposes. Common examples are stocks, bonds, your home, household furnishings, and investment real estate. The Internal Revenue Service (IRS) specifically excludes items like business inventory and depreciable business property. This distinction ensures that profits from regular business activities are treated as ordinary income.
To calculate a capital gain, you must determine the asset’s cost basis. The basis is the original purchase price plus any associated costs, like commissions or fees. For instance, if you bought a stock for $5,000 and paid a $15 commission, your cost basis is $5,015. For real estate, the basis also includes the cost of significant property improvements. Keeping accurate records of these costs is important for correctly calculating your gain or loss.
The holding period, which is the length of time you own an asset, directly impacts how the gain is taxed. A holding period of one year or less results in a short-term capital gain. If you hold the asset for more than one year, the profit is a long-term capital gain, which qualifies for lower tax rates.
The formula for determining a capital gain or loss is the sale price minus the cost basis. A positive result is a gain, while a negative result is a loss.
A common scenario involves the sale of stock held for a short period. Imagine you purchase 200 shares of a company at $25 per share, for an initial investment of $5,000. If you paid a $10 commission, your cost basis becomes $5,010. Eight months later, you sell all 200 shares at $35 per share for total proceeds of $7,000. Your gain is $1,990 ($7,000 – $5,010), and because you held the stock for less than a year, it is a short-term capital gain.
For a long-term gain, suppose you bought 100 shares of a company for $3,000. After holding the shares for three years, you sell them for $5,000. Your calculation is: $5,000 (sale proceeds) – $3,000 (cost basis) = $2,000. Since the holding period was more than one year, this is a long-term capital gain.
The sale of a primary residence has unique rules. You may be able to exclude up to $250,000 of the gain from your income, or $500,000 if married and filing jointly. To qualify, you must have owned and lived in the home as your primary residence for at least two of the five years before the sale. For instance, a married couple who bought their home for $400,000 and sold it for $675,000 has a gain of $275,000, which is below their $500,000 exclusion, so they would owe no capital gains tax.
A capital loss occurs when you sell an asset for less than its cost basis. If you bought an asset for $10,000 and sold it for $7,000, you have a $3,000 capital loss. These losses can be used to offset capital gains. If your losses exceed your gains, you can deduct up to $3,000 of the excess loss against your ordinary income each year, with any remaining loss carried forward.
Short-term capital gains are taxed at ordinary income tax rates, determined by the asset’s holding period and your overall taxable income. The profit is added to your other income, such as wages, and taxed according to the 2025 federal income tax brackets: 10%, 12%, 22%, 24%, 32%, 35%, and 37%. The specific rate depends on your total taxable income and filing status.
Long-term capital gains benefit from lower tax rates of 0%, 15%, or 20%. For 2025, single filers with taxable income up to $48,350 pay 0% on these gains. The 15% rate applies to single filers with income between $48,351 and $533,400, and the 20% rate applies to income above that threshold. These income brackets are adjusted for inflation.
Certain assets have special long-term capital gains rates. The gain from selling collectibles, such as art or precious metals, is taxed at a maximum rate of 28%. High-income taxpayers may also be subject to an additional 3.8% Net Investment Income Tax on their capital gains if their income exceeds certain thresholds.
You must report capital gains to the IRS using Form 8949, Sales and Other Dispositions of Capital Assets, and Schedule D, Capital Gains and Losses. Form 8949 is used to list the details of each individual capital asset transaction. For every sale, you must report a description of the property, the date it was acquired, the date it was sold, the sales price, and the cost basis. The form is separated into parts to distinguish between short-term and long-term transactions.
The totals from Form 8949 are transferred to Schedule D. This form summarizes your capital gain and loss activity, consolidating the short-term totals in Part I and the long-term totals in Part II to calculate your net capital gain or loss for the year. The final net gain or loss from Schedule D is then reported on your main tax return, Form 1040.