Thermalink

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.

ASCIIGS B n
Hex1D 42 n
Decimal29 66 n

Parameters

n1 = 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
CommandWhat it doesBytes
ESC aAlign center1B 61 01
GS !Character size 2× wide, 2× high1D 21 11
GS BWhite on black on1D 42 01
Text" PAID "20 50 41 49 44 20
GS BWhite on black off1D 42 00
GS !Character size 1× wide, 1× high1D 21 00
Text"Order 1042"4F 72 64 65 72 20 31 30 34 32
ESC aAlign left1B 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 00

Python (raw bytes)

data += b"\x1d\x42\x01" + b" PAID \n" + b"\x1d\x42\x00"

Common mistakes

Related commands

Sources

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).