ExplainedThe language of receipts
A receipt is
a conversation.
An office printer is handed a finished page. A receipt printer is handed a conversation.
An office printer is handed a finished page. A receipt printer is handed a conversation: initialise yourself, centre this, print that in bold, now this barcode, now feed, now cut, now open the drawer.
The language that conversation happens in is called ESC/POS, and it is the reason a till and a printer from two different companies work together at all.
What it actually is
ESC/POS is a command set — a small vocabulary of byte sequences that a receipt printer understands. It was defined for point-of-sale printers decades ago, every serious manufacturer implements it, and it has outlived almost everything else from that era because it is small, fast and good enough.
Each command starts with a control character, usually ESC (hex 1B) or GS (hex 1D), followed by a letter and sometimes a value. Everything that is not a command is simply printed as text, in order, as it arrives.
That is the whole design, and it explains the thing people find strange about receipt printers: there is no page. The paper advances as the characters arrive, which is why a receipt can be any length and why it appears line by line rather than all at once.
Eight words of the vocabulary
Enough of the language to read a receipt stream over somebody's shoulder.
ESC @1B 40Initialise. Forget every setting from the last receipt and start clean. Nearly every receipt begins here.ESC a n1B 61 nAlign: left, centre or right. The shop logo and the thank-you line are usually the only centred parts.ESC E n1B 45 nBold on or off. Totals, and little else, if the receipt is well designed.GS ! n1D 21 nCharacter size: double height, double width, or both. How a total ends up twice the size of the items.GS k1D 6BPrint a barcode. The printer draws it itself from the digits, which is why it is crisp rather than a picture.ESC d n1B 64 nFeed n lines. The blank space before the cut, so the tear-off does not slice the last line.GS V m1D 56 mCut the paper, fully or partially. A partial cut leaves a small tab so the receipt does not drop on the floor.ESC p1B 70Send a pulse to the cash drawer port. This is the command that opens the till.
Why the drawer opens from the printer
Newcomers always ask why the cash drawer plugs into the printer and not into the computer. ESC/POS is the answer: the drawer is opened by a command inside the receipt stream, at exactly the moment the receipt is printed. One instruction, one wire, perfect timing, and nothing for the computer to get wrong.
It also means a drawer that will not open is usually a software setting rather than a broken drawer — the command simply is not being sent.
The full story, including the voltage and the pulse, is in the drawer the printer opens.
There is no page in a receipt printer. There is a stream of instructions, and paper that moves while they arrive.
Why it matters when you are buying
Because it is what compatibility actually means. When POS software says it supports thermal receipt printers, what it almost always means is that it speaks ESC/POS. A printer that speaks the same language works with it — not after a driver hunt or a plug-in, but because they already agree on what the bytes mean.
20 BlackCopper receipt printers publish ESC/POS as their command set, which is why they drop into existing tills rather than requiring the till to be rebuilt around them.
It is also what protects you later. Change your POS software in three years and the printers stay, because the new software speaks the same language the old one did.
Driver, or straight down the wire?
There are two ways software gets ESC/POS to a printer, and knowing which yours uses saves an afternoon when something goes wrong.
Through the driver
The software prints the way any Windows or Mac program prints, and the driver turns the result into ESC/POS. Everything appears in the print queue, which is convenient: you can pause it, cancel it, and see it stuck.
Raw, to the port
The software builds the ESC/POS itself and sends it straight to the USB, serial or network port. Faster and more precise — and invisible to the print queue, so when nothing comes out there is nothing to look at.
If your receipts never appear in the Windows queue even when they fail, your software is sending raw. Test with the printer's self-test rather than a Windows test page.
The code page, which is where accents go wrong
ESC/POS printers do not use Unicode. They hold a set of code pages — small tables of 256 characters each — and a command selects which one is active. Send text in one encoding while the printer is set to another, and the letters are all printed correctly according to the wrong table.
That is the entire explanation for receipts where every accented character is a different odd symbol, and the cure is one setting rather than a new printer: match the code page the software sends to the one the printer is set to.
Old, small, and still the standard
ESC/POS is not elegant and it was not designed for anything you are doing today. It is, however, the agreement that lets any till print to any receipt printer — and an agreement everybody keeps is worth more than a better idea nobody implements.
Receipt printers Cash drawers Next: The till that stays up All Journal posts
