DEV Community

Michael Lip
Michael Lip

Posted on • Originally published at zovo.one

Building Professional Receipts: What the Format Standards Actually Require

A receipt is a legal document. In many jurisdictions, businesses are required by law to issue receipts for transactions above a threshold. The format, content requirements, and retention periods vary by country, but the core elements are universal.

Required elements

Every legitimate receipt should include:

Business information: Name, address, and tax identification number (EIN in the US, VAT number in the EU, ABN in Australia). Without these, the receipt can't be used for tax deductions or business expense reporting.

Date and time: When the transaction occurred. For tax purposes, the date determines which fiscal year the transaction falls in. Time can matter for returns and disputes.

Itemization: Each item or service with its description, quantity, unit price, and line total. A single line reading "Services: $500" is insufficient for most business expense reporting. Itemization prevents disputes and satisfies audit requirements.

Tax breakdown: The tax rate applied, the tax amount, and the jurisdiction. In the US, sales tax varies by state, county, and city. A receipt from a business in Los Angeles needs to show the combined 9.5% rate and the individual components (state, county, city, district).

Total: Subtotal before tax, tax amount, and total including tax. If discounts were applied, show the original price, discount amount, and discounted subtotal.

Payment method: Cash, credit card (last four digits only), check, bank transfer. Never include full card numbers. PCI-DSS compliance requires masking.

Transaction identifier: A unique receipt or invoice number for reference.

Digital receipt formats

Paper receipts fade. Thermal paper receipts (the standard from POS systems) become illegible within 3-7 years. For record-keeping, digital formats are superior.

PDF is the standard for digital receipts. It preserves formatting, is universally viewable, and can be stored indefinitely. The PDF should be structured (tagged PDF) for accessibility and machine readability.

Machine-readable formats (JSON, XML) are increasingly common for automated expense reporting. Standards like UBL (Universal Business Language) and ZUGFeRD define XML schemas for invoices and receipts that accounting software can parse automatically.

Thermal printer formatting

If you're building a POS system, thermal printers accept ESC/POS commands. The receipt width is typically 48 or 80 characters. Alignment is done with spaces and special alignment commands. Bold, underline, and font size are controlled with escape sequences.

ESC a 1       // Center align
ESC E 1       // Bold on
"STORE NAME"  // Store header
ESC E 0       // Bold off
ESC a 0       // Left align
"Item    Qty  Price"
Enter fullscreen mode Exit fullscreen mode

The constraints of thermal printing force a clean, efficient layout. No colors, no images (well, some printers support basic bitmaps), just text alignment and weight. There's an elegance to designing within these constraints.

I built a receipt generator at zovo.one/free-tools/receipt-generator that creates professional receipts with all the required fields, tax calculations, and export to PDF. It handles multiple tax rates, discounts, and itemized services. Useful for freelancers, small businesses, and anyone who needs to issue receipts without dedicated accounting software.

I'm Michael Lip. I build free developer tools at zovo.one. 500+ tools, all private, all free.

Top comments (0)