GS1 DataMatrix generator with a guided form

Fill in GTIN, batch, expiry and serial. We check the syntax, add the hidden GS1 characters for you, and decode the result to prove it.

Enter the data

Fill in the fields you need. Empty fields are left out. We add the hidden GS1 characters for you.

Your 8, 12 (UPC), 13 (EAN) or 14-digit product number, check digit included. GS1 DataMatrix always holds 14 digits, so shorter numbers get zeros in front.

Up to 20 characters: letters, digits and - . / _ and a few other symbols. No spaces.

The use-by or expiry date. Encoded as YYMMDD.

Up to 20 characters, unique for each item with this GTIN. No spaces.

Example
(01)09506000134352(17)271231(10)L26-018(21)SN000123

22 × 22 squares (modules)

Each small square is one module. The white frame is the blank border (quiet zone): 2 squares wide. Keep it clear when you place the code.

22 × 22 modules11 mm wide · 13 mm with the blank border

Example. Fill in the form to make your code.

We check syntax, not ownership. What we check

An image for documents, web pages and most label software.

What the code holds

Example
  1. Start character FNC1
  2. AI 01
  3. value 09506000134352
  4. AI 17
  5. value 271231
  6. AI 10
  7. value L26-018
  8. Separator GS
  9. AI 21
  10. value SN000123

FNC1 marks the code as GS1. GS ends a field whose length varies, unless it is last. The brackets you see in the readable text are not encoded.

A scanner sends]d201095060001343521727123110L26-018<GS>21SN000123

Fields in the code, in encoded order
AIFieldValue
(01)Product number (GTIN)09506000134352
(17)Expiry date27123131 Dec 2027
(10)Batch or lot numberL26-018
(21)Serial numberSN000123
Shape, size, print size and colorsSquare · automatic size · 0.5 mm squares

GS1 DataMatrix uses the 24 square and 6 rectangular ECC 200 sizes. Square is the usual choice; check your trading partner’s rules before using a rectangle. DMRE sizes (ISO/IEC 21471) are not part of the GS1 General Specifications, so they are not offered here.

Shape and size
Shape

Automatic picked 22 × 22, the smallest size that fits.

Print size
Set the size by
millimeters

Code 11 mm × 11 mm, or 13 mm × 13 mm with the blank border.

No rounding. Laser and inkjet printers print the exact size.

Advanced: blank border, colors
Blank border (quiet zone)

Scanners need clear space around the code. The standard minimum is 1 square; we use 2 by default. Never less than 1.

Colors

Contrast 21 : 1. Dark squares on a light background scan best.

What the GS1 generator does

  • Guided fields

    GTIN, batch, expiry and serial first, with plain names for every other field.

  • Syntax checks

    Check digits, dates, lengths and field pairs from the GS1 dictionary.

  • Hidden characters added

    The FNC1 start and the separators go in for you. The brackets stay out.

  • Read back field by field

    Each code is decoded again and compared with what you entered.

How it works

How to make a GS1 DataMatrix in 3 steps

Everything happens in your browser. What you type is never uploaded.

  1. Step 1: Fill in the fields

    Type your GTIN, batch or lot, pick the expiry date and add a serial. Add more fields, or paste (01)… text, if you need to.

  2. Step 2: Fix anything marked

    Each problem is shown under its field and says what to change. The preview updates as you type.

  3. Step 3: Download and print

    PNG, SVG or a true-size PDF, with or without the readable text. Print at 100% / Actual size and test a scan.

The format

What a GS1 DataMatrix is

A GS1 DataMatrix is an ordinary Data Matrix ECC 200 code with two extra rules. It starts with a special character, FNC1, that tells the scanner “this is GS1 data”. And the data is a chain of GS1 fields, each one an Application Identifier (AI, a 2 to 4-digit number) followed by its value: (01) for the product number (GTIN), (17) for the expiry date, (10) for the batch or lot, (21) for the serial number.

Fields with a fixed length, like the 14-digit GTIN or a 6-digit date, simply end. A field whose length varies, like a batch, needs a separator after it unless it comes last. Scanners pass that separator on as the GS character (ASCII 29). The brackets in the printed text, such as (01), are only for people and are never encoded.

It is used on medicine packs and medical device labels (UDI), and increasingly in retail: GS1 US’s Sunrise 2027 initiative aims for store checkouts to read 2D codes such as GS1 DataMatrix by the end of 2027. Read GS1 DataMatrix explained with examples for a field-by-field walk-through.

Plain Data Matrix

  • Holds exactly the text you type.
  • No FNC1, no fields: your own system decides what it means.
  • Typing “(01)…” encodes the brackets as text.

GS1 DataMatrix

  • Starts with FNC1.
  • Holds numbered GS1 fields any GS1 scanner can split.
  • Separators between fields; brackets only in the readable text.

Supported fields

Supported Application Identifiers

The form offers these 32 fields. Each one is covered by our tests: syntax, field pairs, and encoding with an independent decode. In text mode, 539 of the 541 AIs in the GS1 Barcode Syntax Dictionary (release 2026-01-27) are checked; only the North American coupon AIs (8110) and (8112) are not supported yet.

The four fields the form shows first
AI Field Format Separator after it Example
(01) Product number (GTIN) N14 14 digits with check digit No (01)09506000134352
(10) Batch or lot number Needs (01), (02) or another X..20 up to 20 characters Yes, unless last (10)L26-018
(17) Expiry date Needs (01), (02) or another N6 date YYMMDD (day 00 allowed) No (17)271231
(21) Serial number Needs (01), (03) or (8006) X..20 up to 20 characters Yes, unless last (21)SN000123
All 28 other fields in the “Add another field” list
Other GS1 Application Identifiers supported by the guided form, by group
AI Field Format Separator after it Example
Dates
(11) Production date Needs (01), (02) or another N6 date YYMMDD (day 00 allowed) No (11)261015
(13) Packaging date Needs (01), (02) or another N6 date YYMMDD (day 00 allowed) No (13)261016
(15) Best before date Needs (01), (02) or another N6 date YYMMDD (day 00 allowed) No (15)270630
(16) Sell by date Needs (01), (02) or another N6 date YYMMDD (day 00 allowed) No (16)270531
(7003) Expiry date and time Needs (01) or (02) N6+N4 date YYMMDD + time HHMM Yes, unless last (7003)2712312359
Quantities
(30) Count of items Needs (01) or (02) N..8 up to 8 digits Yes, unless last (30)24
(37) Count of trade items inside Needs (00), and (02) or (8026) N..8 up to 8 digits Yes, unless last (37)48
Weights
(310n) Net weight (kg) Needs (01) or (02) N6 6 digits; the last AI digit (0–5) is the number of decimals No (3102)000125
(320n) Net weight (lb) Needs (01) or (02) N6 6 digits; the last AI digit (0–5) is the number of decimals No (3202)000275
(330n) Gross weight (logistics, kg) Needs (00) or (01) N6 6 digits; the last AI digit (0–5) is the number of decimals No (3301)004805
Logistics and SSCC
(00) Shipping container code (SSCC) N18 18 digits with check digit No (00)095060001343520000
(02) GTIN of the items inside Needs (37) N14 14 digits with check digit No (02)09506000134352
(400) Customer purchase order X..30 up to 30 characters Yes, unless last (400)PO-77812
Locations and origin
(410) Ship to (GLN) N13 13 digits with check digit No (410)9506000134369
(414) Location (GLN) N13 13 digits with check digit No (414)9506000134369
(420) Ship-to postal code X..20 up to 20 characters Yes, unless last (420)90210
(422) Country of origin Needs (01), (02) or another N3 3-digit ISO country code Yes, unless last (422)840
Product details
(20) Product variant Needs (01), (02) or another N2 2 digits No (20)01
(22) Consumer product variant Needs (01) X..20 up to 20 characters Yes, unless last (22)RED-M
(240) Additional product ID Needs (01), (02) or another X..30 up to 30 characters Yes, unless last (240)ALT-4471
(241) Customer part number Needs (01), (02) or another X..30 up to 30 characters Yes, unless last (241)CUST-PN-88
(8004) Individual asset ID (GIAI) X..30 up to 30 characters Yes, unless last (8004)9506000134ASSET042
Healthcare (national numbers)
(710) Germany: PZN Needs (01) X..20 up to 20 characters Yes, unless last (710)12345678
(712) Spain: CN Needs (01) X..20 up to 20 characters Yes, unless last (712)654321
(714) Portugal: AIM Needs (01) X..20 up to 20 characters Yes, unless last (714)1234567
(715) USA: NDC Needs (01) X..20 up to 20 characters Yes, unless last (715)0123456789
Internal use
(90) Internal information X..30 up to 30 characters Yes, unless last (90)INFO-1
(91) Company internal 91 X..90 up to 90 characters Yes, unless last (91)BIN-A4

Format in GS1 notation: N = digits, X = letters, digits and some symbols; “..20” means up to 20. “n” in 310n is the number of decimal places. The field names are our plain-English labels; the formats and pairing rules come from the GS1 dictionary.

Honest limits

What we check, and what we can’t

We check

  • Length and allowed characters of every field (no spaces, for example).
  • Check digits of GTINs, SSCCs and GLNs.
  • Dates: real days, months 01 to 12, and day 00 only where GS1 allows it.
  • Field pairs: fields that need a companion, like a batch needing a GTIN, and fields that must not be used together, like (01) and (02).
  • The FNC1 start and separators, placed for you.
  • That the image decodes back to the same fields (“Data decoded successfully”).

We can’t check

  • That a GTIN, GLN or SSCC was issued to your company. GS1 Member Organizations issue them and keep the records.
  • Your trading partners’ or regulators’ rules: which fields, which order, which size.
  • Logistic labels: GS1 requires the SSCC as a GS1-128 barcode. A GS1 DataMatrix can be added, with the same data.
  • The print quality of a real label. That needs a verifier to ISO/IEC 15415.
  • That a printed label scans on your printer, stock and scanner. Print one and test it before a big run.

Medicines and medical devices

This is a symbol generator, not a compliance workflow. Medicine serialization and UDI rules also cover issuing and registering the numbers, label content and print quality. Their dates need a real day: since 1 January 2025 GS1 does not allow day 00 on regulated healthcare products. We are not GS1, we don’t issue GTINs, and the wording you’ll see here is “Supported GS1 fields passed syntax checks”, never “certified”.

Field order

Field order and separators: what we do

The order of GS1 fields doesn’t change what the data means, but it changes how many separators the code needs. GS1 advises putting fields with a predefined length (GTIN, dates, weights) first and variable-length fields (batch, serial) last.

By default we do that for you: the GTIN or SSCC goes first, as GS1 recommends, then the other fields that never need a separator, and the others keep the order you entered. The readable text follows the same order. If a partner asks for a fixed order, untick “Put fields that never need a separator first” and use text mode to type the fields in the order you need.

Recommended order

(01)09506000134352(17)281130(10)B2611A(21)7K3M9P2Q

1 separator · 28 codewords · 22 × 22

Same data, expiry last

(01)09506000134352(10)B2611A(21)7K3M9P2Q(17)281130

2 separators · 29 codewords · 22 × 22

Examples

GS1 DataMatrix examples

Made with this generator from GS1’s example company prefix, so no number belongs to a real product.

  • Medicine pack

    22 × 22 modules · 1 separator

    Product number, expiry, batch and a serial number for each pack: the data medicine pack rules in the EU and US ask for.

    Readable text

    (01)09506000134352(17)281130(10)B2611A(21)7K3M9P2Q

    A scanner sends

    ]d201095060001343521728113010B2611A<GS>217K3M9P2Q

    (01) Product number (GTIN)
    09506000134352
    (17) Expiry date
    281130 · 30 Nov 2028
    (10) Batch or lot number
    B2611A
    (21) Serial number
    7K3M9P2Q
  • Fresh food sold by weight

    20 × 20 modules · no separators

    The product’s normal retail GTIN (its 13-digit EAN with a 0 in front), the net weight in kilograms with 2 decimals (1.25 kg), a best before date and a batch. The weight has its own field, so the GTIN stays the same for every pack.

    Readable text

    (01)09506000134383(3102)000125(15)270115(10)F2611

    A scanner sends

    ]d2010950600013438331020001251527011510F2611

    (01) Product number (GTIN)
    09506000134383
    (3102) Net weight (kg), 2 decimal places
    000125 · 1.25
    (15) Best before date
    270115 · 15 Jan 2027
    (10) Batch or lot number
    F2611
  • Shipping carton

    22 × 22 modules · 1 separator

    A carton shipped as one unit, with its SSCC (00), holding 24 identical items: their GTIN (02), the count (37), batch and best before date. On a GS1 logistic label the SSCC must also be printed as a GS1-128 barcode; a GS1 DataMatrix can be added beside it and must carry the same data.

    Readable text

    (00)095060001343520000(02)09506000134369(15)270430(37)24(10)C2611

    A scanner sends

    ]d2000950600013435200000209506000134369152704303724<GS>10C2611

    (00) Serial shipping container code (SSCC)
    095060001343520000
    (02) GTIN of the items inside
    09506000134369
    (15) Best before date
    270430 · 30 Apr 2027
    (37) Count of trade items inside
    24
    (10) Batch or lot number
    C2611

Printing

Printing GS1 DataMatrix

GS1 DataMatrix FAQ

What is a GS1 Data Matrix barcode?

A Data Matrix ECC 200 code that starts with a special FNC1 character and holds product data as GS1 fields, each with a numbered Application Identifier (AI): (01) GTIN, (17) expiry date, (10) batch or lot, (21) serial number and so on. Scanners and software use the AIs to split the data. See GS1 DataMatrix explained with examples.

What is the difference between a GS1 Data Matrix barcode and a Data Matrix barcode?

The symbol is the same. A GS1 DataMatrix adds the FNC1 start character and the GS1 field structure, so a scanner knows where the GTIN ends and the expiry date begins. A plain code with “(01)” typed into it is not GS1: the brackets become ordinary text and there is no FNC1. For your own part numbers or text, use the plain Data Matrix code generator.

Do I need a GTIN to make a GS1 DataMatrix?

For field (01), yes. GTINs come from your GS1 Member Organization (GS1 US in the United States), which licenses a company prefix to you. We check the length and the check digit, but we can’t tell whether a number was issued to you. We are not GS1 and we don’t issue GTINs.

Why are there brackets around the numbers?

The brackets only appear in the readable text printed under the code, to show where each AI starts. They are not encoded. The code holds the FNC1 start character and, after each variable-length field that is not last, a separator. A scanner sends that separator as the GS character (ASCII 29).

What does 00 as the day in an expiry date mean?

Day 00 means no specific day. The GS1 General Specifications read it as the last day of that month for every date field that allows it: production (11), due (12), packaging (13), best before (15), sell by (16) and expiry (17). So 271200 means 31 December 2027. Tick “No exact day” under the date to encode it. Not for medicines or medical devices: since 1 January 2025 GS1 requires a real day (for example 31) on regulated healthcare products. Other sectors and trading partners may also expect a full date, so check their rules first.

Is my code GS1 certified?

No generator can certify a printed code. We check the field syntax (“Supported GS1 fields passed syntax checks”) and decode the image to confirm the data (“Data decoded successfully”). The print quality of a real label is graded with a verifier to ISO/IEC 15415. GTIN ownership and your trading partners’ rules are outside what any generator can check.

Can I use this for medicine serialization or UDI labels?

You can make the symbol here, with the GTIN, expiry, batch and serial fields those labels use. But this is a symbol generator, not a compliance workflow. UDI and medicine rules also cover issuing the numbers, registering them in databases, label content and print quality, which we don’t handle. Dates on these labels need a real day, not day 00.

Why does my scanner show strange characters, like <GS>?

That is the group separator (ASCII 29) between fields. It is meant to be there. Some scanners show it as a box, a space or “<GS>”, and some keyboard-mode scanners drop it, which joins the batch and serial together. Check your scanner’s settings for GS1 or FNC1 handling. To see exactly what a code holds, decode a GS1 DataMatrix in your browser.