Random invoice generator
This tool fabricates complete invoice records with arithmetically correct totals so you can populate accounting dashboards, invoice tables, and PDF previews with realistic test data. Every figure adds up, which lets you verify that your own totalling and tax logic agrees.
How it works
Each invoice gets a unique-looking invoice number, an issue date within the past 90 days, and a due date 14 to 30 days later. Two to five line items are generated, each with a random description, a quantity, and a unit price. The subtotal is the sum of quantity × unitPrice across all lines. Tax is subtotal × (taxRate / 100), and the grand total is subtotal + tax. Every monetary value is rounded to two decimal places using standard half-up rounding so the displayed figures reconcile exactly.
Tips and examples
Set the tax rate to your market’s VAT or sales-tax percentage — for example 20 for UK VAT — and generate a batch to confirm your invoice view sums and rounds the same way. Use the JSON export to seed an accounting system and check that imported subtotals, tax, and totals match. Replace the placeholder parties with real data before issuing anything.
What you can test with fake invoice data
Test data is most useful when it exercises the edge cases that real production data rarely provides in convenient batches. Here is how to get the most from the generated invoices:
Rounding verification. The generator computes quantity × unitPrice per line and rounds each intermediate and final amount to two decimal places. Most accounting bugs live in rounding: does 0.1 + 0.2 equal 0.30 or 0.30000000000000004? Does your tax line round before or after summing? Feed a batch of invoices into your system and compare the totals field by field with the generated values to catch any discrepancy.
Multi-line-item rendering. The generator produces two to five line items per invoice, which tests whether a table, PDF template, or print view handles a variable row count gracefully. A layout that looks fine with two lines can break visually or overflow a page boundary with five.
Date logic. Issue dates are set within the past 90 days and due dates 14–30 days later. Use these to test overdue detection logic, ageing bucket reports (current / 1–30 / 31–60 / 60+ days overdue), and sorting by due date. If your overdue flag does not trigger correctly on the test data, it will not trigger correctly on real invoices.
JSON import and round-trip fidelity. The JSON export includes the full invoice object with a lineItems array. Import a batch into your accounting software, database, or API and verify that re-exporting produces identical totals. Discrepancies in the tenth decimal place often mean your system is storing amounts as floating-point numbers rather than integers (cents) or fixed-point decimals.
UI stress testing. Company names and item descriptions in the generated data vary in length and character composition. Use this to verify that long text wraps correctly, that numeric columns stay aligned, and that narrow viewports do not truncate important fields silently.