Thermalink

ESC/POS command reference › ESC @

ESC @ (1B 40): initialize the printer

Two bytes, 1B 40, that put the printer back to its power-on text settings. Send them at the start of every job so styles left over from the last receipt do not leak into this one.

ASCIIESC @
Hex1B 40
Decimal27 64

Parameters

No parameters.

What it does

It resets the settings that live in the printer's working memory: bold, underline, character size, white-on-black, alignment, line spacing, left margin and print width, tab stops and the selected code page. Thermalink sends it as the first two bytes of every job.

python-escpos describes it as "Clear data in buffer and reset modes". The buffer part matters: text you sent without a line feed after it has not been printed yet, and ESC @ discards it. The viewer warns when that happens.

It does not touch settings stored in the printer's non-volatile memory (memory switches, DIP switches, default code page). My BIXOLON SRP-352plusIII has its double-byte (Chinese) mode switched on in its memory switches, and ESC @ at the start of the job did not turn it off: every byte above 0x80 still printed as a Chinese character.

Example

Bold is on, one line prints, then ESC @ resets it.

1B 45 01 42 6F 6C 64 20 6C 65 66 74 20 6F 76 65 72 0A 1B 40 41 66 74 65 72 20 45 53 43 20 40 3A 20 6E 6F 72 6D 61 6C 0A

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 EBold on1B 45 01
Text"Bold left over"42 6F 6C 64 20 6C 65 66 74 20 6F 76 65 72
ESC @Initialize printer: styles, alignment, code page and margins reset1B 40
Text"After ESC @: normal"41 66 74 65 72 20 45 53 43 20 40 3A 20 6E 6F 72 6D 61 6C

Sending it from code

JavaScript (bytes)

const init = new Uint8Array([0x1b, 0x40]);

PHP with escpos-php

$printer->initialize(); // writes 1B 40

Python (raw bytes)

data = b"\x1b\x40" + data

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