Shopping Cart Total Calculator - Tax, Discount & Shipping
Add up your cart with discount codes, loyalty points, sales tax and shipping. See the order of operations, a worked example and what you save.
Cart Items
The Mathematical Order of Operations in E-Commerce Checkout
A common consumer misconception is that sales tax and discounts can be applied in any sequence. In statutory tax accounting (and in major e-commerce platforms like Shopify, Amazon, and WooCommerce), discounts must reduce the taxable transaction subtotal BEFORE sales tax is calculated:
1. Gross Item Subtotal = Σ (Unit Price × Quantity) 2. Promotional Discount = Percentage or Fixed Amount deducted from Subtotal 3. Loyalty Points Credit = Points × Value per Point (capped at remaining subtotal) 4. Net Taxable Subtotal = Subtotal − Promotional Discount − Loyalty Credit 5. Sales Tax = Net Taxable Subtotal × (Local Tax Rate ÷ 100) 6. Final Total = Net Taxable Subtotal + Sales Tax + Shipping Cost
Why this order matters: Applying a 10% discount before tax saves you money on both the items and the sales tax itself! For example, on a $100 cart with 8% tax, discounting first gives tax of $7.20 ($90 × 8%), whereas applying the discount after gross tax would mean paying tax on the full $100 ($8.00).
Worked Example: The $100 Cart Breakdown
Suppose your cart contains 2 shirts at $40.00 each ($80.00) and 1 pair of socks at $20.00, yielding a gross subtotal of $100.00. You apply a 10% coupon code, redeem 500 loyalty points (at $0.01/point = $5.00), your state tax rate is 8.0%, and standard ground shipping is $5.00:
- Gross Subtotal: (2 × $40.00) + (1 × $20.00) = $100.00
- 10% Coupon Discount: $100.00 × 0.10 = −$10.00 (Remaining = $90.00)
- Loyalty Points Credit: 500 × $0.01 = −$5.00 (Net Taxable Base = $85.00)
- Sales Tax (8%): $85.00 × 0.08 = +$6.80
- Untaxed Shipping: +$5.00
- Final Checkout Total: $85.00 + $6.80 + $5.00 = $96.80
- Total Savings Achieved: $10.00 + $5.00 = $15.00 (15.0% total discount off retail merchandise)
Percentage Off vs. Fixed Amount Discounts: Which Is Better?
Choosing between a percentage coupon (e.g., 15% off) and a flat dollar coupon (e.g., $20 off) depends strictly on your subtotal break-even point:
- Break-Even Formula: Threshold = Fixed Dollar Amount ÷ Percentage Rate. For a choice between $20 off and 15% off: $20 ÷ 0.15 = $133.33.
- If your subtotal is UNDER $133.33: The $20 fixed discount gives superior dollar savings (e.g., on an $80 order, $20 off saves 25%).
- If your subtotal is OVER $133.33: The 15% discount yields higher dollar savings (e.g., on a $200 order, 15% off saves $30.00).
- Cart Subtotal Cap: Note that fixed discounts cannot exceed the order subtotal (you cannot receive negative cart amounts).
Sales Tax Jurisdictions & Shipping Taxation
Sales tax regulations vary substantially by geographic location and state law. In this calculator, enter your applicable local sales tax rate (e.g., 0% in Delaware, Oregon, New Hampshire, or Montana; 4% to 10.25% in other US states and municipalities). While many e-commerce merchants charge sales tax exclusively on physical goods, certain jurisdictions mandate tax on delivery freight when shipping is deemed non-separable. Check local merchant policy for precise tax boundaries.
Formulas Used
Gross Subtotal
Subtotal = Σ (Item Unit Price × Quantity)Sum of all line items before coupons, credits, tax or shipping.
Discount Amount
Percentage: Subtotal × (Discount % ÷ 100) | Fixed: min(Discount Value, Subtotal)Reduction in merchandise price from promotional codes.
Net Taxable Base
Taxable Subtotal = Subtotal − Discount Amount − Loyalty CreditThe statutory adjusted purchase amount subject to government sales tax.
Order Total
Total = Taxable Subtotal + (Taxable Subtotal × Tax Rate) + ShippingFinal charge to your credit card or payment method at checkout.
Variables Explained
Cart Items
List of items with unit price and quantity added to your basket.
Discount Type & Value
Percentage off (e.g., 10%) or fixed cash amount (e.g., $15.00).
Tax Rate (%)
Local, state, or provincial sales tax percentage (defaults to 0%).
Shipping Cost
Delivery fee charged by carrier or retailer.
Loyalty Points & Value
Rewards points balance and dollar value per point (e.g., 500 pts at $0.01 = $5.00).
Important Notes
Sales tax rules, exemptions for essential groceries/apparel, and freight taxation vary by country, state, and municipality.
This calculator computes standard commercial checkout arithmetic. Always review the merchant's final review screen before completing payment.
Frequently Asked Questions
Related Calculators
Price Comparison Calculator
Shopping and RetailDiscount Calculator
Shopping and RetailTip Calculator
Shopping and RetailSale Price Estimator
Shopping and RetailFinal Price after Discount Calculator
Shopping and RetailShopping Cart Total Calculator
Shopping and RetailLoyalty Points Calculator
Shopping and RetailBudget Tracker for Shopping
Shopping and RetailItem Quantity Calculator
Shopping and RetailQuick Tips
- 1Track results over time
- 2Consider personal factors
- 3Set realistic goals
- 4Share progress with others