Stock calculator covering profit, average down, dividend yield, CAGR, ROI, margin & position size - instant, broker-accurate results every time.
Stock Calculator
What a stock calculator does, and why one tool isn't enough
A stock calculator is a small piece of maths with a friendly face. You type in what you paid, what you sold for, how many shares you held and what your broker charged, and it gives you the number everyone cares about: did you make money, and how much?
That one question hides a lot of smaller ones. What price do I have to sell at just to cover my fees? If I buy more after a drop, where does my average land? How many shares can I buy without risking more than 1% of my account? Most free tools answer one of these and leave you hunting for the rest, so we put ten calculators behind one set of tabs. Everything runs in your browser, which means the numbers you type stay on your device.
It suits people at different stages. If you've just made your first trade, the stock profit calculator shows what you really kept after fees. If you've bought the same share four times at four prices, the average price tab sorts out your cost per share in seconds. Dividend investors can check income and yield, and active traders can work out position size from a stop-loss before they place an order.
A few things it deliberately does not do. It doesn't pull live prices, so you enter your own figures. It doesn't work out capital gains tax, because the rules change from country to country and year to year. And it won't tell you what to buy. It does the arithmetic and you make the decisions.
The ten tools at a glance
Here is what each tab is for. If you already know the question you're trying to answer, this table will point you to the right one.
| Tab | Question it answers | Main result |
|---|---|---|
| P&L | Did I make money after fees? | Net profit or loss |
| Average | What is my average price after buying more? | New average price |
| Target | Where must I sell to hit my goal? | Sell price |
| CAGR | How fast did my money grow each year? | Yearly growth rate |
| Risk | How many shares should I buy? | Number of shares |
| Dividend | What income will my shares pay? | Yearly income after tax |
| Growth | What could monthly investing add up to? | Future value |
| Split | What happens to my shares in a split? | Shares after the split |
| ROI | What was my total return? | Return on investment |
| Margin | What does borrowing cost, and when is the margin call? | Own money needed |
How to use this stock calculator
If you only read one part of this page, make it this one. The routine is the same for every tab, and after it you'll find a walkthrough of each tool with real numbers you can type in to check you've understood it.
The five-step routine
- Pick a tab. The ten tabs sit under the dark header, and each one has its own colour so you always know where you are.
- Choose your currency. The drop-down in the top corner switches between $, £, €, ₹, Rs, ¥ and several others. It only changes the symbol. The maths is identical in every currency.
- Fill in the boxes. Commas are fine, so you can type 12,500. Boxes marked "Optional" can stay empty if you don't have the figure. If something is missing or impossible, the box turns red and a short message tells you what to fix.
- Press Calculate. The big number is the answer. The smaller cards underneath fill in the detail, and a mini chart shows the same result at a glance.
- Dig deeper if you want to. "See working" shows the sum line by line, "Edit inputs" takes you back to the boxes with your numbers still there, and the copy button next to it copies the result so you can paste it into a note or message.
Not sure what to type? Press "Try example" and the tab fills itself with realistic numbers, which is the fastest way to see how a tool behaves. And every fee box has a small switch: choose % when your broker charges a percentage of the trade, or the currency symbol when it charges a flat amount per trade.
3.1 Profit and loss (stock profit calculator)
Open the P&L tab when you want to know what a finished, or planned, trade really earned. Enter the buy price, the sell price and the number of shares, then add the fees on each side. "Days held" is optional, but it unlocks the annualised return.
The headline is your net profit or loss. Six cards sit underneath it: total cost, total proceeds, fees paid, breakeven price, profit per share and annualised return. The breakeven price is the one people tend to skip. It is the sell price where your proceeds exactly equal what you paid, fees included, so it is always a little above your buy price.
- You buy 40 shares at $150 and sell them at $182.50 after 120 days. Your broker takes 0.1% on each side.
- Total cost is $6,006.00 ($6,000 plus a $6.00 buy fee). Proceeds are $7,292.70 ($7,300 minus a $7.30 sell fee). Fees paid come to $13.30.
- Net profit is +$1,286.70, a return of +21.42%. Breakeven price is $150.30 and profit per share is $32.17.
- Annualised, that trade works out to +80.48%.
Take that last figure with a pinch of salt. Annualising a four-month trade stretches a short result over a full year, and nothing says you can repeat it. It is a handy way to compare trades of different lengths, not a forecast.
Prices below $1 are shown to four decimals, so the same tab works as a penny stock calculator. Fractional shares and crypto work too, because the shares box accepts decimals. To work out profit by hand, subtract the buy price from the sell price, multiply by the number of shares, then take off every fee. If all you need is the percentage change between two numbers, our percentage calculator is quicker.
3.2 Average price (stock average calculator and average down calculator)
Bought the same share more than once? Your broker usually shows an average cost, but it helps to work it out before you buy so you can see what the purchase would do. Enter the shares you own and your current average, then the shares you plan to buy and the price. Add today's market price if you also want the unrealised profit or loss and the rise you'd need to get back to breakeven.
- You hold 100 shares with an average of $48. The price falls and you buy 50 more at $36.
- Your new average is $44.00 across 150 shares, with $6,600 invested in total.
- With the market at $42, the position is worth $6,300, so you're down $300 (-4.55%). The stock needs to rise 4.76% to bring you back to breakeven.
The same tab handles averaging up, when you add shares at a higher price, so it works as a general average price per share calculator. If you hold more than two lots, run it twice: combine the first two, then enter the result as "your average" and add the third.
3.3 Target price
This one works backwards. Instead of asking what a sale earned, you say what you want to earn and it tells you the price. Enter your buy price, the number of shares, both fees and the profit percentage you're aiming for.
- You buy 200 shares at $25 with a 0.1% fee on each side, and you want a 20% profit.
- The calculator says to sell at $30.06. That sale brings in $6,012.01, which leaves a profit of $1,001.00 after both fees.
- Your breakeven price is $25.05.
Notice that $30.06 is a little more than the $30.00 you'd get by adding 20% to $25. The goal is measured against your total cost including the buy fee, and the sell fee has to be covered as well. On a big trade the gap is tiny. On a small trade with flat fees it can be larger than you'd expect.
You can also type a negative number. Entering -10 gives the price where you'd be down 10% after fees, which is a quick way to choose a stop-loss level.
3.4 CAGR (compound annual growth rate)
CAGR answers a simple question: what steady yearly growth rate would take me from this start value to this end value? Type the starting value, the ending value and how long you held it. Held something for five and a half years? Put 5 in the years box and 6 in the extra months box.
- An investment grows from $10,000 to $18,500 over 5 years.
- The CAGR is +13.09% a year. The total gain is $8,500, the growth multiple is 1.85x, and the money doubles roughly every 5.6 years at that pace.
CAGR smooths out the bumps. A stock that jumped 60% in year one and then went nowhere shows the same CAGR as one that grew evenly, so it is a summary, not the whole story. It also assumes you didn't add or withdraw money along the way. If you did, the Growth or ROI tabs are a better fit. To find the CAGR of a stock, use the share price at the start and end of the period, and add dividends to the end value if you want a rough total-return figure.
The doubling-time card uses the exact logarithm formula rather than the rule of 72 shortcut. The two agree closely, as this table shows.
| Yearly growth | Exact doubling time | Rule of 72 |
|---|---|---|
| 4% | 17.67 years | 18.0 years |
| 7% | 10.24 years | 10.3 years |
| 10% | 7.27 years | 7.2 years |
| 15% | 4.96 years | 4.8 years |
The shortcut drifts a little at higher growth rates, which is why we use the exact figure.
3.5 Position size (how many shares should I buy?)
Position sizing starts with a limit on how much you're willing to lose, not with how much you'd like to buy. Enter your account size, the percentage of it you'll risk on this trade, your entry price and your stop-loss. A take-profit price is optional and adds the reward-to-risk ratio.
- Account of $25,000, risking 1%, entry at $50, stop-loss at $47.50, take-profit at $57.50.
- Cash at risk is $250 and the risk per share is $2.50, so you can buy 100 shares. That position is worth $5,000, or 20% of the account.
- If the stop is hit you lose $250. If the target is hit you make $750, a reward-to-risk ratio of 3 : 1.
The tool always rounds the share count down, so your risk never creeps above the limit you set. If your stop is above your entry, it treats the trade as a short, changes the heading to "Shares to short" and expects the target below the entry.
| Stop-loss | Risk per share | Shares | Position value |
|---|---|---|---|
| $49.00 | $1.00 | 250 | $12,500 |
| $48.00 | $2.00 | 125 | $6,250 |
| $47.50 | $2.50 | 100 | $5,000 |
| $45.00 | $5.00 | 50 | $2,500 |
Account $25,000, risk 1% ($250), entry $50. A tighter stop allows more shares for the same dollar risk.
That pattern is worth noticing. A tighter stop lets you hold more shares for the same dollar risk, but the position can get large compared with your account. That's why the results show "Share of account", and why a warning appears when you'd need more buying power than you have. Also remember that a stop-loss isn't a guarantee. If a stock gaps down overnight, your sale can happen below the stop price.
3.6 Dividend income and yield (dividend calculator for stocks)
This tab turns a share price and a dividend into income you can plan around. Enter the share price, the number of shares, the dividend per share for the whole year, the tax rate on dividends, and how often the company pays. Choose monthly, quarterly, twice a year or once a year.
- You hold 300 shares at $64. The company pays $2.40 per share a year, quarterly, and 15% is taken as tax.
- Dividends before tax are $720.00 and tax is $108.00, leaving $612.00 a year. That is $153.00 per payment, or $51.00 a month on average.
- The dividend yield is 3.75% ($2.40 divided by $64). Measured against your $19,200 holding, the after-tax yield is 3.19%.
The same $612 a year looks different depending on how it's paid, which is why the tab shows a per-payment figure. This table uses the example above.
| Paid | Payments a year | Each payment |
|---|---|---|
| Monthly | 12 | $51.00 |
| Quarterly | 4 | $153.00 |
| Twice a year | 2 | $306.00 |
| Once a year | 1 | $612.00 |
All four rows add up to the same $612.00 a year after tax.
One slip catches a lot of people: the box wants the dividend for the whole year. If a company pays $0.60 every quarter, type 2.40, not 0.60. To calculate a dividend by hand, multiply shares by the yearly dividend per share, then take off tax. The yield is simply the yearly dividend divided by the share price. If you plan to reinvest your dividends, the Growth tab is the closer fit. Use an expected total return (price growth plus dividend yield) as the yearly return, and it behaves like a compound dividend calculator.
3.7 Growth projector (monthly investing)
Enter a starting amount, a monthly top-up, the yearly return you expect and the number of years, anywhere from 1 to 100. You can leave the starting amount at zero if you're starting from scratch, or the top-up at zero to see a one-off lump sum grow.
- You start with $5,000, add $300 every month, and assume 8% a year for 20 years.
- The pot reaches $194,004.51. You paid in $77,000, so growth accounts for $117,004.51, which is 60.31% of the final value.
- The growth multiple is 2.52x on the money you put in.
Behind the scenes the tab converts your yearly return into an exact monthly rate, so 8% a year really means 8% over twelve months, and it adds each top-up at the end of the month. If you only want a savings-style compound interest figure, our compound interest calculator does that job. And when you look at a number twenty years out, remember what prices will have done in the meantime. Running the result through the UK inflation calculator gives a more honest sense of what that money could buy. Markets don't deliver a smooth 8% either, so treat the curve as an illustration.
3.8 Stock split and reverse split
When a company splits its shares, you own more of them, each worth proportionally less, and the total value of your holding doesn't change. Enter how many shares you own, the price before the split, and the ratio as "new shares for every old share".
- A 3-for-1 split on 75 shares priced at $420 gives you 225 shares at $140. The holding is worth $31,500 both before and after.
- A 1-for-10 reverse split on 105 shares priced at $2 gives you 10 whole shares at $20. The leftover half share is paid out as cash ($10), so the total stays $210.
The tool shows the new price, the new share count, the cash paid for any fraction, and how much your share count changed. It makes a decent reverse stock split calculator for exactly that reason, because fractions are where reverse splits get confusing. One more thing to remember: your average cost per share adjusts as well. After a 2-for-1 split, an old average of $50 becomes $25.
3.9 Return on investment (ROI)
The ROI tab is the all-in view. Enter what you invested, what it's worth now, any dividends received and any fees or costs. Add the months held if you want an annualised figure. Dividends are added to the value and fees are added to the cost, so you get a truer picture than price change alone.
- You invested $8,000, it's now worth $9,650, you received $320 in dividends and paid $25 in fees. You held it for 18 months.
- Total cost is $8,025 and total returned is $9,970, so the ROI is +24.24% and the money multiple is 1.24x.
- Annualised over 18 months, that is +15.57% a year.
ROI and CAGR often get mixed up. ROI covers the whole holding period and includes dividends and fees. CAGR turns a start and end value into a yearly rate. Use ROI to judge what an investment did, and CAGR to compare it with something held for a different length of time. For non-stock investments, such as a rental or a small side project, our general ROI calculator may suit better.
3.10 Margin and leverage (margin calculator)
A quick note first: this is margin as in borrowing from your broker to buy shares, not business profit margin. If you came looking for profit margin, the formula is (revenue minus cost) divided by revenue, multiplied by 100. For borrowing, read on.
Enter the entry price, number of shares, leverage, maintenance margin, yearly interest rate and days held. Leverage of 2x means half the position is your money and half is borrowed. The maintenance margin is the minimum share of the position's value that has to stay yours. The default is 25%, which is the FINRA minimum for long positions in the US. Many brokers ask for more, so check yours.
- You buy 100 shares at $120 with 2x leverage, a 25% maintenance margin, and 8.5% interest for 90 days.
- The position is $12,000. Your own money is $6,000 and you borrow the other $6,000.
- Interest costs $127.50 ($6,000 x 8.5% x 90 divided by 360), so your breakeven price is $121.28.
- The margin call price is $80.00, which is a 33.33% fall from your entry.
The margin call price formula is entry price x (1 - initial margin) divided by (1 - maintenance margin), where the initial margin is 1 divided by your leverage. Here that's $120 x 0.5 / 0.75 = $80. We use a 360-day year for interest because that is the convention many large brokers publish. If a setup leaves no room at all, such as 4x leverage with a 25% maintenance margin, the tool tells you instead of showing a nonsense answer.
| Leverage | Margin call price | Fall from $120 |
|---|---|---|
| 1.25x | $32.00 | -73.33% |
| 1.5x | $53.33 | -55.56% |
| 2x | $80.00 | -33.33% |
| 3x | $106.67 | -11.11% |
Entry price $120, 25% maintenance margin. Higher leverage leaves far less room for the price to move against you.
The formulas behind the numbers
If you like to check the working yourself, or you just want to see that nothing mysterious is going on, here are the core formulas. They're the standard definitions, and the "See working" button shows them filled in with your own figures.
| Tool | Formula |
|---|---|
| P&L | (Sell price − Buy price) × Shares − fees. Return = Profit ÷ Cost |
| Average | Total cost ÷ Total shares |
| Target | Sell price = Cost × (1 + goal) ÷ (Shares × (1 − sell fee)) |
| CAGR | (End value ÷ Start value)1 ÷ years − 1 |
| Position | (Account × Risk %) ÷ |Entry − Stop|, rounded down |
| Dividend | Shares × Yearly dividend × (1 − Tax). Yield = Dividend ÷ Price |
| Growth | Start × (1 + i)n + Top-up × ((1 + i)n − 1) ÷ i |
| Split | New shares = Shares × New ÷ Old. New price = Price × Old ÷ New |
| ROI | (Value + Dividends − Cost − Fees) ÷ (Cost + Fees) |
| Margin call | Entry × (1 − 1 ÷ Leverage) ÷ (1 − Maintenance %) |
| Margin interest | Borrowed × Yearly rate × Days ÷ 360 |
In the growth formula, i is the monthly rate and n is the number of months.
Averaging down vs dollar-cost averaging
These two get mixed up all the time because both involve buying more than once. Averaging down means adding to a position after the price has fallen, so your average cost drops. Dollar-cost averaging means investing a fixed amount on a regular schedule, whatever the price is doing.
| Averaging down | Dollar-cost averaging | |
|---|---|---|
| When you buy | After the price falls | On a fixed schedule |
| What drives it | Your view of the stock | The calendar |
| Main risk | Adding to a losing position | Paying more in some months |
| Tab to use | Average | Growth |
The average tab makes the trade-off easy to see. In the earlier example, before buying the extra 50 shares you would have needed the stock to rise 14.29% (from $42 back to $48) to break even. Afterwards you only need 4.76% (from $42 to $44). That sounds like good news, but you also have $6,600 at risk instead of $4,800. A lower average cost doesn't make a company any healthier, so only average down when you'd be happy to buy the stock at today's price if you didn't own it already.
Why your broker's numbers may differ
If our result and your broker's statement are a few cents or a few pounds apart, one of these is usually the reason. None of them means the maths is wrong. They're real-world details that a simple calculator can't see.
| What differs | What to check |
|---|---|
| Margin interest | We use a 360-day year, as many large brokers do. A few use 365. |
| Fractions | Brokers pay cash for fractional shares after a split, and some round differently. |
| Foreign shares | Currency conversion fees and exchange-rate timing change the result. A live currency converter helps you check the rate. |
| Commissions | Tiered or minimum fees are easy to forget. Enter the amount actually charged. |
| Taxes | Not included, apart from the dividend tax box. |
| Rounding | We calculate in full precision and round only what's displayed. |
Common mistakes to avoid
- Typing a quarterly dividend into the yearly dividend box, which cuts your income estimate by three quarters.
- Forgetting the sell fee when choosing a target. Your breakeven price is never exactly your buy price.
- Reading an annualised return from a short trade as a prediction of what you'll earn next year.
- Using CAGR when you've been adding money regularly. CAGR assumes one start value and one end value.
- Sizing a position by gut feeling instead of by the distance to your stop-loss.
- Reading "margin" as profit margin, or forgetting that borrowed money magnifies losses as well as gains.
- Averaging down just to feel better about a loss, without asking whether the reason you bought still holds.
Frequently asked questions
Tap a question to see the answer.
Is this stock calculator really free?
Yes. There's nothing to sign up for and no limit on how many calculations you run. The maths happens in your browser, so the figures you type aren't sent anywhere.
How do I calculate profit on a stock?
Subtract your buy price from your sell price, multiply by the number of shares, then subtract all fees. Divide that profit by your total cost to get the percentage return. The P&L tab does all of this and also gives your breakeven price.
How do I calculate the average price of a stock?
Add up what you paid for every lot (shares times price) and divide by the total number of shares. For example, 100 shares at $48 plus 50 shares at $36 cost $6,600 in total, and $6,600 divided by 150 shares gives an average of $44.
What does averaging down mean, and is it a good idea?
It means buying more of a stock after its price has fallen, which lowers your average cost. It can help if you still believe in the company, but it also increases the money you have at risk. It isn't a way to make a losing investment safe.
How do I calculate dividend income and dividend yield?
Income is shares times yearly dividend per share, minus any tax. Yield is the yearly dividend per share divided by the share price. If you own 300 shares paying $2.40 a year at a price of $64, the yield is 3.75% and the pre-tax income is $720.
What is CAGR and how do I calculate the CAGR of a stock?
CAGR is the steady yearly growth rate that would turn your starting value into your ending value. Divide the end value by the start value, raise the result to the power of one divided by the number of years, then subtract 1. Use the CAGR tab to skip the arithmetic.
How many shares should I buy?
Decide how much of your account you're willing to lose on the trade, then divide that cash amount by the gap between your entry price and your stop-loss. The Risk tab does this and rounds down, so your loss at the stop never goes over your limit.
What is a margin call price?
It's the share price at which your equity falls to your broker's maintenance requirement. Below it, you'd be asked to add money or sell shares. The formula is entry price times (1 minus initial margin) divided by (1 minus maintenance margin).
What's the difference between ROI and CAGR?
ROI measures the total return over the whole holding period, including dividends and fees. CAGR converts a start and end value into a yearly growth rate, which makes investments held for different lengths of time easier to compare.
How does a stock split affect my shares and my money?
The number of shares changes and the price changes in the opposite direction, but the total value stays the same. In a 3-for-1 split you hold three times as many shares at one third of the price. A reverse split does the opposite, and any leftover fraction is usually paid in cash.
Does the calculator include taxes?
Only dividend tax, which you enter as a percentage. Capital gains tax isn't included because the rules and allowances differ by country and change over time. Check the current rules for your situation or ask a qualified adviser.
Can I use it for ETFs, penny stocks or crypto?
Yes. The maths for buying and selling is the same for ETFs and penny stocks, and prices under $1 are shown to four decimals. For crypto or fractional shares, enter the amount you hold in the shares box, which accepts decimals.
Why is my broker's figure slightly different?
Usually it's down to fees, currency conversion, rounding or the day-count convention used for margin interest. The section above lists the common causes, and the "See working" panel shows exactly what we calculated so you can compare line by line.
Is investing in stocks worth it?
That depends on your goals, how long you can leave the money invested, and how much risk you can live with. Share prices can fall as well as rise, and there are no guarantees. A calculator can help you test scenarios, but it can't tell you whether to invest.
Add this stock calculator to your website
Run a finance blog, a school site or a personal portfolio page? You're welcome to show this calculator on your own website. Copy the code below and paste it into the HTML view of your page or post.
This calculator is for education and planning only. It is not financial, investment or tax advice, and results are estimates based on the figures you enter. Investments can go down as well as up, and past performance doesn't guarantee future results. Speak to a qualified adviser before making decisions with your money.

No comments:
Don't add any Spam link in comment box.