How to Calculate Capital Gains on Stocks
Accurately determine the taxable profit from your stock sales. This guide explains the key components and methods behind the complete calculation.
Accurately determine the taxable profit from your stock sales. This guide explains the key components and methods behind the complete calculation.
A capital gain on a stock is the profit realized when you sell shares for a higher price than you originally paid. This profit is a form of investment income subject to federal taxation. To calculate this gain, you must determine your cost basis, identify the holding period of the stock, and apply a specific formula before reporting it on your tax return.
The starting point for any capital gain calculation is establishing your cost basis. This figure represents your total investment in a stock and is the amount you subtract from your sale proceeds to determine your profit. The basis is not simply the price you paid for the shares; it is an adjusted cost that reflects several factors, and a higher cost basis reduces your potential taxable gain.
The initial component of your cost basis is the original purchase price of the shares plus any transaction costs, like brokerage commissions or fees. For example, if you purchased 100 shares of a company at $50 per share and paid a $10 commission, your cost basis would be $5,010, not just the $5,000 share value.
Your basis is not static and can change over the life of the investment due to certain events. If you participate in a dividend reinvestment plan (DRIP), the value of the reinvested dividends increases your cost basis. This is because you are buying more shares with taxed dividend income. Conversely, events like stock splits or return of capital distributions require a downward adjustment to your basis per share.
When you have purchased shares of the same stock at different times and prices, you must identify which specific shares you are selling. The IRS default method is First-In, First-Out (FIFO), which assumes you are selling the oldest shares first. Alternatively, you can use the Specific Share Identification method, which allows you to choose which lot of shares to sell, offering more control over the timing and amount of your capital gain.
After establishing the cost basis, the next step is to determine the holding period for the stock you sold. The holding period is the length of time you owned the asset, and it directly influences how the resulting gain or loss is taxed. It begins on the day after you acquire the stock and ends on the day you sell it.
The tax code separates gains into two categories. A short-term capital gain results from the sale of a stock you owned for one year or less. These gains are taxed at your ordinary income tax rates, which are often higher than long-term gain rates.
A long-term capital gain applies to profits from stocks held for more than one year. The tax rates for long-term gains are 0%, 15%, or 20%, depending on your taxable income and filing status. Additionally, a 3.8% Net Investment Income Tax may apply to capital gains for individuals with modified adjusted gross income exceeding certain amounts. These thresholds are $250,000 for married couples filing jointly, $200,000 for single filers, and $125,000 for married couples filing separately.
The formula for the calculation is: Proceeds from Sale – Adjusted Cost Basis = Capital Gain or Loss. The “Proceeds from Sale” is the total money you received from the sale, minus any transaction commissions or fees. A positive result is a capital gain, while a negative result is a capital loss.
Consider a practical example to illustrate this formula. Imagine you purchased 200 shares of a company for $20 per share, paying a $15 commission, which makes your total cost basis $4,015. A few years later, you sell all 200 shares for $30 each, receiving $6,000, but you incur another $15 commission on the sale, making your net proceeds $5,985. The calculation would be $5,985 (Proceeds) – $4,015 (Basis) = $1,970. This $1,970 is your long-term capital gain.
When you have multiple transactions in a year, you must net your gains and losses. First, aggregate all of your short-term transactions, netting short-term gains against short-term losses to arrive at a net short-term gain or loss. You perform the same process for your long-term transactions to find your net long-term gain or loss.
Once you have these two net figures, you can combine them. If you have a net loss in one category and a net gain in the other, you can use the loss to offset the gain. For instance, a $2,000 net short-term loss can be used to reduce a $5,000 net long-term gain, resulting in a final net long-term gain of $3,000 to be taxed. If your total capital losses exceed your total capital gains, you can use the excess loss to offset other types of income, like wages. This deduction is limited to $3,000 per year ($1,500 for those married filing separately).
After calculating your net capital gains or losses for the year, you must report them to the IRS using specific forms. The process begins with Form 8949, Sales and Other Dispositions of Capital Assets. This form is where you detail each individual stock sale, listing the description of the stock, dates of acquisition and sale, the sales price, and the cost basis. Your broker will provide you with Form 1099-B, which contains most of this information.
Form 8949 is structured to separate your transactions based on the holding period, with sections for short-term and long-term transactions. You will use the information from your Form 1099-B to correctly categorize each sale.
The totals from Form 8949 are then carried over and summarized on Schedule D, Capital Gains and Losses. Schedule D is where you formally calculate your net short-term and net long-term capital gain or loss for the year. It consolidates the figures from all your Form 8949 attachments and is also where you report any capital loss carryovers from previous years.
The net gain or loss from Schedule D is transferred to your main tax return, Form 1040. The figure from Schedule D is entered on the line for “Capital gain or (loss).” This amount is then incorporated into the calculation of your total income for the year, affecting your overall tax liability.