Free Invoice Generator
Make a professional invoice — line items, tax, discount, shipping — and download a clean A4 PDF. Ten currencies including LKR, USD, and EUR. Sri Lanka VAT and SSCL presets baked in. Everything runs in your browser, no signup, sources cited.
How it works
An invoice is a tax document and a payment instruction at the same time. The tax authority (in Sri Lanka, the Inland Revenue Department under the VAT Act No. 14 of 2002 and its amendments) sets the rules for how the gross is computed; the payer expects a clear breakdown of what they are paying for. This tool follows both, using the formulas spelled out in the IRD VAT Guide §5 and matching the conventions used by Stripe, FreshBooks, and Xero.
For each invoice the calculator does this:
- Line totals. For every line item:
lineTotal = quantity × unitPrice × (1 − lineDiscount%), rounded to the currency's precision (two decimals for LKR, USD, EUR; zero for JPY). - Subtotal. Sum of the rounded line totals — not the unrounded sum then rounded once. The IRD VAT Guide §5.4 explicitly requires line-by-line rounding before aggregation, and this is what tax inspectors compare against on reconciliation.
- Discounted subtotal.
discountedSubtotal = max(0, subtotal − invoiceDiscount). An invoice-level discount comes off the gross of all lines and is capped at the subtotal — you cannot discount into negative. - Tax.
tax = discountedSubtotal × rate. Tax applies to the net consideration (the amount the buyer actually pays for the goods or service), not the pre-discount subtotal. The presets cover Sri Lanka VAT 18%, SSCL 2.5%, both combined at 20.5%, the export zero-rated supply at 0%, and a no-tax option for non-VAT-registered freelancers. - Grand total.
grandTotal = discountedSubtotal + tax + shipping. Shipping is added after tax — that mirrors the treatment of carriage and handling charges in most jurisdictions when they are not themselves a taxable supply on the invoice.
The calculator also exposes a tax-inclusive cross-check function (calculateTaxInclusive): given a gross that already contains tax, it backs out the net and the tax using the identity tax = gross × rate / (1 + rate) — the same VAT fraction the IRD VAT Guide §5.6 uses for tax-inclusive prices. The exclusive and inclusive paths agree to the rupee on every example in the table below.
The PDF is rendered with pdf-lib, an MIT-licensed pure-JavaScript PDF library, dynamic-imported when you press Generate so the page bundle stays under 100 KB until then. The layout is A4 with 48-pt margins, Helvetica for the body (a standard PDF font, no embedding overhead), and a Sapphire accent band matching this site's identity. Long invoices paginate automatically. Up to 100 line items are accepted per invoice.
Worked examples
Tax presets explained
The tax selector ships five presets plus a custom rate. Each maps directly to a published Sri Lankan statute or a common international scenario:
- No tax0.00%
Untaxed invoice (exempt supply, B2C below threshold, etc.).
- Sri Lanka VAT 18%18.00%
Standard VAT rate effective 1 Jan 2024 (VAT Amendment Act No. 32 of 2023).
- Sri Lanka SSCL 2.5%2.50%
Social Security Contribution Levy on liable supplies (SSCL Act No. 25 of 2022).
- VAT 18% + SSCL 2.5%20.50%
Both VAT and SSCL applied together (combined effective rate 20.5%).
- Export zero-rated 0%0.00%
Exports zero-rated under §7 of the VAT Act.
Frequently asked questions
Sources & references
- IRD Sri Lanka — Value Added Tax (VAT) overview and rates
- IRD Sri Lanka — Social Security Contribution Levy (SSCL) Act No. 25 of 2022
- ISO 4217 — Currency codes (LKR, USD, EUR, JPY, etc.)
- pdf-lib — MIT-licensed pure-JavaScript PDF library used for rendering
- MDN — Web Storage API (the localStorage used for Save to browser)
The math model and tax presets were cross-checked against the IRD VAT Guide on 2026-05-11. The calculation module lib/data/invoice-generator.ts carries the full citation chain and is unit-verifiable against the worked examples above.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want to suggest an improvement?
Email me at [email protected] — most fixes ship within 24 hours.