Free HTML invoice template
A clean, print-ready invoice template in plain HTML and CSS: no framework, no external assets, and A4 page rules built in. Use it as-is, or as a starting point for your app's invoices.
The code
<!doctype html><html><head><meta charset="utf-8"><title>Invoice INV-2026-0042</title>
<style>
@page { size: A4; margin: 16mm }
* { box-sizing: border-box }
body { font-family: -apple-system, "Segoe UI", Roboto, "Noto Sans", "Liberation Sans", Arial, sans-serif; color: #1f2937; font-size: 13px; margin: 0; padding: 8px }
.top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px }
h1 { font-size: 30px; letter-spacing: 2px; margin: 0 0 6px; color: #4f46e5 }
.meta { color: #6b7280; line-height: 1.7 }
.meta b { color: #111827 }
.logo { max-height: 70px; max-width: 220px }
.parties { display: flex; gap: 40px; margin-bottom: 28px }
.parties div { flex: 1; line-height: 1.55 }
.label { text-transform: uppercase; font-size: 10px; letter-spacing: 1px; color: #6b7280; margin-bottom: 4px; font-weight: 600 }
table { width: 100%; border-collapse: collapse }
th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #6b7280; border-bottom: 2px solid #e5e7eb; padding: 8px 6px }
td { padding: 10px 6px; border-bottom: 1px solid #f0f0f0; vertical-align: top }
.r { text-align: right; white-space: nowrap }
tr { break-inside: avoid }
.sum { margin-left: auto; width: 280px; margin-top: 16px }
.sum div { display: flex; justify-content: space-between; padding: 5px 6px }
.sum .grand { border-top: 2px solid #4f46e5; margin-top: 6px; padding-top: 10px; font-size: 16px; font-weight: 700 }
.notes { margin-top: 36px; color: #374151; line-height: 1.55; break-inside: avoid }
</style></head><body>
<div class="top">
<div>
<h1>INVOICE</h1>
<div class="meta">
<div><b>No.</b> INV-2026-0042</div>
<div><b>Date:</b> Oct 18, 2026</div>
<div><b>Due:</b> Nov 1, 2026</div>
</div>
</div>
</div>
<div class="parties">
<div><div class="label">From</div>Acme Studio LLC<br>500 Market St<br>San Francisco, CA</div>
<div><div class="label">Bill to</div>Globex Corp<br>Accounts Payable<br>billing@globex.com</div>
</div>
<table>
<thead><tr><th>Description</th><th class="r">Qty</th><th class="r">Unit price</th><th class="r">Amount</th></tr></thead>
<tbody>
<tr><td>Website redesign</td><td class="r">1</td><td class="r">$4,800.00</td><td class="r">$4,800.00</td></tr><tr><td>Hosting (monthly)</td><td class="r">12</td><td class="r">$25.00</td><td class="r">$300.00</td></tr>
</tbody>
</table>
<div class="sum">
<div><span>Subtotal</span><span>$5,100.00</span></div>
<div><span>Discount</span><span>−$200.00</span></div>
<div><span>Tax (8.5%)</span><span>$416.50</span></div>
<div class="grand"><span>Total due</span><span>$5,316.50</span></div>
</div>
<div class="notes"><div class="label">Notes</div>Pay by bank transfer within 14 days.<br>IBAN: US00 0000 0000 0000</div>
</body></html>
Why it prints well
@page { size: A4; margin: 16mm }sets the paper size and margins in CSS.- Table rows and the notes block use
break-inside: avoid, so they never split across pages. - It uses only system fonts and inline CSS, so nothing has to load before printing.
- All layout is flexbox and tables, which print the same way in every Chromium-based renderer.
Convert it to PDF from your code
Fill the template with your data (any templating language works: Handlebars, Jinja, Blade, ERB, JSX), then send the HTML to the PDFLoom API:
curl https://pdfloom.dev/v1/pdf \
-H "Authorization: Bearer $PDFLOOM_KEY" \
-H "Content-Type: application/json" \
-d "$(jq -Rs '{html: ., preferCSSPageSize: true}' invoice-template.html)" \
-o invoice.pdf
If you don't want to maintain a template at all, the invoice API takes JSON line items and returns this same design as a PDF. Prefer a form? Use the free invoice generator.
Fill it with plain JavaScript (no build step)
For a pure HTML invoice with no templating engine, replace the rows inside <tbody> with nothing and add this script before </body>. It builds the line items and totals from a plain array:
<script>
const items = [
{ desc: 'Website redesign', qty: 1, price: 4800 },
{ desc: 'Hosting (monthly)', qty: 12, price: 25 },
];
const taxRate = 0.085;
const money = (n) => n.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
const td = (text, right) => {
const cell = document.createElement('td');
cell.textContent = text;
if (right) cell.className = 'r';
return cell;
};
const tbody = document.querySelector('tbody');
let subtotal = 0;
for (const it of items) {
const amount = it.qty * it.price;
subtotal += amount;
const row = document.createElement('tr');
row.append(td(it.desc), td(it.qty, true), td(money(it.price), true), td(money(amount), true));
tbody.append(row);
}
const tax = subtotal * taxRate;
const sums = document.querySelectorAll('.sum div span:last-child');
sums[0].textContent = money(subtotal); // Subtotal
sums[1].textContent = money(0); // Discount
sums[2].textContent = money(tax); // Tax
sums[3].textContent = money(subtotal + tax); // Total due
</script>
It uses textContent, so item names can't inject HTML. Server-side rendering with PDFLoom runs the script in real Chrome before printing, so the PDF has the filled-in numbers.
Use it as a bill, receipt or quote
- Bill: change the
<h1>to BILL. Keep "Bill to" and the due date. - Receipt: change the heading to RECEIPT, replace "Due" with "Paid on", rename "Total due" to "Total paid", and put the payment method in the notes. See also the receipt generator.
- Quote or estimate: change the heading to QUOTE, replace "Due" with "Valid until", and put the terms in the notes. See also the estimate generator.
- VAT invoice: add your VAT number under "From" and the customer's under "Bill to", and show the tax rate on the tax line. See the VAT invoice generator.
FAQ
Can I use this invoice template for free?
Yes. Use, change and ship it in commercial projects. No attribution or signup is needed.
How do I save the HTML invoice as a PDF without code?
Open invoice.html in Chrome or Edge, press Ctrl+P (Cmd+P on a Mac), choose "Save as PDF" and turn on "Background graphics". The page size and margins come from the template itself.
Can I send this template as an HTML email?
Not as-is. Email clients ignore much of this CSS (flexbox, @page). This template is for print and PDF. Send the PDF as an attachment, or use a table-only email layout for the email body.
Does it need a framework or external files?
No. It is one self-contained HTML file with inline CSS and system fonts. There are no images, web fonts or scripts to load.
How do I add a logo?
Add an img tag inside the .top block. For PDF rendering use an absolute https URL or a base64 data URI so the image is available when the page prints.