Taxes on Trading, the Basics
In this lesson: You will be able to tell a short-term gain from a long-term gain, explain why the difference matters, and spot the wash sale rule before it surprises you.
What gets taxed, and when
In the United States, profit from selling a stock is taxed as a capital gain, and how it is taxed depends mostly on how long you held the shares. Shares held one year or less produce a short-term gain, taxed like your regular income, while shares held more than one year produce a long-term gain, which is generally taxed at lower rates.
A capital gain is the profit when you sell an investment for more than you paid. A capital loss is the opposite. What you paid, including any fees, is called your cost basis.
The tax only applies when you sell. A gain on paper, in a stock you still own, is unrealized and not taxed in a regular account. Once you sell, the gain or loss is realized and counts for that tax year. Your broker reports your sales on a form called a 1099-B early the following year.
This lesson covers US federal rules for shares in a regular taxable account. States add their own rules, and options have extra rules of their own. It is general education, not tax advice.
Key term
Holding Period
Your holding period is how long you owned the shares. It starts the day after you buy and includes the day you sell. Held one year or less: short-term. Held more than one year: long-term. Selling a few days too early can turn a long-term gain into a short-term one, so the purchase date matters as much as the price.
Example
Same profit, two tax bills
Take a hypothetical company, Maplewood Tools, and assume hypothetical tax rates: 24% on short-term gains (your ordinary income rate) and 15% on long-term gains. Real rates depend on your income and filing status.
You buy 100 shares at a purchase price of $40. Cost basis: 100 x $40 = $4,000.
Later you sell all 100 shares at $50. Sale proceeds: 100 x $50 = $5,000. Gain: $5,000 - $4,000 = $1,000.
Case 1, sold after 11 months (short-term): Tax: $1,000 x 24% = $240. You keep $1,000 - $240 = $760.
Case 2, sold after 13 months (long-term): Tax: $1,000 x 15% = $150. You keep $1,000 - $150 = $850.
The stock and the profit are identical. Holding about two months longer left $850 - $760 = $90 more after tax in this hypothetical. Waiting is not free, though: the price could fall during those extra weeks.
Losses, and the wash sale rule
Realized losses are useful at tax time. They offset realized gains in the same year. If your losses are bigger than your gains, a limited amount can offset your other income each year, and the rest carries forward to future years.
There is a catch. The wash sale rule says that if you sell shares at a loss and buy the same or substantially identical shares within 30 days before or after that sale, you cannot claim the loss right away. This applies across your accounts. In a regular taxable account, the loss is not gone forever: it gets added to the cost basis of the new shares, so it shrinks your taxable gain, or grows your loss, when you finally sell those. If the rebuy happens inside an IRA, a tax-advantaged retirement account, though, the loss is generally lost for good, because it cannot be added to the IRA shares' basis.
Example
A wash sale, step by step
You buy 100 shares of a hypothetical stock trading at $30. Cost basis: 100 x $30 = $3,000.
It falls, and you sell all 100 at $25. Proceeds: 100 x $25 = $2,500. Loss: $3,000 - $2,500 = $500.
Ten days later you buy 100 shares back at $26, costing 100 x $26 = $2,600. That is inside the 30-day window, so the $500 loss is disallowed for now.
Instead it is added to the new shares: New cost basis: $2,600 + $500 = $3,100, or $31 per share.
If you later sell those shares at $31, your gain is $3,100 - $3,100 = $0, not $500. The loss was postponed, not erased.
Watch out: How frequent trading quietly costs you
Active traders tend to hold for days or weeks, so nearly every winning trade is short-term and taxed at the higher ordinary rate. Taxes are owed on realized gains even if you never withdraw the cash, and a year of many small wins can create a bill you did not set money aside for. Quick sell-and-rebuy habits can also trigger wash sales that leave you with fewer deductible losses than you expected. None of this shows up on your account balance until tax season.
Before you start trading often
A few habits make tax season much less painful.
- Record the purchase date and cost basis for every position.
- Know the date each holding turns long-term before you decide to sell a winner.
- Wait more than 30 days before rebuying something you sold at a loss, or accept that the loss will be postponed.
- Set aside a share of realized short-term gains for taxes.
- Learn whether a tax-advantaged account, such as an IRA, fits your goals, since trades inside it follow different rules.
- For anything beyond the basics, talk with a tax professional.
Key takeaways
- Gains are taxed only when you sell, and the holding period decides whether they are short-term or long-term.
- Short-term gains, on shares held one year or less, are taxed like ordinary income, while long-term gains are generally taxed at lower rates.
- Realized losses offset realized gains, and excess losses can reduce other income by a limited amount each year with the rest carried forward.
- Rebuying the same shares within 30 days of selling at a loss triggers the wash sale rule, which postpones the loss by adding it to your new cost basis.
Check your understanding
4 questions. Sign in to save your progress.
0 of 4 answered
Practice
Try buying shares
Buy shares of any stock in your practice account and write down the purchase date, the cost basis, and the exact date that position would become long-term.
A practice account uses real prices and no real money.
Create a free account to practiceGlossary
- Capital gain
- The profit from selling an investment for more than its cost basis; a capital loss is selling for less.
- Cost basis
- What you paid for an investment, including fees, used to calculate your gain or loss when you sell.
- Holding period
- How long you owned an investment, starting the day after purchase; more than one year makes a gain long-term.
- Ordinary income
- Regular income such as wages, taxed at your normal rate; short-term gains are taxed this way.
- Wash sale
- Selling at a loss and buying substantially identical shares within 30 days before or after, which postpones the loss into the new cost basis.
Related lessons
- Keeping a Trading JournalSet up a simple trading journal, record each trade consistently, and review it to find which of your habits help or hurt your results.
- OvertradingRecognize when you are trading more often than your plan supports, and see how extra trades can quietly lower your results through costs and weaker decisions.
- Dividends ExplainedExplain how a company pays dividends, calculate a dividend payment and yield, and know which date decides whether you receive the next payment.
- Options Income in an IRAExplain which options strategies an IRA usually permits, calculate the cash or shares each one ties up, and understand what a broker approval level does and does not mean.