The Stock Profit Calculator answers one question about a single stock trade: after commission and tax, how much money is actually left? You enter the buy price, the sell price, the number of shares, optional holding days, the two commissions, and a tax rate, you press Calculate, and the page shows total cost, total revenue, gross profit, tax, net profit, percent return, and annualized return. It runs in your browser: the arithmetic is pure client-side JavaScript and no price or position data is sent to a server.
Seven fields, three required
Three fields must be filled before anything appears: buy price, sell price, and share count. Pressing Calculate with any of them empty, or with shares at zero or less, shows nothing at all. There is no error message and no red state. The result section simply does not appear, and whatever was on screen before stays. The other four fields are optional. Holding days, buy commission, sell commission, and tax rate each fall back to zero when left blank, so a minimal three-field run still produces a full seven-line result.
How cost and revenue are computed
Total cost is buy price times shares plus buy commission. Total revenue is sell price times shares minus sell commission. The asymmetry is deliberate: the fee you pay to enter the trade is added to what the position cost, and the fee you pay to exit is subtracted from what the position returned. Gross profit is then simply revenue minus cost. In a worked example, buying 100 shares at 100.00 with a 5.00 buy commission and selling at 110.00 with a 5.00 sell commission gives a total cost of 10,005.00, a total revenue of 10,995.00, and a gross profit of 990.00.
When the tax line applies
Tax is charged only when the gross profit is positive. The tool multiplies the gross by the tax rate you enter, as a percentage, and subtracts the product from the gross to get net profit. If the gross is zero or negative, the tax line is exactly 0.00, whatever rate you typed, and the net profit equals the gross. A flat trade still loses money through fees: buying and selling 100 shares at 100.00 with a 10.00 buy commission and a 5.00 sell commission produces a gross of minus 15.00, a tax of 0.00, and a net of minus 15.00. The percent return on that total cost is about minus 0.15 percent.
Percent return and annualized return
The percent return is net profit divided by total cost, times 100, so it measures the trade against everything you actually put in, commissions included. The annualized return takes one plus that same net-over-cost ratio, raises it to the power of 365 divided by holding days, and subtracts one. In the worked example, a 30-day hold turns the 7.92 percent net return into an annualized figure of about 152.67 percent, which is the point of the metric: it makes a two-week trade comparable to a two-year position. If you leave holding days blank, the annualized line reads 0.00 percent by design, because the exponent is undefined without a holding period. A trade that loses its entire cost, a sell price of zero, shows minus 100 percent on both lines.
What you can copy out
When a result exists, the copy button puts all seven lines on your clipboard as plain text, each line a field name followed by a colon and the formatted value, like netProfit: 792.00. Values are formatted with thousands separators and exactly two decimals. The four profit-oriented lines, gross profit, net profit, percent return, and annualized, are colored green when they are zero or above and red when negative, so a losing trade is visible at a glance before you read the numbers.
What is not here, and where to go next
The tool is deliberately narrow: one buy price, one sell price, one position, no portfolio and no cost basis per lot. If you want to size the position so a stop loss risks a fixed percentage of the account, the Position Sizing tool starts from the risk you can afford. If the trade is in crypto rather than a listed stock, the Crypto Tax Calculator applies short and long term rates to each transaction separately, and if the question is what the whole balance sheet looks like after the trade, the Net Worth Calculator tracks the assets side. The position sizing walkthrough pairs with this one: it decides how many shares to buy, and this one prices what the trade was worth once it is closed.