🇬🇧 English 🇷🇴 Română 🇪🇸 Español soon 🇫🇷 Français soon 🇩🇪 Deutsch soon
Premium
Back

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.

7 min readUpdated October 22, 2026Written by the einvestitii.ro team

Key points

  1. In most countries, you pay tax on the gain when you sell, not while you hold the shares.
  2. Dividends are usually taxed when you receive them, often with tax withheld at source.
  3. A local broker may withhold tax for you; with a foreign broker you usually declare it yourself.
  4. Tax-free accounts, such as the UK ISA, can remove tax on gains and dividends inside them.
  5. 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.

IncomeHow it is usually taxedWho handles it
Gains through a local brokerincome or capital gains tax, at your country's rateoften the broker withholds or reports it
Gains through a foreign brokeryour country's tax on the year's gains, sometimes at a different rateusually you, on your tax return
Dividends from your own countrytaxed when paid, often withheld at sourceoften the company or broker
Dividends from abroadwithheld abroad, sometimes topped up at homeyou declare the rest, with a credit for tax paid abroad
Crypto gainstaxed in many countries, often like other gainsusually 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.

  1. UKISAno tax on gains or dividends inside the account
  2. ElsewherePension and savings accountstax relief in exchange for limits on withdrawals
  3. 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.

$10,000gains this year
−$2,000losses the same year
$1,600tax at an example rate of 20% on $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.

30%withheld without the W-8BEN
treaty ratewithheld with the W-8BEN
3 yearshow long the form is valid

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

  1. Collect your broker's reportsThe yearly tax report with gains, losses and dividends, plus any tax withheld abroad.
  2. Check what's already been taxedTax withheld by a local broker or company may mean there's nothing more to pay on that income.
  3. 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

Question 1 of 3

You bought shares a year ago and they have risen, but you haven't sold. Do you owe tax on the gain?

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.

Next guide in this path · 7 min readReporting investment income

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.