ESC/POS command reference › ESC d
ESC d (1B 64) and LF (0A): print and feed paper
Nothing prints until the printer gets a line feed. 0A prints and feeds one line, 1B 64 n prints and feeds n lines.
| ASCII | ESC d n |
| Hex | 1B 64 n |
| Decimal | 27 100 n |
Parameters
n | number of lines to feed, 0 to 255. Line height is the current line spacing (see ESC 3). |
What it does
Characters wait in a line buffer. LF, ESC d and ESC J print what is in it and move the paper. A job that ends without one of them can leave its last line unprinted.
escpos-php's feed($lines) writes a plain LF for one line and ESC d n for more, with n from 1 to 255. ESC J n feeds by n dots (motion units) instead of lines, for fine spacing.
Thermalink sends ESC d 3 before every cut, so the cutter clears the last printed line.
Example
ESC d 3 prints "Line two" and feeds two more blank lines.
4C 69 6E 65 20 6F 6E 65 0A 4C 69 6E 65 20 74 77 6F 1B 64 03 41 66 74 65 72 20 33 20 6C 69 6E 65 73 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
| Command | What it does | Bytes |
|---|---|---|
| Text | "Line one" | 4C 69 6E 65 20 6F 6E 65 |
| Text | "Line two" | 4C 69 6E 65 20 74 77 6F |
| ESC d | Print and feed 3 lines | 1B 64 03 |
| Text | "After 3 lines" | 41 66 74 65 72 20 33 20 6C 69 6E 65 73 |
Sending it from code
JavaScript (bytes)
const feed = (n) => (n === 1 ? [0x0a] : [0x1b, 0x64, n]);PHP with escpos-php
$printer->feed(3); // 1B 64 03Python (raw bytes)
data += b"\x1b\x64\x03" # print and feed 3 lines
Common mistakes
- Ending the job with text and no line feed: the last line can stay in the buffer.
- Cutting straight after the last line. The cutter sits a little past the print head, so feed a few lines first or use
GS V 65 n.
Related commands
Sources
- escpos-php,
Printer.php(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).