How to Write an Invoice: The Arithmetic Behind the Total: formula, worked example and common mistakes
Type the line items and the rates, read a document-shaped result, print a one-page sheet. Free, nothing stored or sent.
Updated
What an invoice adds up
An invoice is a list of promises with one number at the bottom. Each line carries a description, a quantity and a unit price; the page multiplies them out, adds the lines, takes off the discount you typed, charges the typed tax rate on what remains, adds the shipping charge, and prints the total. The result block is laid out like the document itself: a headline with the document number and the total, details for the subtotal, discount, tax, shipping, total and balance, and the line-item table underneath.
The calculator is at /tools/invoice/. Names, the document number and the currency label are plain text, a blank name prints as a blank line, and the page never prints a currency symbol of its own. Print on the page prints a one-page sheet, and nothing is stored or sent.
The formula
line total = quantity × unit price
subtotal = sum of the line totals (unrounded)
discount = subtotal × discount%
taxable = subtotal − discount
tax = taxable × tax% (the shipping charge is not taxed)
total = taxable + tax + shipping
Money figures are rounded to 2 places when displayed; the totals themselves come from the unrounded line totals, which the page states in a note so the printed sheet can be checked against any spreadsheet that keeps full precision.
A worked example at the calculator’s defaults
Two lines, a 10% discount, a 20% tax rate and 15.00 of shipping.
Design work 10 × 85 = 850.00
Printing 4 × 32.50 = 130.00
subtotal = 980.00
discount 10% = 98.00
taxable = 882.00
tax 20% = 176.40
shipping = 15.00
total = 1,073.40
The headline reads INV-001: total 1,073.40. A quantity of 0 is allowed, which puts a zero line in the table without an error, and a blank description prints as a blank line on the sheet.
The due date and the balance
The payment terms are whole days typed by you, from 0 to 365, and the due date is the document date plus that many days:
2026-01-15 + 30 days = 2026-02-14, a Saturday
balance = total − amount already paid
With nothing paid the balance is the total itself, 1,073.40. Paying 1,000 leaves a balance of 73.40, and paying more than the total turns the balance negative, which the page reports as a grey note rather than an error. The due date and its weekday are shown as two rows, so the printed sheet reads the same way a statement would.
What the page does not know
No tax rate, numbering scheme or legal requirement is stored; every rate and term is typed, and the pre-filled figures are labeled as examples. The page does not check tax rules or legal requirements for invoices and keeps no copy, so the printed sheet and your own records are the invoice. The quotation and receipt pages run the same engine, so the same lines give the same total on all three documents; for the tax percent on its own, the VAT calculator works at rates you type.
Frequently asked questions
What is the formula for an invoice total?
Line total = quantity × unit price; subtotal = the sum of the line totals; discount = subtotal × discount percent; taxable = subtotal − discount; tax = taxable × tax percent; total = taxable + tax + shipping. The example lines make 980.00, and 10% off with 20% tax and 15.00 of shipping gives 1,073.40.
Why is the shipping charge not taxed?
Because the page adds it after the tax step: tax is charged on the discounted subtotal only, and the shipping charge is appended to the total as it stands. It is stated in a note on the page so the printed sheet carries the same rule.
How is the due date calculated?
The payment terms are whole days from 0 to 365, and the due date is the document date plus that many days: 30 days from 2026-01-15 is 2026-02-14, a Saturday. The balance is the total less any amount already paid.
What happens to the figures I type?
They stay in the browser: the page keeps no copy and sends nothing anywhere, and it does not check tax rules or legal requirements. Totals are computed from the unrounded line amounts and rounded to 2 places for display only.
This tool shows math, not advice.
Cite this page
Copy this line into a reference list, a report or a spreadsheet note.
Investment Math Calculator. “How to Write an Invoice: The Arithmetic Behind the Total”. Updated 2026-11-22. https://investmentmathcalculator.com/guides/invoice-calculator/
Disclaimer: For education only. These calculators show arithmetic and hypothetical scenarios. They are not investment, tax or legal advice and do not recommend any security or product. Consult a licensed adviser in your country before acting.