ESC/POS command reference › GS B
GS B (1D 42): white on black (reverse) text
1D 42 01 prints white characters on black; 1D 42 00 turns it off. Good for a "PAID" or order-number banner.
| ASCII | GS B n |
| Hex | 1D 42 n |
| Decimal | 29 66 n |
Parameters
n | 1 = reverse on, 0 = off. The viewer reads only the lowest bit. |
What it does
Each character cell is printed black and the character is left white. Combined with GS ! it makes a large, readable banner.
escpos-php calls it setReverseColors(); python-escpos uses the same bytes for invert=True. Thermalink uses it for inverted rows on the BIXOLON.
Example
A centered double-size reverse banner.
1B 61 01 1D 21 11 1D 42 01 20 50 41 49 44 20 0A 1D 42 00 1D 21 00 4F 72 64 65 72 20 31 30 34 32 0A 1B 61 00
Preview drawn in your browser by the ESC/POS viewer's engine on 80 mm paper. Letters use a similar monospace font, not the printer's own. Open this example in the viewer to edit the bytes.
How the viewer decodes these bytes
| Command | What it does | Bytes |
|---|---|---|
| ESC a | Align center | 1B 61 01 |
| GS ! | Character size 2× wide, 2× high | 1D 21 11 |
| GS B | White on black on | 1D 42 01 |
| Text | " PAID " | 20 50 41 49 44 20 |
| GS B | White on black off | 1D 42 00 |
| GS ! | Character size 1× wide, 1× high | 1D 21 00 |
| Text | "Order 1042" | 4F 72 64 65 72 20 31 30 34 32 |
| ESC a | Align left | 1B 61 00 |
Sending it from code
JavaScript (bytes)
const reverseOn = [0x1d, 0x42, 1], reverseOff = [0x1d, 0x42, 0];PHP with escpos-php
$printer->setReverseColors(true); // 1D 42 01
$printer->setReverseColors(false); // 1D 42 00Python (raw bytes)
data += b"\x1d\x42\x01" + b" PAID \n" + b"\x1d\x42\x00"
Common mistakes
- No spaces around the word, so the black block ends right at the first and last letter. Add a space each side.
- Leaving it on: every following line prints as a black bar.
Related commands
GS !: double width and height text, up to 8xESC E: bold text on a receipt printerESC a: center or right-align text on a receipt printer
Sources
- escpos-php,
Printer.php(MIT licence) - python-escpos,
constants.py(MIT licence) - Thermalink agent output, printed on a BIXOLON SRP-352plusIII (Windows 11, USB)
I wrote this page from the open-source libraries above, Thermalink's own output and tests on my BIXOLON printer. It is not copied from Epson's manual. For model-specific details see Epson's official ESC/POS reference or your printer maker's manual. Last checked 22 November 2026.
Building receipts byte by byte? Thermalink lets a web app send the receipt as JSON and prints it silently, with QR codes, logos, cut and cash drawer ($49 one-time).