ESC/POS Web Printing Without Drivers — Test Page Guide
Joe B.
Reviewed for technical accuracy
Specialities: POS & thermal printers (Epson TM/Star TSP/BIXOLON), WebUSB/Web Serial/WebHID, IPP/RAW, Kiosk setups
Print to thermal printers from the browser — driverless ESC/POS with JavaScript (WebUSB / Web Serial / WebHID)
Quick answer: the accepted fix
Accepted approach for ESC/POS web printing without drivers: connect the thermal printer with WebUSB, Web Serial, or WebHID over HTTPS; render the receipt with JS/CSS; convert to ESC/POS commands (text, images, barcodes/QR); then cut paper and open cash drawer. Validate with the included driverless test page.
Browser APIs for thermal printers — WebUSB vs Web Serial vs WebHID
WebUSB gives the most control for Epson TM and Star TSP USB models (vendor/product IDs, bulk endpoints). Web Serial is ideal when the device exposes a serial profile (CDC/ACM or USB‑to‑Serial adapters). WebHID can reach HID‑mode printers. All require HTTPS, user consent, and a clear on‑screen Connect button for secure, driverless printing.
How to verify ESC/POS from a web app
Use our JS test page: connect the device, then print a sample receipt showing bold/centered title, line items with totals, barcode/QR, and logo. The page reports success/failure bytes and suggests alternatives (image raster vs native QR) if firmware lacks a feature.
Receipt quality & reliability tips
Most issues come from wrong codepage, missing HTTPS, or mixing vendor command sets.
Quick path: confirm HTTPS and device permissions → pick the right API (WebUSB/Web Serial/WebHID) → set codepage/UTF‑8 for language → for images, dither to 1‑bit and use GS ( L → test cut and drawer with safe pulse widths → provide a print test page to each station.
Disclaimer: This information is AI-generated and intended for general guidance only. For advice specific to your environment, please consult a verified expert on Whizz-Tech before making decisions.
Getting Started Is Easy
Ask for help, 24/7
Members enjoy round-the-clock access to 12,000+ verified Experts, including tech support, mechanics, vets, and more.
Expert will respond in minutes
We match you with an Expert who specializes in your situation. Talk, text, or chat — whichever you prefer.
Save time & money
No scheduling hassles or expensive consults. Membership can save you significant time and money each month.
FAQ
Which browsers support ESC/POS printing via JavaScript?
Chrome, Edge, and most Chromium‑based browsers expose WebUSB, Web Serial, and WebHID. All require HTTPS and user consent to connect to the thermal printer.
Can I print from a web page without installing any drivers?
Yes. This article shows driverless ESC/POS printing using WebUSB/Web Serial/WebHID. Your app sends ESC/POS commands directly to the printer from the browser.
How do I trigger cut and open the cash drawer?
Use GS V for partial/full cut and ESC p to trigger the cash drawer (DK port). Our test page includes safe defaults for pulse width and timing.
Can I print images, barcodes and QR codes?
Yes. Send images as GS ( L raster data; use printer‑native QR/barcode commands when supported, or fall back to rasterized codes.
Will this work with Epson TM and Star TSP printers?
Yes. We include compatibility notes for Epson TM‑T20/TM‑T88 and Star TSP100/143. The JS picks the right command set automatically.
| Symptom | Likely cause | Quick fix |
|---|---|---|
| Browser can’t see the printer | No HTTPS or permission not granted | Serve over HTTPS and click Connect; whitelist device by VID/PID if needed |
| Garbled characters | Wrong codepage / no UTF‑8 | Switch to UTF‑8 model or set correct codepage before writing text |
| Logo/QR too light | Bad dithering or incorrect raster mode | Convert to 1‑bit, use GS ( L image format, increase darkness |
| Drawer doesn’t open | Pulse timing mismatch | Use ESC p with supported pin and width; test on the test page |
Step‑by‑step (WebUSB / Web Serial / WebHID)
- Serve your app over HTTPS (or
localhostfor dev). Add a visible Connect button. - On click, request the device via WebUSB (preferred), or fallback to Web Serial/WebHID based on the model.
- Render the receipt in a JS/CSS template, then convert to ESC/POS (text → bytes; images → raster).
- Send QR/barcodes, totals, then issue GS V (cut) and ESC p (drawer) as needed.
- Validate using the built‑in driverless printing test page; adjust darkness and codepage.
Step‑by‑step (Kiosk hardening)
- Pin the site as a PWA with a Service Worker and offline cache for assets and templates.
- Lock down Chrome policies (optional): WebUSB allow‑lists for the printer VID/PID to streamline pairing.
- Create a fallback network queue (IPP/RAW) only if corporate policy forbids device APIs; otherwise stay driverless.
Sources
- Chrome Developers — WebUSB
- Chrome Developers — Web Serial API
- Chrome Developers — WebHID
- Epson — ESC/POS Command Reference
- Star Micronics — TSP Series Docs
Filed under: Label / thermal / POS / shipping labels
Related articles
- Revel POS prints restaurant modifiers tiny — font rule
- Toast POS Kitchen Dockets Losing Text at the Edge — What the DPI Setting Is Cutting Off and How to Get Full Tickets Printing
- QuickBooks POS thermal tax prints blurry — DPI & driver checks you can do safely
- Odoo POS receipts print giant text — ESC/POS scaling
- Clover POS thermal prints reversed characters — encoding toggle
- Shopify POS to Star/Bixolon over Bluetooth — pairing mode & profile selection
- 58mm POS receipt truncates taxes on long orders — fix totals & template width
- Toast POS kitchen printer not printing — port/protocol fix