1. Scope
Calculates late-payment penalties from invoice amount, grace period, a fixed fee, and an annual interest rate. US-centric defaults. Not legal advice — enforceable penalty rates are governed by state usury law and contract terms.
2. Inputs and outputs
Inputs
- invoiceAmount number (currency)
- dueDate date
- paymentDate date
- gracePeriodDays number default: 0
- flatLateFee number (currency) default: 0
- annualInterestRate percent default: 0
Outputs
- daysLate
max(0, paymentDate − dueDate − gracePeriod).
- interestAmount
invoice × (annualRate / 365) × daysLate.
- totalOwed
invoice + flatFee + interest.
Engine source: src/lib/invoice-late-fee-interest-calculator/engine.ts
3. Formula / scoring logic
days_late = max(0, date(paid) - date(due) - grace_days)
interest = invoice * (annual_rate / 365) * days_late
total_owed = invoice + flat_fee + interest 4. Assumptions
- Simple-interest accrual daily. Compounding and payment-allocation rules (fee first or interest first) are contract-specific.
- Banker's 365-day year, not 360 or 30/360.
- No withholding or VAT logic — entered at gross.
5. Data sources
6. Known limitations
- State usury caps on permissible interest rates vary (5–24%+). Excess is unenforceable.
- EU customers: EU Directive 2011/7 on combating late payment governs statutory interest (ECB reference rate + 8 pp). Use that as a benchmark for B2B EU invoices.
7. Reproducibility
Input
invoice = $5,000, daysLate = 30, flatFee = $25, annualRate = 12%.
Expected output
interest ≈ $49.32, total_owed ≈ $5,074.32.
8. Change log
- 2026-04-24 methodology page first published.