An ESC/POS emulator, or virtual printer, pretends to be a receipt printer: it accepts ESC/POS bytes, usually on TCP port 9100, and shows the receipt on screen or saves it as HTML or an image instead of printing it. It's the fastest way to develop and test receipt layouts, run printing in CI, or debug a POS without wasting paper. It won't catch every real-printer problem, though, so you still need one cheap printer for final testing.
Quick picks (checked on GitHub, October 2026):
- Desktop GUI with live preview: escpresso (Rust, MIT) or ESC/POS Virtual Printer Emulator (Rust, MIT)
- Network printer in Docker with a web inbox: escpos-netprinter (AGPL-3.0)
- On an Android device: RawBT's built-in virtual printer
- Unit tests: a dummy printer from your ESC/POS library
Why test with an emulator?
- Speed: see a layout change instantly instead of tearing off paper.
- No hardware on every desk: developers and CI servers can "print" without a printer.
- Debugging: many emulators log every command they receive, which shows exactly what your code sent.
- Paper and waste: hundreds of test receipts add up.
Option 1: GUI emulators with live preview
escpresso
A virtual ESC/POS receipt printer written in Rust. It listens on TCP port 9100 and renders receipts in a window as the data arrives. Its README lists text formatting (bold, underline, double size, inverted, alignment), raster images (ESC * and GS v 0), QR codes via GS ( k, code pages, 58 mm and 80 mm paper, density and cut lines, with over 100 commands parsed. Install with Rust's package manager:
cargo install escpresso
escpresso # then print to 127.0.0.1:9100
ESC/POS Virtual Printer Emulator
Another Rust project with a GUI. It runs a server on port 9100 and can install itself as a Windows printer (or a CUPS printer on Linux), so you can print to it from ordinary applications as well as from code. Build it from source with cargo build --release.
Option 2: A virtual network printer in Docker
escpos-netprinter runs as a container that accepts jobs like a real network printer: raw/JetDirect on port 9100 and LPD on port 515. Each receipt becomes an HTML page you can browse on port 80. It emulates an 80 mm roll and, according to its README, answers the status requests a POS system sends.
docker run -d \ -p 9100:9100/tcp -p 515:515/tcp -p 80:80/tcp \ --mount source=receiptVolume,target=/home/escpos-emu/web \ gilbertfl/escpos-netprinter:3.2
It's ideal for a shared test environment or a staging POS. Its author warns not to expose it on a public network, and a single print can't take longer than 10 seconds.
Option 3: A virtual printer on Android
RawBT includes a virtual printer. According to its developer's documentation, it can open and preview .prn files on the device and share a virtual printer over the network (ports 9100 and 9102–9108) or Bluetooth. That makes it handy for testing a POS that prints from another device.
Option 4: Dummy printers in unit tests
For automated tests, you don't need rendering at all. Capture the bytes and compare them with an expected output (a "golden file"):
# Python: python-escpos ships a Dummy printer that stores output from escpos.printer import Dummy p = Dummy() p.set(align="center", bold=True) p.text("CORNER CAFE\n") p.cut() assert p.output.startswith(b"\x1b") open("receipt.bin", "wb").write(p.output)
// PHP: escpos-php can write to any stream $connector = new FilePrintConnector("php://stdout"); // or a temp file $printer = new Printer($connector);
In JavaScript, the encoder already returns a Uint8Array, so compare it directly. Snapshot tests catch accidental layout changes in code review.
Option 5: Preview from receipt markup
ReceiptLine (Apache-2.0) is "markdown for receipts". You write receipts in a simple text format, and its tools turn them into printer commands or SVG previews. It's a different workflow: you design in the markup and generate commands, rather than emulating an existing byte stream. The companion command-line tool receiptio works with escpresso.
Roll your own: a 20-line capture server
Sometimes all you need is to see the bytes your POS sends. This Python script listens on port 9100 and saves each job to a file:
import socket, datetime srv = socket.create_server(("0.0.0.0", 9100)) print("Listening on :9100") while True: conn, addr = srv.accept() with conn: conn.settimeout(2) data = bytearray() try: while chunk := conn.recv(4096): data += chunk except socket.timeout: pass name = datetime.datetime.now().strftime("job-%H%M%S.bin") open(name, "wb").write(data) print(name, len(data), "bytes from", addr[0])
Open the file in a hex viewer and check it against our ESC/POS command reference.
ESC/POS to PDF
There's no single standard converter, but you can get a PDF in two ways: save an emulator's HTML or image output and print it to PDF, or render the receipt to an image yourself while you generate it. Many libraries can produce an image preview alongside the printer commands.
What emulators don't catch
- Character tables. Your printer's code page numbering may differ from the emulator's.
- Missing commands on budget printers. An emulator happily renders a QR command your real printer ignores.
- Speed and buffer limits. Big images that overflow a cheap printer's buffer look perfect in an emulator.
- Bluetooth behaviour. Pairing, sleep and reconnects only show up with real hardware.
- Paper and darkness. How dithered photos look on real thermal paper.
Keep at least one real printer of the model your customers use for final checks. Developers printing from Android can send test jobs through a print app, which handles the Bluetooth side for you; see ESC/POS in JavaScript.
Frequently asked questions
Is there a free ESC/POS printer emulator?
Yes. escpresso and ESC/POS Virtual Printer Emulator are MIT-licensed, and escpos-netprinter is AGPL-3.0. All run locally.
Can I install a virtual receipt printer on Windows?
Yes. ESC/POS Virtual Printer Emulator can install itself as a Windows printer, so ordinary programs can print to it.
How do I test ESC/POS output in CI?
Use your library's dummy or file printer to capture the bytes, then compare them with a stored expected file. For visual checks, run a containerised virtual printer such as escpos-netprinter.
Do emulators support images and QR codes?
The better ones do: escpresso, for example, lists ESC *, GS v 0 and GS ( k. Always confirm on a real printer too.
Sources
- escpresso on GitHub
- ESC/POS Virtual Printer Emulator on GitHub
- escpos-netprinter on GitHub
- RawBT virtual POS printer documentation on GitHub
- ReceiptLine on GitHub