The share count is not a guess and it is not the same on every trade. It falls out of three numbers: your account, the percentage you are willing to lose, and the distance to your stop.
Shares to buy equal your account multiplied by your risk percentage, divided by the per-share risk (entry minus stop). A $25,000 account risking 1% has $250; entering at $50.00 with a stop at $48.50 risks $1.50 a share, so the position is 166 shares. A tighter stop buys more shares for the same money at risk, never less risk.

Shares = (account × risk%) ÷ |entry − stop|. Slippage, gaps and commissions are not included, so treat the risk figure as the planned amount, not a guarantee.
Shares = (account × risk%) ÷ (entry price − stop price)
That is the whole calculation. The denominator is your risk per share, so a tight stop buys more shares and a wide stop buys fewer - for exactly the same money at risk. The calculator also shows the position's cost, because a correctly sized position can still be larger than your buying power.

Sizing is arithmetic. Reading the chart that sets your stop is the skill - Chart Bound drills that part free, on real historical charts.
Play free, no signup →A $25,000 account risking 1% has $250 to lose on the trade. Entry at $50.00 with a stop at $48.50 risks $1.50 a share, so the position is 166 shares and costs $8,300. Move the stop to $47.00 and the same $250 buys 83 shares.
Sizing is downstream of the stop, so the stop cannot be chosen to make the size comfortable. The three usual methods are structure (beyond the swing that invalidates the idea), volatility (a multiple of average range) and a fixed percentage. Moving a stop to fit a position you already wanted is the most expensive habit on the list, and it is why risk management starts with the stop, not the size.
Divide the money you are willing to risk (account x risk %) by the per-share risk (entry minus stop). The result is the share count.
That is your decision and depends on your plan and circumstances; smaller percentages survive longer losing runs, which the risk of ruin calculator shows directly.
The same maths works anywhere you can define an entry and a stop. There is a crypto version with fractional units on its own page.
A very tight stop can produce a share count that costs more than your buying power. The calculator flags it - the fix is fewer shares, not a wider stop.
Free to use, on any site, with no signup: paste this one line where you want the tool to appear. It loads our hosted version, so it stays up to date, and the link under it credits back to this page.
420×620 by default and it scales down to fit a narrower column. Please keep the attribution link.

Sizing is arithmetic. Reading the chart that sets your stop is the skill - Chart Bound drills that part free, on real historical charts.
Play free, no signup →