ForHosting KIT · Developer Utilities

Shipping margin calculator

Shipping revenue is not automatically shipping profit. A store may collect a delivery fee at checkout, then pay a different amount to the carrier and consume packaging materials for the same order.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

This shipping margin calculator puts those figures on one basis. Enter the fee charged to the customer, the actual carrier bill, and the packaging cost for one shipment. The result shows total fulfillment shipping cost, the resulting profit or loss, and the margin percentage when shipping revenue is greater than zero.

Enter comparable amounts for one shipment

Use the shipping fee actually charged to the customer, not the product price or the order total. Then enter the carrier cost incurred for that exact shipment and the cost of the packaging materials consumed. Packaging can include a box or mailer, tape, labels, cushioning, cold packs, or other materials that are used up when the parcel is prepared. Keep all three figures in the same currency and on the same tax basis. If the customer received free shipping, enter zero for the shipping fee; the calculator will still expose the carrier and packaging expense as a shipping loss. Use the final carrier charge whenever possible, because an estimated label price may later change through address correction, dimensional weight, residential delivery, or other adjustments. Do not mix a monthly packaging purchase with a single shipment. Convert bulk purchases into a reasonable cost per parcel first. The calculation accepts zero for a cost that genuinely does not apply, but every value must be a finite, nonnegative number without currency symbols or thousands separators.

Read profit, loss, and margin correctly

The calculator first adds carrier cost and packaging cost to produce actual shipping cost. It then subtracts that total from the customer shipping fee. A positive shipping profit or loss value is profit, a negative value is loss, and zero is break-even. The result field states that classification directly. When the shipping fee is greater than zero, shipping margin percentage equals shipping profit or loss divided by the shipping fee, multiplied by one hundred. For example, collecting 12.99 while paying 8.40 to the carrier and 1.35 for packaging produces 9.75 of actual cost and 3.24 of shipping profit. The margin is approximately 24.94 percent of shipping revenue. If the customer paid nothing for shipping, percentage margin is omitted because division by zero has no meaningful result; the absolute loss and its classification remain available. Outputs are rounded to two decimal places for stable reporting. This is a revenue margin, not markup on cost, and it should not be compared with formulas that divide profit by carrier expense.

Apply the result to shipping policy

Review the absolute result together with the margin instead of optimizing either number in isolation. A positive shipping margin can offset packaging labor or occasional carrier adjustments, but charging substantially more than delivery costs may reduce checkout conversion or conflict with marketplace rules. A loss may be intentional when free or subsidized shipping supports product margin, customer acquisition, or a minimum-order strategy. In that case, treat the reported loss as a deliberate promotion cost and confirm that the rest of the order can absorb it. Run the same calculation across services, zones, parcel sizes, and sales channels to find patterns hidden by averages. This capability only includes the customer shipping fee, carrier charge, and packaging materials supplied. It does not automatically include warehouse labor, pick-and-pack fees, insurance, duties, payment processing, returns, reshipments, storage, software, or product profit. Add those items in a broader contribution analysis when they affect the decision. For audits, save the output beside the order, carrier invoice, and packaging-cost source. Identical inputs always return identical results, and each API calculation costs $0.002.

Audit completed orders

Compare the checkout shipping charge with the final carrier bill and materials used for each parcel.

Test a flat shipping fee

Measure where one customer-facing fee produces a profit or loss across different shipment profiles.

Evaluate free shipping

Quantify the delivery and packaging cost the product margin must absorb when the customer pays no shipping fee.

What formula does the shipping margin calculator use?

Actual shipping cost equals carrier cost plus packaging cost. Shipping profit or loss equals the customer shipping fee minus actual shipping cost. Margin percentage divides that result by the shipping fee and multiplies by one hundred.

What happens when I offer free shipping?

Enter a shipping fee of zero. The carrier and packaging total is reported as a loss, while margin percentage is omitted because a percentage based on zero shipping revenue is undefined.

Should packaging labor be included?

The packaging cost field is intended for consumed materials. Include labor only if your accounting policy converts it into a reliable per-shipment amount and you deliberately choose to treat that amount as packaging cost.

Does the calculator retrieve carrier rates?

No. It does not contact carriers or estimate a label. Enter the actual or quoted carrier charge that is relevant to the shipment you are evaluating.

Is shipping margin the same as markup?

No. This margin uses the customer shipping fee as the denominator. Markup normally uses cost as the denominator and therefore produces a different percentage.

How much does an API calculation cost?

Each API request costs $0.002. The browser calculator uses the same deterministic arithmetic for manual checks.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/ecom/shipping-margin

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/ecom/shipping-margin \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"shipping_fee":12.99,"carrier_cost":8.4,"packaging_cost":1.35}'
{
  "shipping_fee": 12.99,
  "carrier_cost": 8.4,
  "packaging_cost": 1.35
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "ecom.shipping_margin",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →