The sale
This page works out a capital gain on a sale, not a dividend tax. Nothing is calculated yet.
Type the shares you sold, the price you bought them at, the price you sold them at and the rate you want applied. The page answers the three numbers a sale comes down to — the taxable gain, the tax on it, and what is left after the tax — and prints the arithmetic for each one underneath. A capital gains tax calculator for shares, a tax on stock gains calculator and a stock sale tax calculator are three names for this one job. The rate is yours: this page holds no tax table, suggests no bracket and does not tell you which rate to use.
This page works out a capital gain on a sale, not a dividend tax. Nothing is calculated yet.
One sale, four steps, and every step is printed under the results using the numbers you typed.
The fees sit inside the gain, not beside it: the buy fee goes into what the shares cost you, the sell fee comes off what the sale paid you, and the gain is the gap between the two. That is why the taxable gain here is smaller than the raw difference between the two prices — a fee on either side narrows it.
Worked example: 150 shares bought at 50.00 and sold at 62.00, with a 5.00 fee on the way in and a 7.00 fee on the way out. Total cost is 7,500.00 + 5.00 = 7,505.00. Gross proceeds are 150.0000 × 62.00 = 9,300.00, net proceeds 9,300.00 − 7.00 = 9,293.00, and the taxable gain is 9,293.00 − 7,505.00 = 1,788.00. What the tax comes to depends entirely on the rate you type, so the page stops there until you put one in — and once you do, it prints the multiplication and the subtraction that follow.
A commission reads like a flat cost: the money goes out, and that is the end of it. It is not quite the end of it. A fee on either side narrows the taxable gain by exactly what the fee was, and a narrower gain is taxed less, so part of every fee comes back to you as tax you no longer owe. The fee is still a cost. It is just a smaller one than the figure on your statement.
How much smaller is set by one number, the rate in the box, and it is the same on both sides of the sale. Take the sale above: 150 shares bought at 50.00 and sold at 62.00, with 5.00 on the way in and 7.00 on the way out. Without either fee the taxable gain would be 1,800.00; with them it is 1,788.00. The 12.00 of fees took exactly 12.00 off the gain, and at 15.00% that is 270.00 − 268.20 = 1.80 of tax you no longer owe. So the 12.00 cost you 12.00 − 1.80 = 10.20.
What a fee costs you = the fee × (1 − your rate ÷ 100)
That line is the whole of it, and it runs across the rates:
| Your rate | Tax with no fees | Tax with the 12.00 in | Tax the fees saved | What the 12.00 cost you |
|---|---|---|---|---|
| 0.00% | 0.00 | 0.00 | 0.00 | 12.00 |
| 15.00% | 270.00 | 268.20 | 1.80 | 10.20 |
| 20.00% | 360.00 | 357.60 | 2.40 | 9.60 |
| 37.00% | 666.00 | 661.56 | 4.44 | 7.56 |
The direction is the part worth sitting with: the higher the rate, the less a fee costs you. At 0.00% you pay the whole 12.00 out of your own pocket; at 37.00% you pay 7.56 of it and the 4.44 of tax you no longer owe covers the rest. A commission is cheapest for the person who is taxed hardest, which is the opposite of how it feels when the line appears on a statement.
Two things that are not true, and are worth saying because they are the way this point usually gets repeated. A fee never costs you more than itself: the rebate is a share of the fee, not an extra payment on top of it. And a fee never makes you money: at any rate below 100% the last column stays above zero. Put the commission into the basis, it comes off the tax is exactly as true as that column says and no truer: it turns 12.00 into 10.20, not into nothing.
Where the two sides do differ is the base, and only when a fee is entered as a percentage. Given as a percent, the buy fee is taken on the money you paid in and the sell fee on the gross proceeds, and on a sale at a gain the second of those is the bigger number. The same 1.00% either way is 75.00 on the 7,500.00 you paid in and 93.00 on the 9,300.00 the sale brought: 168.00 in total, which at 15.00% is 25.20 of tax saved and 142.80 actually paid. A percentage commission costs more on the way out than on the way in, on the same position.
All of the above is arithmetic on the figures this page already prints. Whether your fee is deductible, whether it belongs in the basis at all, and how your broker reports it are questions about your own filing, and there is no field for any of them here.
The same 12.00 of commission at four rates. What you pay shrinks as the rate rises, because the bigger the rate, the more of the fee comes back as tax you no longer owe.
From the box, and from nowhere else. There is no tax table behind this page, no bracket lookup, no list of countries or states, and no rate of the site's own waiting to be used if you skip the field. Type one and the page multiplies by it; type nothing and the tax line stays empty rather than filling itself in.
That is a deliberate limit, and it is the reason this page is honest about what it returns. A capital gains figure is only as good as the rate behind it, and a rate is a fact about you — where you file, what else you earned, how long you held the shares, what kind of account they sat in — that no calculator can read off a share count and two prices. So the page asks, and if you do not answer, it says the tax was not calculated instead of showing a number it invented.
What follows from that: the figure here is the arithmetic of your own rate against your own gain, and nothing more. It is not an estimate of a tax bill, it is not a filing position, and it is not advice about which rate applies to you. If you do not know which rate to type, this page is not the place to find out.
Three prices and a rate — the shares, what you paid, what you sold at, and the rate you typed. Fees if you type them. Everything below is outside the page, with no box to put it in.
A sale at a loss leaves this page with a figure it does not take further — the sale produced no gain, so the tax line stays empty — and that figure is what carries forward. So this section takes up exactly where that line above stops: this page does not work the carryover out, it has no field for it and it will not print one, and what follows is the rule the number obeys once it leaves this page, for you to carry instead. Taking that leftover through the worksheet itself, line by line, is what the capital loss carryover worksheet does; this page stops at the loss and the rule it obeys after that.
The figure itself is the two numbers already on this page, the other way round: what the shares cost you including the buy fee, less what the sale paid you including the sell fee. That is the loss, and the order it gets used in is what the carryover is about:
Two things about that last one are worth carrying with the figure. The carryforward has no expiry — it does not lapse if you do not use it — and it does not change its nature on the way: a loss from the sale of stock stays a capital loss and keeps going through gains before income, year after year, until it is used. Which of your losses went into the sum is a matter between you and your own records; this page knows only about the one sale you typed into it.
Where that leaves this page: it gives you the loss, and it does not walk forward from there. Nothing above is a figure this calculator produced, nothing was looked up, and no field here holds a loss from another sale, another year or a limit. What you take away is the rule and where to check it, which is the part that stays the same whatever the numbers turn out to be.
Every figure on this page is rounded down, never up — the same rule as the rest of the site. Share counts and per-share prices are shown to four decimals, amounts and percentages to two, so the number you read is never larger than the one that was computed.
On this page that rule cuts in one direction that is worth knowing: the tax is floored to the cent, so the tax shown is at most a cent under the exact multiplication, and the after-tax net is floored again after it. Both are printed with the arithmetic beside them, so you can redo either one with a different rule if the place you are putting the figure expects one.
Whatever your rate comes to on the gain — and the rate is the part this page cannot supply. Type the shares, the two prices and the fees, and the page returns the taxable gain; type your rate as a percent and it returns the tax on that gain and what is left after it. Without a rate the page stops at the gain and says so, because a tax figure built on a rate nobody chose would be a guess dressed as an answer.
Whatever your rate comes to on the gain, and the first thing to settle is whether the 300,000.00 is the gain or the money the sale paid you. Those two are different numbers, and the tax is worked out on the first of them only.
If 300,000.00 is the gain: 1,000 shares bought at 100.00 and sold at 400.00 give a cost of 100,000.00, net proceeds of 400,000.00 and a taxable gain of 400,000.00 − 100,000.00 = 300,000.00. The tax is that gain times the rate you type: at 0.00% it is 0.00 and the whole 300,000.00 stays; at 15.00% it is 300,000.00 × 0.15 = 45,000.00, leaving 255,000.00 of the gain; at 20.00% it is 60,000.00, leaving 240,000.00. The after-tax line above reads higher than those last two, at 400,000.00, 355,000.00 and 340,000.00, because it is the proceeds less the tax, and the proceeds still contain the 100,000.00 the shares cost you.
If 300,000.00 is what the sale paid you, the gain is smaller, because the cost comes off first: 1,000 shares bought at 100.00 and sold at 300.00 give net proceeds of 300,000.00 and a taxable gain of 300,000.00 − 100,000.00 = 200,000.00, so the tax is 30,000.00 at 15.00% and 40,000.00 at 20.00%. Same proceeds, two different taxes: what moved between them is the cost you typed, not the rate.
Put the fees back in and both rows shrink, because a fee sits inside the gain rather than beside it: the same 1,000 shares with a 5.00 fee on the way in and a 7.00 fee on the way out give a taxable gain of 299,988.00, and at 15.00% a tax of 44,998.20 instead of 45,000.00.
Which of the three rates is yours is not something this page decides. It keeps no table, asks nothing about how long you held the shares or where you file, and will not fill the box in for you: type a rate and the numbers above come out of your own figures, type none and the page stops at the gain and says the tax was not calculated.
The same 300,000.00 of gain at three rates. The rate is the one figure this page does not supply; the arithmetic is identical whichever one you type.
If the whole 100,000.00 is one kind of gain, it is one multiplication: at 0.00% the tax is 0.00, at 15.00% it is 15,000.00, at 20.00% it is 20,000.00. The number people get wrong is the one they start from. If 100,000.00 is what the sale paid you and the shares cost 60,000.00, the gain is 40,000.00, and the same three rates give 0.00, 6,000.00 and 8,000.00.
Real sales are often not one kind of gain. Suppose 60,000.00 of it is long term and 40,000.00 is short term. This page carries one rate box, not two, so you run it twice and add the two answers: 60,000.00 × 0.1500 = 9,000.00, then 40,000.00 × 0.2200 = 8,800.00, which is 17,800.00 on the 100,000.00. Read as one rate across the whole gain that is 17,800.00 / 100,000.00 × 100 = 17.80%, which is neither of the two rates you typed. A page that fills in one long term rate for you would have said 15,000.00 and stopped there.
Both of those rows can be produced above: 1,000 shares bought at 100.00 and sold at 160.00 give a taxable gain of 60,000.00, and 1,000 shares bought at 100.00 and sold at 140.00 give 40,000.00. Run the first with your long term rate, write the tax down, run the second with your short term rate, and add the two. The rate is yours to supply either way; this page holds no table and will not pick one for you.
Four lines, and the page prints each one in the figures you typed. Total cost is the shares times the buy price, with the buy fee added. Net proceeds is the shares times the sell price, with the sell fee taken off. The taxable gain is the second less the first. The tax is that gain times the rate you typed, and the after tax figure is the proceeds less that tax. Every one of those is cut off downwards rather than rounded up, so a figure on this page is never larger than the arithmetic behind it.
The one thing the page will not do is choose the rate. It asks nothing about how long you held the shares, what you earn, or how you file, so it has no way to know whether your gain is taxed at 0, 15 or 20, or at an ordinary income rate instead. Type a rate and the four lines come out of your own numbers. Type none and the page stops at the gain and says the tax was not calculated, which is the honest result when nobody has picked a rate.
What the sale paid you, less what the shares cost you, with the fee on each side counted in. That is the figure in the taxable gain line above, and it is not the same thing as the difference between the two prices. On the sale above, 150 shares bought at 50.00 and sold at 62.00 is a difference of 12.00 a share, so 150 × 12.00 = 1,800.00. The 5.00 on the way in goes into what the shares cost you and the 7.00 on the way out comes off what the sale paid you, so the gain this page prints is 9,293.00 − 7,505.00 = 1,788.00. The 12.00 between the two numbers is the two fees, and nothing else.
Both of those are printed in the arithmetic under the results, each one from your own numbers: the total cost line carries the buy fee, the net proceeds line carries the sell fee, and the taxable gain is the second less the first. Leaving a fee out does not leave it out of your pocket, it leaves it out of the gain, which is why the gain above is smaller than the raw difference between the prices, and why the section above can put a number on what the fee actually cost you.
Because a rate is a fact about your circumstances, not about the shares. Where you file, what else you earned, how long you held the position and what kind of account held it all move the number, and none of them can be read off a share count and two prices. This page keeps no table and picks no bracket, so the rate has to come from you — and if it does not, the tax line stays empty rather than filling itself in.
On the gain: what the sale paid you, less what the shares cost you, with the fee on each side counted in. Selling 150 shares for 9,300.00 is not 9,300.00 of taxable money — the 7,505.00 they cost comes off first, and the fees on both sides move that gap. The taxable gain line above is that difference, and it is the figure your rate is applied to.
Yes, and in both directions. A buy fee raises what the shares cost you, a sell fee lowers what the sale paid you, and both narrow the gain the rate is applied to. That is why the fees are inside the gain rather than subtracted after it — leaving them out would tax you on money that went to costs, not to you.
The taxable gain comes out at or below zero, and the tax line stays empty with a line saying why: there is no gain for your rate to be applied to. The page does not go on to work out what that loss does on a tax return — carried forward, or set against other gains — because that is a question about your whole filing, not about this sale.
Everything the limit did not absorb, and this page will not put a number on it because the limit is reissued every year. The order it goes in is stable, and that is the part to take away: losses against that year's capital gains first, then up to an annual cap against other income, then whatever is still unused forward into the next year, where it runs through the same three steps again. The current cap and the exceptions around it are set out in IRS Publication 550 and in the Schedule D instructions for the year you file — take the figure from there rather than from any calculator, including this one, which has no field for a carryover and prints no carryforward figure.
No. This page is about selling: shares bought at one price, sold at another, and the tax on the difference. Dividends are money a share paid you while you held it, they are taxed under their own rules, and they are not part of any figure here. For that income, use the dividend calculator.
One sale at a time, and the whole position at one price. There is no field for a partial sale and no way to enter a second sell price, so a position sold in stages is several runs of this page, each with its own shares and its own price.
It matches when the rate you typed is the one that applies and the cost you typed is the one the filing uses. Both are yours, and both are where a difference would come from: an adjusted basis carrying a split or a reinvested dividend, a rate that is not the one the page multiplied by, or a second layer of tax this page does not model. The printed arithmetic lets you see exactly which of your own numbers produced each figure.
That one stops before tax and covers several buys. The stock profit calculator pools any number of purchases into one average cost, charges the fee on each side and returns the net profit and the break-even price, with no tax anywhere on the page. This page takes one buy price and adds the tax: the gain, the tax your rate produces, and what is left after it.
Yes to the first, no to the second. The fields stack to a single column on a narrow screen and the results stay inside the width of the page. There is no sign-up, no pop-up and nothing to install: the whole calculation runs in your browser and your numbers are not sent anywhere.
This page is a calculator, not tax advice. It applies the rate you type to the gain you enter and takes no view on which rate applies to you. Contact: contact@stockavg.com