Guide · Path 5, Tax · Beginner
How stock gains and dividends are taxed: a beginner's guide to investment tax
You pay tax on investments at two points: when you sell at a profit (capital gains) and when you receive dividends. The rates and the paperwork depend on the country you live in, and on whether your broker handles the tax for you or you declare it yourself.
Key points
- In most countries, you pay tax on the gain when you sell, not while you hold the shares.
- Dividends are usually taxed when you receive them, often with tax withheld at source.
- A local broker may withhold tax for you; with a foreign broker you usually declare it yourself.
- Tax-free accounts, such as the UK ISA, can remove tax on gains and dividends inside them.
- Keep your broker's yearly tax report: it has everything you need to declare.
What is taxed: the gain, not the money you invest
In most countries, you don't pay tax on the money you put into the market, or while you hold the shares. You pay it only when you sell at a profit, on the capital gain, and when you receive dividends.
The gain is the difference between the selling price and the buying price, including fees. If you bought the same share several times at different prices, most countries use an average cost or a set matching rule.
Local broker or foreign broker: the big difference
The rules depend on where your account is. A local broker often works out and withholds the tax for you, or sends you and the tax office a yearly statement. With a foreign broker, you usually work out and declare everything yourself.
| Income | How it is usually taxed | Who handles it |
|---|---|---|
| Gains through a local broker | income or capital gains tax, at your country's rate | often the broker withholds or reports it |
| Gains through a foreign broker | your country's tax on the year's gains, sometimes at a different rate | usually you, on your tax return |
| Dividends from your own country | taxed when paid, often withheld at source | often the company or broker |
| Dividends from abroad | withheld abroad, sometimes topped up at home | you declare the rest, with a credit for tax paid abroad |
| Crypto gains | taxed in many countries, often like other gains | usually you |
These are the general patterns. The rates, allowances and loss rules are set by each country, so check yours.
One difference matters a lot: losses. In many countries you can subtract the year's losses from your gains and carry leftover losses forward. In others, only some losses count, or none. Your country's rules decide.
Tax-free and tax-advantaged accounts
Many countries have accounts where investments grow with little or no tax. They are often the cheapest way for a beginner to invest.
- UKISAno tax on gains or dividends inside the account
- ElsewherePension and savings accountstax relief in exchange for limits on withdrawals
- Your moveUse them firstbefore a normal taxable account
Check the yearly limits and the withdrawal rules before you open one. They change, and they differ from country to country.
A worked example with a foreign broker
Say that this year, at a foreign broker, you sold some shares for a total gain of $10,000 and others at a loss of $2,000. If your country lets you offset losses, your net gain is $8,000.
The 20% rate here is only an example. Your real rate may be lower or higher, and some countries let you make a certain amount of gains each year tax-free.
Dividends from US companies and the W-8BEN form
If you are not a US resident and own US shares, the US withholds tax on your dividends. Without the W-8BEN form, it takes 30%. With the form on file at your broker, it takes the lower rate set by the tax treaty between the US and your country.
Your home country may then tax the dividend too, with a credit for the US tax. Details are in the W-8BEN guide.
How to declare and what to keep
- Collect your broker's reportsThe yearly tax report with gains, losses and dividends, plus any tax withheld abroad.
- Check what's already been taxedTax withheld by a local broker or company may mean there's nothing more to pay on that income.
- Declare the rest by your country's deadlineUsually in your yearly tax return. Each country sets its own form and date.
The steps for your tax return are in the guide to reporting investment income.
Test yourself
You bought shares a year ago and they have risen, but you haven't sold. Do you owe tax on the gain?
In most countries, tax on a capital gain is due when you sell at a profit, not while you hold the shares.
At a foreign broker you made a $5,000 gain and a $1,000 loss in the same year. If your country lets you offset losses, what is your net gain?
Where losses can be offset, you are taxed on the net gain: $5,000 minus $1,000, which is $4,000.
You hold US shares and never filled out a W-8BEN. What happens to your dividends?
Without the form, the US withholds the full 30%. The W-8BEN lets you claim your country's treaty rate.
Done. You can move on to the next guide.
Frequently asked questions
How much tax do I pay on stocks?
It depends on your country: the rate, any yearly allowance and whether losses can be offset. Many countries tax gains when you sell and dividends when you receive them.
Do I pay tax if I don't sell?
Not on the gain. Tax on a capital gain usually applies only when you sell at a profit. Dividends are taxed when you receive them.
Do I need to declare anything if my broker is local?
Sometimes not, if the broker or company already withheld the tax. Check your country's rules and your broker's yearly statement.
Can I offset losses against gains?
In many countries, yes, at least against gains of the same kind and often in later years too. The details differ, so check your local rules.
Our guides are for information only. They are not a recommendation to buy or sell. Sources: IRS guidance on Form W-8BEN; UK government guidance on ISAs. Last checked: October 22, 2026. This guide is not tax advice.