How capital gains tax works on shares
When you sell shares for more than you paid, the profit is called a capital gain, and most countries tax it. The gain is not the full sale money. It is the sale money minus what you paid for the shares and minus the broker fees you paid to buy and sell.
The tax is the gain times your capital gains rate. That rate depends on your country, your income and how long you held the shares. Some countries charge less for shares held over a year, and many give you an annual tax-free allowance before any tax is due. This calculator shows the simple version of that maths.
How to use the calculator
Enter how many shares you are selling, the price you paid per share and the price you will sell at. Add the total broker fees for the buy and the sell. Then enter the tax rate as a percent. Your broker statement or tax adviser can tell you the rate for your case; 20 percent is a common planning figure.
Press the button and the tool shows your gain, the estimated tax and the money you keep after tax. The bar shows the tax as a share of what you receive. Try a higher sell price to see how the tax grows with the gain.
Worked example: 100 shares, bought at 10, sold at 15
You own 100 shares bought at 10 each, so the purchase cost is 1,000. You sell at 15 each, so you receive 1,500. Broker fees are 20 in total. The gain is 1,500 minus 1,000 minus 20, which is 480.
At a 20 percent rate, the tax is 96 and you keep 1,404 after tax. If the sell price were 20 instead, the gain would be 980, the tax 196 and you would keep 1,804. The tax grows with the gain, so a big win always costs more tax, but you still keep most of it.
Why you should check before you sell
Many investors only learn the tax after the sale, when the money is already gone. Knowing it first changes the choice. Sometimes waiting until the next tax year, using an annual allowance, or selling in two parts keeps more money in your pocket.
Losses matter too. If one sale loses money, that loss can often offset gains from other sales in the same year, which lowers the total tax. Keep records of every buy and sell, including fees, so you can prove the cost when you file.
Limits of this calculator
This is an educational estimate, not tax advice. Real tax depends on your country, your total income, how long you held the shares, annual allowances and whether the shares sit in a tax-free account such as an ISA or a retirement plan. Rates and rules change often.
The calculator also ignores currency changes, dividends and any tax already withheld by your broker. If you trade often, hold shares abroad, or have a large gain, talk to a tax adviser before you sell. A small fee for advice can save far more in tax.
Frequently asked questions
Do I pay tax if I sell at a loss? No. A loss means no gain and no capital gains tax. The loss can often offset other gains in the same year, so keep the record.
Are broker fees part of the cost? Yes, in most countries. Fees paid to buy and sell reduce the gain, which reduces the tax.
Does holding longer lower the tax? In many countries, yes. Long-term gains often get a lower rate than short-term gains. The rules differ by country, so check yours.
What if I only sell some of my shares? The gain is worked out on the shares you sold, using their buy price. If you bought the same shares at different prices, the rules for which price counts vary by country.
También disponible en español: Impuesto sobre Ganancias en Acciones.
