Tools Thicket Logo Tools Thicket

No login · Fully in browser

Expense What-If Calculator — Model a Bill Before You Commit

Type bill lines, adjust tax, fees, discounts and payments, and watch the total — and the change from where you started — update instantly.

  • Every figure is rounded to whole cents, and the per-line shares are allocated so they add up to exactly 100%
  • Shows the delta from your original figure, not just the new total
  • Runs entirely in the browser, no login
Total amount $0.00
Original total $0.00
Incremental increase/decrease $0.00
No change yet.

Per-line contribution

Instantly model a bill in your browser

What this tool will not do

  • You supply the tax rate. There are no built-in jurisdiction tax tables — it will not know your state, county or country rate for you.
  • Discounts are per-line percentages. There is no single cash discount spread proportionally across every line.
  • It models one bill, not a schedule. Recurring costs are not projected forward over time.
  • Nothing is saved. Reload the page and your lines are gone — copy the results text if you need to keep them.
  • This is a modelling tool, not tax advice. Where tax is actually owed, and on what, varies by jurisdiction — confirm before you rely on a number.
: add/edit/remove line items, set tax, service fee, discounts or extra payments, and see total, per-line contributions and the change from the original amount — no login required.

How to use (3 steps)

  1. Enter or paste line items (amount, taxable flag, optional label). You can add negative amounts for credits/refunds.
  2. Set tax rate, discount (percent or fixed), service charge (percent or fixed, and whether it’s taxable), and any extra payment.
  3. See live totals: subtotal(s), service, tax, grand total, per-line contribution and delta vs original — copy or share the results text.

Principles & formulas

  • Internal units: all currency math is done in minor units (cents) as integers to avoid floating-point error. Parse user input as cents(x) = Math.round(x * 100) when accepting free text.
  • Notation used here: cents(...) = integer cents; ratePercent (e.g., 20 for 20%) → rate = ratePercent / 100.
  • Default order of operations (configurable):
    1. Parse & sanitize inputs → convert to integer cents; parse percent rates to decimal.
    2. Apply discounts (default: discounts applied before tax). Each line is discounted on its own: discountedLine = amount × (1 − discount%), and the result is rounded to two decimal places. There is no global discount amount spread across lines.
    3. taxableSubtotalCents = sum(discountedLineCents for lines where taxable=true). nonTaxableSubtotalCents = sum(discountedLineCents for taxable=false).
    4. Compute serviceAmountCents: if service is percent → serviceAmountCents = round(serviceRate * serviceBaseCents). serviceBaseCents default = (discounted subtotal of all lines) unless user config chooses otherwise. Service can also be a fixed cents value. Service has a taxable boolean flag.
    5. Determine taxable base for tax calculation: taxableBaseCents = taxableSubtotalCents + (serviceAmountCents if service.taxable) + any other taxable adjustments.
    6. Compute tax: taxCents = round(taxRate * taxableBaseCents).
    7. Total: totalCents = sum(all discountedLineCents) + serviceAmountCents + taxCents + extraPaymentCents.
  • Per-line contribution (for display and shareable breakdown): for each line i, contributionCents_i = discountedLineCents_i + shareOfService_i + shareOfTax_i.
    • shareOfService_i = round(serviceAmountCents * (discountedLineCents_i / discountedSubtotalCents)) (or allocated by proportional cents algorithm if serviceAmountCents is fixed).
    • shareOfTax_i = round(taxCents * (taxableShare_i / taxableBaseCents)) where taxableShare_i is line i’s contribution to taxableBase (include its share of service if service is taxable).
    • Sum(contributionCents_i) + extraPaymentCents = totalCents (deterministic distribution ensures the equation holds).
  • Rounding rules: keep integer cents across arithmetic. For percentage multiplications compute high-precision fractional cents and round half-up to the nearest cent (retail rounding). For proportional fixed-discount/service distribution use floor((lineCents * amountToDistribute) / subtotalCents) and assign remaining cents deterministically to lines with largest remainders so totals match exactly.

Worked examples

  • VAT example (GOV.UK): One taxable line 60.00, taxRate 20% → tax 12.00, total 72.00 (60 x 1.20 = 72).
  • Discount before tax (TaxJar rationale): One taxable line 30.00, discount 5%, taxRate 8% → discounted = 28.50, tax = 2.28, total = 30.78.
  • Service taxable flag (NY/CA example): Lines 100 (taxable) + 50 (non-taxable), service 10% on subtotal and service.taxable=true; taxRate 10% → subtotal 150.00; service 15.00; taxable base 115.00; tax 11.50; total 176.50.

FAQ

Q: Should discounts be applied before or after tax?

A: Default behavior: discounts apply before tax (this reduces the taxable base). The simulator supports a configurable post-tax discount mode for jurisdictions or business rules that require it.

Q: Is the service charge taxed?

A: Service charges can be taxable or non-taxable depending on local rules. The tool treats service as a separate line with a taxable flag — turn the flag on if your service is taxable (the service amount then becomes part of the taxable base).

Q: How is the discount applied to each line?

A: Discounts are entered per line as a percentage (Discount %), so each line is reduced on its own — there is no single global discount amount to spread across lines. Each line's result is rounded to two decimal places and totals remain consistent.

Q: How does rounding work? Will totals always match the displayed per-line sums?

A: All calculations are done in integer cents. Percent results are computed in higher precision and rounded half-up to the nearest cent. Proportional distributions use floor + remainder allocation to ensure the per-line shares sum exactly to the requested total. This avoids floating-point drift and keeps totals consistent.

Q: Can I enter negative amounts (refunds) or very large numbers?

A: Yes — negative amounts are supported and treated normally (the UI will warn if the final total is negative). Very large values are clamped to safe application limits (e.g., configurable upper bound such as < 10^12 cents) to avoid overflow — the tool validates and highlights out-of-range inputs.

Q: Do I need an account or internet access to use this tool?

A: No account or backend APIs are required. The single-page simulator runs fully in your browser and requires no login — results can be copied or shared as plain text.

Q: Are the formulas and behavior configurable for different tax rules?

A: Yes. Order of operations (e.g., pre-tax vs post-tax discounts), service charge base, and taxable flags are configurable so you can model jurisdictional differences. The default choices reflect common practice (discounts before tax; service taxability configurable).

Q: Where do these rules come from?

A: The worked examples come from published tax guidance rather than from any single vendor: the 20% VAT example follows GOV.UK guidance on VAT rates, the discount-before-tax example follows the general US sales-tax treatment of discounts, and the taxable-service-charge example follows New York and California guidance on service charges. Tax rules vary by jurisdiction and change over time — treat this as a modelling tool and confirm the treatment for your own location before relying on it.