Select your printer model

Parameters are refined by the selected printer.
  • EU-m30
  • TM-J2000
  • TM-J2100
  • TM-L90
  • TM-L90 LFC
  • TM-L100
  • TM-m10
  • TM-m30
  • TM-m30II
  • TM-m30II-H
  • TM-m30III
  • TM-m30III-H
  • TM-m30II-NT
  • TM-m30II-S
  • TM-m30II-SL
  • TM-m50
  • TM-m50II
  • TM-m50II-H
  • TM-P20
  • TM-P20II
  • TM-P60
  • TM-P60II
  • TM-P80
  • TM-P80II
  • TM-T20
  • TM-T20II
  • TM-T20III
  • TM-T20IIIL
  • TM-T20X
  • TM-T70
  • TM-T70II
  • TM-T81III
  • TM-T82II
  • TM-T82III
  • TM-T82IIIL
  • TM-T82X
  • TM-T83III
  • TM-T88IV
  • TM-T88V
  • TM-T88VI
  • TM-T88VII
  • TM-T90
  • TM-T100
  • TM-U220
  • TM-U220II
  • TM-U230

GS k


[Name]

Print barcode

[Format]

<Function A>
ASCII
   
GS
  
k
  
m
  
d1 ... dk
  
NUL
Hex
1D
6B
m
d1 ... dk
NUL
Decimal
29
107
m
d1 ... dk
NUL
<Function B>
ASCII
   
GS
  
k
  
m
  
n
  
d1 ... dn
Hex
1D
6B
m
n
d1 ... dn
Decimal
29
107
m
n
d1 ... dn

[Range]

m: different depending on the printers
d, k of (A), and d, n of (B): different depending on the barcode format. Refer to the tables in the following [Description].

[Default]

None

[Description]

Prints the barcode using the barcode system specified by m.
<Function A>
m
Barcode system
Barcode data ("SP" in the table indicates space.)
Number of bytes
The range of k
Characters (ASCII)
Data ( d )
0
UPC-A
Fixed
k = 11, 12
0 – 9
d = 48 – 57
1
UPC-E
Fixed
k = 6 – 8, 11, 12
0 – 9
d = 48 – 57
(However, d1 = 48 when k = 7, 8, 11, 12)
2
JAN13 (EAN13)
Fixed
k = 12, 13
0 – 9
d = 48 – 57
3
JAN8 (EAN8)
Fixed
k = 7, 8
0 – 9
d = 48 – 57
4
CODE39
Can be changed
1 ≤ k
0 – 9, A – Z, SP, $, %, *, +, -, ., /
d = 48 – 57, 65 – 90, 32, 36, 37, 42, 43, 45, 46, 47
5
ITF (Interleaved 2 of 5)
Can be changed
2 ≤ k
(even number)
0 – 9
d = 48 – 57
6
CODABAR (NW-7)
Can be changed
2 ≤ k
0 – 9, A – D, a – d, $, +, −, ., /, :
d = 48 – 57, 65 – 68, 97 – 100, 36, 43, 45, 46, 47, 58
(However, d1 = 65 – 68, dk = 65 – 68, d1 = 97 – 100, dk = 97 – 100)
  • k indicates the number of bytes of barcode data. k is an explanation parameter; therefore it does not need to be transmitted.
  • d specifies the character code data of the barcode data to be printed.
<Function B>
m
Barcode system
Barcode data ("SP" in the table indicates space.)
Number of bytes
The range of n
Characters (ASCII)
Data ( d )
65
UPC-A
Fixed
n = 11, 12
0 – 9
d = 48 – 57
66
UPC-E
Fixed
n = 6 – 8, 11, 12
0 – 9
d = 48 – 57
(However, d1 = 48 when n = 7, 8, 11, 12)
67
JAN13 (EAN13)
Fixed
n = 12, 13
0 – 9
d = 48 – 57
68
JAN8 (EAN8)
Fixed
n = 7, 8
0 – 9
d = 48 – 57
69
CODE39
Can be changed
n = 1 – 255
0 – 9, A – Z, SP, $, %, *, +, -, ., /
d = 48 – 57, 65 – 90, 32, 36, 37, 42, 43, 45, 46, 47
70
ITF (Interleaved 2 of 5)
Can be changed
n = 2 – 254
(even number)
0 – 9
d = 48 – 57
71
CODABAR (NW-7)
Can be changed
n = 2 – 255
0 – 9, A – D, a – d, $, +, −, ., /, :
d = 48 – 57, 65 – 68, 97 – 100, 36, 43, 45, 46, 47, 58
(However, d1 = 65 – 68, dn = 65 – 68, d1 = 97 – 100, dn = 97 – 100)
72
CODE93
Can be changed
n = 1 – 255
00h – 7Fh
d = 0 – 127
73
CODE128
Can be changed
n = 2 – 255
00h – 7Fh
d = 0 – 127
(However d1 = 123, d2 = 65 – 67)
74
GS1-128
Can be changed
n = 2 – 255
NUL – SP(7Fh)
d = 0 – 127
75
GS1 DataBar Omnidirectional
Can be changed
n = 13
0 – 9
d = 48 – 57
76
GS1 DataBar Truncated
Can be changed
n = 13
0 – 9
d = 48 – 57
77
GS1 DataBar Limited
Can be changed
n = 13
0 – 9
d = 48 – 57
(However d1 = 48, 49)
78
GS1 DataBar Expanded
Can be changed
n = 2 – 255
0 – 9, A – D, a – d, SP, !, ", %, $, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, _, {
d = 32 – 34, 37 – 63, 65 – 90, 95, 97 – 122, 123
(However d1 = 40, d2 = 48 – 57, d3 = 48 – 57 or d1 = 48 – 57, d2 = 48 – 57)
79
Code128 auto
Can be changed
n =1 – 255
FF
d = 0 – 255
  • n specifies the number of bytes of barcode data.
  • d specifies the character code data of the barcode data to be printed.

[Notes]

  • When Standard mode is selected, this command is enabled only when the print position is at the head of a line or when no data exists in the print buffer.
  • when Page mode is selected, this command develops the barcode data in the print buffer but the printer does not print the barcode data.
  • The barcode width that exceeds the print area cannot be specified.
  • This command feeds as much paper as is required to print the barcode, regardless of the line spacing specified by line space setting commands.
  • The barcode is not affected by print mode (emphasized, underline, or 90° clockwise-rotated), except for upside-down print mode.
  • After barcode printing, the print postion is moved to left side of the printable area. Also, the printer is in the status "Beginning of the line".
  • The values of m from 0 – 6 in (A) and from 65 – 78 in (B) select the same barcode system, respectively. The printing results are the same.
  • This command specifies m = 0 – 6 and ends with a NUL code.
  • When an odd number of data is processed for ITF barcode system ( m = 5), the printer ignores the last received data.
  • The printer processes n bytes from the next data as barcode data by this command specifying m = 65 – 78.
  • Print area does not include quiet zone (left/right margin) of barcode. Make sure to secure the quiet zone, using this command.
  • Ladder barcode (barcode rotated by 90 degrees in Page mode) is printed with appropriate printing speed regardless of the printer's maximum printing speed or the setting of GS ( K   <Function 48> .

[Notes for UPC-A (m = 0, 65) process]

  • Modular check character (1 character) is processed as follows:
    • Automatically added when processing data is 11 byte.
    • The 12th byte data is processed as a modular check character when processing data is 12 byte. In this case, modular check character is not checked.
  • Left guard bar/center bar/right guard bar are added automatically.

[Notes for UPC-E (m = 1, 66) process]

  • Some models do not support settings of 6, 7, or 8 bytes for the amounts of data to process.
  • If the amount of data to process is 6 bytes, the number system character (NSC) 0 is added automatically.
  • If the amount of data to process is any of (7, 8, 11, 12 bytes), the first data (d1) is processed as number system character (NSC) so 0 must be specified.
  • Modular check character (1 character) is processed as follows:
    • If the amount of data to process is any of (6, 7, 11 bytes), it is added automatically.
    • If the amount of data to process is 8 bytes, the 8th byte data is processed as a modular check character. However, the modular check character is not checked.
    • The 12th byte data is processed as a modular check character when processing data is 12 byte. In this case, modular check character is not checked.
    • Modular check characters are data to decide the bar pattern; they are not printing data.
  • Prints a 6-column short code that except NSC and modular check characters.
  • If the amount of data to process is 6, 7, or 8 bytes, the shortened 6-digit code specified by (d1 ... dk) is printed.
  • If the amount of data to process is either of (11, 12 bytes), a shortened 6-digit code generated from the (d2 ... d11) data in accordance with the table below is printed.
  • Data of transmitted by host PC
    Printing data
    d2
    d3
    d4
    d5
    d6
    d7
    d8
    d9
    d10
    d11
    D1
    D2
    D3
    D4
    D5
    D6
    0 – 9
    0 – 9
    0
    0
    0
    0 – 9
    0 – 9
    0 – 9
    d2
    d3
    d9
    d10
    d11
    0
    0 – 9
    0 – 9
    1
    0
    0
    0 – 9
    0 – 9
    0 – 9
    d2
    d3
    d9
    d10
    d11
    1
    0 – 9
    0 – 9
    2
    0
    0
    0 – 9
    0 – 9
    0 – 9
    d2
    d3
    d9
    d10
    d11
    2
    0 – 9
    0 – 9
    3 – 9
    0
    0
    0 – 9
    0 – 9
    d2
    d3
    d4
    d10
    d11
    3
    0 – 9
    0 – 9
    0 – 9
    1 – 9
    0
    0 – 9
    d2
    d3
    d4
    d5
    d11
    4
    0 – 9
    0 – 9
    0 – 9
    0 – 9
    1 – 9
    5 – 9
    d2
    d3
    d4
    d5
    d6
    d11
  • Specify 0 at indicated data by "−" in the table.
    When d6 = 1 – 9, be sure to specify (d11 = 5 – 9).
  • Left guard bar/right guard bar are added automatically.

[Notes for JAN13/EAN13 (m = 2, 67) process]

  • Modular check character (1 character) is processed as follows:
    • Automatically added when processing data is 12 byte.
    • The 13th byte data is processed as a modular check character when processing data is 13 byte. In this case, modular check character is not checked.
  • Left guard bar/center bar/right guard bar are added automatically.

[Notes for JAN8/EAN8 (m = 3, 68) process]

  • Modular check character (1 character) is processed as follows:
    • Automatically added when processing data is 7 byte.
    • The 8th byte data is processed as a modular check character when processing data is 8 byte. In this case, modular check character is not checked.
  • Left guard bar/center bar/right guard bar are added automatically.

[Notes for CODE39 (m = 4, 69) process]

  • The printer processes the start character (ASCII = */Hex = 2Ah/Decimal = 42) as follows:
    • When the first barcode (d1) is "*", the printer processes the data as a first character.
    • If the first barcode (d1) is not "*", the printer adds a start character (*) automatically.
  • The printer processes the stop character (ASCII = */Hex = 2Ah/Decimal = 42) as follows:
    • When the last barcode (dk or dn) is "*", the printer processes the data as a last character.
    • If the last barcode (dk or dn) is not "*", the printer adds a last character (*) automatically.
    • When "*" is processed during barcode data processing, the printer processes "*" as a stop character. The printer prints data preceding "*" and finishes command processing. Therefore, data following "*" are processed as normal data.
  • Check digits are not calculated and added.

[Notes for ITF (Interleaved 2 of 5) (m = 5, 70) process]

  • Start code and stop code are added automatically.
  • Check digits are not calculated and added.

[Notes for CODABAR (NW-7) (m = 6, 71) process]

  • Start character and stop character are not added automatically. Transmit data including the codes.
    • Specify the start character (ASCII = "A"–"D", "a"–"d" / Hex = 41h–44h, 61h–64h / Decimal = 65–68, 97–100) at beginning of the data (d1).
    • Specify the stop character (ASCII = "A"–"D", "a"–"d" / Hex = 41h–44h, 61h–64h / Decimal = 65–68, 97–100) at end of the data (dk or dn).
    • Start character or stop character (ASCII = "A"–"D", "a"–"d" / Hex = 41h–44h, 61h–64h / Decimal = 65–68, 97–100) cannot be specified in barcode data.
    • The character (ASCII = "a"–"d" / Hex = 61h–64h / Decimal = 97–100) is supported by some printer models.
  • Check digits are not calculated and added.

[Notes for CODE93 (m = 72) process]

  • Start character and stop character are added automatically.
  • Check digits (2 character) are calculated and added automatically.
  • When HRI characters are designated to be added, special character HRI characters are processed as follows.
    • The printer prints an HRI character "□" as start and stop character.
    • The printer prints HRI characters "■ + an alphabetic character" as control characters (not printable characters).

[Notes for CODE128 (m = 73) process]

  • The first two-byte (d1, d2) start character must be code set selection character (any of CODE A, CODE B, or CODE C) which selects the first code set.
  • Check digit (1 character) is calculated and added automatically.
  • Special character HRI is processed as follows:
    • The printer does not print HRI characters that correspond to the shift character or code set selection character (CODE A, CODE B, or CODE C).
    • HRI characters of the function characters (FNC1, FNC2, FNC3, or FNC4) and control characters (in Hexadecimal: 00h – 1Fh, 7Fh / in Decimal 0 – 31, 127) are printed as spaces.
  • The range of data (d) that can be processed in each code set (CODE A, CODE B, CODE C) is shown in the table below. Data where the character field is blank cannot be used. Transmit the 2-byte data shown in the following table ([Hex = 7Bh / Decimal = 123] + character code) from the host for the special characters and barcode data "{".
  • Graphic

[Description: Applied to GS1-128 (m = 74)]

  • GS1-128 processes the following structures.
  • (a) Basic structure
  • Start character
    FNC1
    AI
    Data part
    Check digit A
    Check digit B
    Stop character
    Automatically added
    ( d1 ... dn )
    Automatically added
  • (b) Concatenated code structure
  • Start character
    FNC1
    AI
    Data part
    Check digit A
    FNC1
    AI
    Data part
    Check digit A
    Check digit B
    Stop character
    Automatically added
    ( d1 ... dn )
    Automatically added
  • Transmit the data relevant to check digit A along with the application identifier (AI), from the host.
  • The start character number system character (CODE A, CODE B, CODE C), FNC1, check digit B (1 character), and stop character are added automatically.
  • The 4 special characters (SP, "(", ")", "*") are processed as shown in the table below.
  • Special characters
    Character
    Hex
    Decimal
    Processing
    SP
    20
    32
    After d1, the first SP is processed as AI and the data part delimiter, and a space is inserted for the HRI characters. Spaces are inserted for the HRI characters for subsequent SP.
    In any case, SP does not constitute encoded data.
    (
    28
    40
    "(" is inserted for the HRI character. It can be used when you want the HRI characters that indicate AI to look nice when used with the pair of ")".
    "(" does not constitute encoded data.
    )
    29
    41
    After d1, the first ")" is processed as AI and the data part delimiter, and ")" is inserted for the HRI characters. ")" are inserted for the HRI characters for subsequent ")".
    In any case, ")" does not constitute encoded data.
    *
    2A
    42
    Check digit A (1 character), calculated with modulus 10, is added as the data part at the position of "*". "*" is not an HRI character, but check digits are inserted for HRI characters.
  • Examples of barcode data using special characters (SP, "(", ")", "*") are shown below.
  • Example:
    When [AI = 01/data = 9501234567890/Specify to add check digit A/enclose AI in ()] GS k 74 18 "(01)9501234567890*"
    When HRI characters are designated to be added, the HRI characters are [(01)95012345678903].
    Example:
    When [AI = 01/data = 9501234567890/Specify to add check digit A/enclose AI in (), and insert a space between the data] GS k 74 18 "(01)9501234567890*"
    When HRI characters are designated to be added, the HRI characters are [(01)95012345678903].
    Example:
    When linking [AI = 01/data = 9501234567890/Specify to add check digit A/enclose AI in ()] and [AI = 3102/data = 000400/enclose AI in ()], and separating the HRI characters between the link with a space
    GS k 74 33 "(01)9501234567890* {1(3102)000400"
    When HRI characters are designated to be added, the HRI characters are [(01)95012345678903 (3102)000400].
  • When HRI characters are designated to be added, (d1 ... dn) is printed as HRI characters. Automatically added data is not treated as HRI characters. The HRI characters of special characters are processed as follows. ("SP" indicates a space)
    • The HRI character of the start character (CODE A, CODE B, CODE C) is not printed.
    • The HRI characters of the function characters (FNC1, FNC3) and the control characters (Hex = 00h–1Fh, 7Fh / Decimal = 0–31, 127) are printed as spaces.
    • The HRI characters of special characters (SP, "(", ")") are printed as the respective characters (SP, "(", ")").
    • The HRI character of special character ("*") prints a check digit.
    • The HRI characters of barcode data ["{"+("(", ")", "*", "{")] are printed as the respective characters ("(", ")", "*", "{")
  • The range of data (d) that can be processed in each code set (CODE A, CODE B, CODE C) is shown in the table below. Data where the character field is blank cannot be used. Transmit the 2-byte data shown in the following table ([Hex = 7Bh / Decimal = 123] + character code) from the host for the special characters (FNC1, FNC3) and barcode data "(", ")", "*", and "{",.
  • Graphic

[Description: Applied to GS1 DataBar Omnidirectional (m = 75)]

  • Transmit the 13-digit product identification number, excluding the application identifier (AI) and check digit, from the host.
  • Adds the application identifier (AI) automatically. The AI is "01".
  • Adds the check digit (1 character) automatically.
  • Adds the guard pattern and finder pattern automatically.
  • Prints the 18 characters of ["(01)", (d1...d13), check digit] as HRI characters when HRI characters are designated to be added.
  • An example of barcode data is shown below.
  • When printing a barcode with the product identification number [2001234567890].
  • GS k 75 13 "2001234567890"
  • When HRI characters are designated to be added, the HRI characters are [(01)20012345678909].
  • When the barcode height set with GS h is smaller than [33 times the module width], a barcode with a height (excluding the HRI characters) of [module width × 33] is printed, without reference to the GS h setting.

[Description: Applied to GS1 DataBar Omnidirectional (m = 76)]

  • Transmit the 13-digit product identification number, excluding the application identifier (AI) and check digit, from the host.
  • Adds the application identifier (AI) automatically. The AI is "01".
  • Adds the check digit (1 character) automatically.
  • Adds the guard pattern and finder pattern automatically.
  • Prints the 18 characters of ["(01)", (d1...d13), check digit] as HRI characters when HRI characters are designated to be added.
  • An example of barcode data is shown below.
  • When printing a barcode with the product identification number [0001234567890].
  • GS k 76 13 "0001234567890"
  • When HRI characters are designated to be added, the HRI characters are [(01)00012345678909].
  • When the barcode height set with GS h is smaller than [13 times the module width], a barcode with a height (excluding the HRI characters) of [module width × 13] is printed, without reference to the GS h setting.

[Description: Applied to GS1 DataBar Limited (m = 77)]

  • Transmit the 13-digit product identification number, excluding the application identifier (AI) and check digit, from the host.
  • Adds the application identifier (AI) automatically. The AI is "01".
  • Adds the check digit (1 character) automatically.
  • Adds the guard pattern and finder pattern automatically.
  • Prints the 18 characters of ["(01)", (d1...d13), check digit] as HRI characters when HRI characters are designated to be added.
  • An example of barcode data is shown below.
  • When printing a barcode with the product identification number [1501234567890].
  • GS k 77 13 "1501234567890"
  • When HRI characters are designated to be added, the HRI characters are [(01)15012345678907].
  • When the barcode height set with GS h is smaller than [10 times the module width], a barcode with a height (excluding the HRI characters) of [module width × 10] is printed, without reference to the GS h setting.

[Description: Applied to GS1 DataBar Expanded (m = 78)]

  • Transmit the 2-byte data shown in the following table ([Hex = 7Bh / Decimal = 123] + character code) from the host for the special character (FNC1) and symbol data "(", ")". ("+" in the table is not included in the transmission data)
  •  
    Transmit data from the host
    Data
    ASCII
    Decimal
    Hex
    FNC1
    { + 1
    7B + 31
    123 + 49
    (
    { + (
    7B + 28
    123 + 40
    )
    { + )
    7B + 29
    123 + 41
  • The special characters ("(", ")") are processed as shown in the table below.
  • Special characters
    Character
    Hex
    Decimal
    Processing
    (
    28
    40
    "(" is inserted for the HRI character. It can be used when you want the HRI characters that indicate AI to look nice when used with the pair of ")".
    "(" does not constitute encoded data.
    )
    29
    41
    ")" is inserted for the HRI character. It can be used when you want the HRI characters that indicate AI to look nice when used with the pair of "(".
    ")" does not constitute encode data.
  • Adds the guard pattern and finder pattern automatically.
  • When HRI characters are designated to be added, special character HRI characters are processed as follows.
    • The HRI character of function character (FNC1) is not printed.
    • The HRI characters of special characters ("(", ")") are printed as the respective characters ("(", ")").
    • The HRI characters of barcode data ["{" + ("(", ")")] are printed as the respective characters ("(", ")").
  • When the barcode height set with GS h is smaller than [34 times the module width], a barcode with a height (excluding the HRI characters) of [module width × 34] is printed, without reference to the GS h setting.)
 

Quick Access

  • [Name]
  • [Format]
  • [Range]
  • [Description]
  • [Notes]

ESC/POS® includes patented or patent pending commands. The contents must not be disclosed to third parties.


ESC/POS® Command Reference for TM Printers

Jump to the top