June 1, 20256 min readGuides

How to Print an 80mm Thermal Receipt from a Browser (Complete Guide)

If you run a retail shop, a café, or a mobile service business, you probably rely on compact thermal receipt printers. However, most online receipt generators output documents in standard A4 or Letter sizes. When you attempt to print these files on an 80mm (or 58mm) thermal receipt printer, the results are often disastrous. The output prints horribly, either scaling down to micro-text, cropping critical margins, wasting valuable paper, or forcing you to perform manual paper cuts. Fortunately, getting clean output from your web browser to a thermal printer is completely achievable with the right combination of print CSS queries and print setup options.

Why Regular PDFs Fail on Thermal Printers

To understand why default web page printing fails on thermal hardware, we have to look at how browsers handle print layouts. By default, web browsers assume you are printing onto a standard sheet of paper, such as A4 or US Letter. Consequently, the print subsystem scales content to fit these large, fixed dimensions. Thermal roll printers, on the other hand, operate on continuous rolls of paper. They do not have fixed vertical page bounds. They only have a fixed horizontal width (typically 80mm or 3 inches).

When a standard PDF or web page layout is routed to a thermal spooler, the browser applies massive default margins (usually 0.5 to 1 inch). This leaves very little room for text on an 80mm roll. Additionally, the browser automatically appends headers and footers that contain the date, page number, document title, and URL path. On a narrow receipt, these headers squish together and overlap, ruining the professional appearance of your receipt.

The CSS Fix: @page { size: 80mm auto; margin: 0; }

To solve this issue programmatically, we can leverage CSS print media queries. CSS allows developers to override the style sheet only when the document is being output to a physical printer or PDF spooler. The core solution involves utilizing the CSS @page selector to explicitly declare a custom width and indicate that the height should automatically fit the content.

Here is the exact CSS code block needed to configure browser printing for an 80mm thermal receipt printer:

@media print {
  @page {
    size: 80mm auto;
    margin: 0;
  }
  html, body {
    width: 80mm;
    max-width: 80mm;
    margin: 0;
    padding: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

Let’s dissect how these properties function. Setting size: 80mm auto instructs the browser’s rendering agent that the physical media is exactly 80 millimeters wide and has a fluid, dynamic length that adjusts to the size of the elements. Specifying margin: 0 overrides browser-default margins. This serves the dual purpose of maximizing the printable area and completely stripping away the unwanted browser date/URL headers. Finally, forcing print-color-adjust: exact ensures that background shading and logos print in high fidelity instead of being omitted by default energy-saving options.

Step-by-Step: Print from Chrome, Firefox, Edge

Even with proper CSS, browser configuration settings are essential to secure a perfect print. Here is a step-by-step guide to setting up your print dialogs:

Google Chrome & Microsoft Edge

  • Open the receipt and trigger the print dialog (either click the download/print button or press Ctrl + P).
  • Set the Destination dropdown to your detected thermal receipt printer.
  • Click on More settings to expand advanced system configurations.
  • Locate Paper size. Rather than choosing A4, select 80mm roll or 80mm x Continuous (depending on your printer driver names).
  • Ensure the Margins dropdown is set to Minimum or None.
  • Uncheck the box that says Headers and footers.
  • Click Print.

Mozilla Firefox

  • Press Ctrl + P to open Firefox's print overlay.
  • Select your thermal printer.
  • Click on Page Setup. Under Format & Options, check the fit-to-page settings and zero out margins.
  • Under Headers & Footers, set all dropdown selectors to --blank-- to prevent dates and page numbers from printing.

Note:If custom paper sizes do not appear in your print panel, you may need to open your operating system's printer properties and manually add the size to the driver settings.

Using FreeReceipt.dev for Perfect 80mm Output

If you want to bypass the complexity of manually writing media queries, you can let our platform handle it for you. Our tool at FreeReceipt.dev takes care of CSS adjustments dynamically.

When you toggle the print format to POS Receipt (80mm), our editor automatically formats the template, resizes font scales, and injects the necessary media styling directly. Hit our download button, and a clean, perfectly structured, unbranded document is generated right in your browser, ready to send to your device spooler without any page-cut headaches.

Troubleshooting Common Issues

  • Issue 1: Receipt content is too wide or cropped: Make sure you have chosen 80mm paper size inside the print dialog instead of leaving it on default A4. If it continues, adjust the scale percentage in the settings down to 90% or 95%.
  • Issue 2: URL, page number, or date printing at the top: Double-check that browser headers are turned off in your system settings. Setting margins to 0 manually can also force these tags out.
  • Issue 3: Font text is too small: Make sure the source template is formatted for POS. POS receipts need slightly larger font-to-page ratios. Using our POS Receipt layout automatically optimizes font hierarchies.
  • Issue 4: Logo appears blurry or pixelated: Thermal printers print in black and white at 203 DPI. Use high-contrast, high-resolution logos (at least 300 DPI) and avoid color gradients for crisp lines.

Conclusion

Printing clean 80mm thermal receipts from standard browsers does not have to be frustrating. By using clean CSS styling like @page { size: 80mm auto; margin: 0; }, you can ensure perfect spool alignment every time. Ready to build your first professional thermal receipt? Try our Free 80mm POS Receipt Maker tool now.