MANUFACTURING / INTEGRATION / AUTOMATION
LIVE TOOL

Data Matrix and QR codes

Generate Data Matrix (ECC 200, all 30 sizes) and QR Code (versions 1–40, levels L–H) symbols, with GS1 element strings and FNC1, as SVG or PNG at a module size that prints in whole printer dots, one at a time or in batches for A4 label sheets and ZIP files. Check GS1 element strings against the GS1 Barcode Syntax Dictionary and read codes from a camera or a keyboard-wedge scanner. Everything runs in your browser.

Tool

Everything runs in this browser: nothing is uploaded or stored, and the camera picture never leaves the page. The encoders are FactoKit’s own (no library) and are checked by decoding thousands of their symbols with zxing-cpp and libdmtx; see the Method.

Content and symbol

Example dataIllustrative: replace with your own text or GS1 element string

GS1: AIs in brackets, (01)…(17)…(10)…, or unbracketed with separators typed as <GS>, ␝ or ^. FNC1 is added first and after every variable-length AI that is not last; the brackets are never encoded.

Print size

A printer can only print whole dots: at 300 dpi a module of 0.5 mm is 5.9 dots and is printed as 6 (0.508 mm). With “Whole printer dots” the module is rounded to whole dots so that every module prints the same width; the size and the PNG follow it.

Runs in this browser. Data is not uploaded or stored.

Symbol

20 × 20Symbol
10.16 × 10.16 mmPrinted size, no quiet zone
19 / 22Data capacity used
18Error correction

GS1 DataMatrix 20 × 20 (ECC 200): 19 of 22 data codewords used (86 %), 18 error correction codewords; they correct up to 9 codewords in error. Module (X dimension) 6 printer dots at 300 dpi = 0.508 mm (0.5 mm requested); with the quiet zone of 1 module the code needs 11.18 × 11.18 mm.

    GS1 DataMatrix 20 × 20: (01)09506000134352(17)271231(10)ABC123
    Shown enlarged. Prints at 10.16 × 10.16 mm (11.18 × 11.18 mm with the white quiet zone around it).

    SVG: vector, sized in millimetres, for label software and print shops. PNG: whole pixels per module at the printer resolution (marked in the file), for printers that take images. Test-print the code and read it with the scanner it is meant for.

    Encodation: how the data was written
    SchemeCharactersCodewordsNote
    ASCII01FNC1 in first position (GS1)
    ASCII32181 codeword per character, 2 digits per codeword
    GS1 element string: Application Identifiers
    AITitleFormatValueMeaningCheck
    (01)GTINN14 (predefined length)09506000134352GTIN-13 9506000134352; check digit 2 correctOK
    (17)USE BY or EXPIRYN6 (predefined length)2712312027-12-31OK
    (10)BATCH/LOTX..20ABC123OK

    GS1 element string

    Example dataIllustrative: replace with your own element string

    Bracketed: (01)09506000134352(10)ABC123, a “(” inside a value written as \(. Unbracketed: 010950600013435210ABC123 with the separator typed as <GS>, {GS}, ␝, \x1D or ^; a symbology identifier (]d2, ]Q3, ]C1) at the start is removed.

    Check digit calculator

    • As GTIN-13 / GLN without its check digit: check digit 2 → 9506000134352
    • As a complete GTIN-12 (UPC-A): check digit 5 is wrong; the digits before it give 9

    Runs in this browser. Data is not uploaded or stored.

    Check

    ValidElement string
    5Elements
    0Problems
    1FNC1 separators

    Valid: 5 elements, 1 FNC1 separator after variable-length AIs, 51 data characters.

      Human-readable (HRI)
      (01)09506000134352(3103)001250(17)271200(10)ABC123(21)S-0042
      Data for the symbol (␝ = FNC1 separator)
      010950600013435231030012501727120010ABC123␝21S-0042
      GS1 syntax engine notation (^ = FNC1)
      ^010950600013435231030012501727120010ABC123^21S-0042
      GS1 element string: Application Identifiers
      AITitleFormatValueMeaningCheck
      (01)GTINN14 (predefined length)09506000134352GTIN-13 9506000134352; check digit 2 correctOK
      (3103)NET WEIGHT (kg)N6 (predefined length)0012501.250 kgOK
      (17)USE BY or EXPIRYN6 (predefined length)2712002027-12 (day 00: end of the month, 2027-12-31)OK
      (10)BATCH/LOTX..20ABC123OK
      (21)SERIALX..20S-0042OK

      Camera

      Reading from the camera needs JavaScript and a browser with BarcodeDetector (Shape Detection API); the scanner field below works in every browser.

      Scanner (keyboard wedge)

      USB and Bluetooth scanners type the code and press Enter. GS cannot be typed: a scanner sends it as Ctrl+] (shown here as ␝) or, if set up so, as text such as <GS>. A symbology identifier at the start (]d2 GS1 DataMatrix, ]Q3 GS1 QR Code …) is read and removed.

      Runs in this browser. Data is not uploaded or stored.

      Reads

      0Reads
      —Last symbology
      —GS1

      No reads yet. Start the camera, scan into the field, or try the example scan.

        Codes

        Example dataIllustrative: replace with your own codes, template or table
        Input

        Paste, open a CSV, TSV, TXT or XLSX file (up to 20 MB), or drop it on the field. Files are read in this browser only.

        Columns

        Data from the first column or a column named Data, Code or Text; Label (optional, by its header: Label, Name …) goes under the code and into the file names. Choose “Single column” when codes contain commas or semicolons.

        Data                          Label
        (01)09506000134352(21)S-0001  Carton 1
        Long format
        1 row = 1 code

        Columns: tab, ; or ,
        Decimals: 12,5 or 12.5

        Read as: tab-separated · whole numbers · 6 rows · header row skipped

        Data as understood — 6 rows
        #DataLabel
        1(01)09506000134352(17)271231(10)ABC123(21)S-0001Carton 1
        2(01)09506000134352(17)271231(10)ABC123(21)S-0002Carton 2
        3(01)09506000134352(17)271231(10)ABC123(21)S-0003Carton 3
        4(01)09506000134352(17)271231(10)ABC123(21)S-0004Carton 4
        5(01)09506000134352(17)271231(10)ABC123(21)S-0005Carton 5
        6(01)09506000134352(17)271231(10)ABC123(21)S-0006Carton 6

        {0001..0500}: a counter from 1 to 500, zero-padded to 4 digits because the start or end is written with a leading zero; {1..500..5} counts in steps of 5, {500..1} down. One counter per template, at most 10,000 codes. {date:YYMMDD} is the batch date, {date+730:YYMMDD} that date plus 730 days (YYYY, YY, MM, DD and separators); write {{ and }} for literal braces.

        21 codes
        First: (01)09506000134352(17)280930(10)LOT42(21)SN0001
        Last: (01)09506000134352(17)280930(10)LOT42(21)SN0021

        Paste, open a CSV, TSV, TXT or XLSX file (up to 20 MB), or drop it on the field. Files are read in this browser only.

        {GTIN} takes the column with that header (case, spaces, “_” and “-” ignored), {C3} the third column; {date:YYMMDD} as in the serial generator. Every placeholder needs a column; an empty cell is an error in that row.

        Columns of the placeholders

        Symbol: one setting for the whole batch

        Print size

        Runs in this browser. Data is not uploaded or stored.

        Check

        21Codes
        21Ready for output
        0Warnings
        0Errors

        21 codes checked: 21 OK, 0 warnings, 0 errors. Symbol size: 22 × 22.

          Codes: 21
          RowLabelDataSymbolSize (mm)StatusMessage
          10001(01)09506000134352(17)280930(10)LOT42(21)SN000122 × 2211.18 × 11.18OK
          20002(01)09506000134352(17)280930(10)LOT42(21)SN000222 × 2211.18 × 11.18OK
          30003(01)09506000134352(17)280930(10)LOT42(21)SN000322 × 2211.18 × 11.18OK
          40004(01)09506000134352(17)280930(10)LOT42(21)SN000422 × 2211.18 × 11.18OK
          50005(01)09506000134352(17)280930(10)LOT42(21)SN000522 × 2211.18 × 11.18OK
          60006(01)09506000134352(17)280930(10)LOT42(21)SN000622 × 2211.18 × 11.18OK
          70007(01)09506000134352(17)280930(10)LOT42(21)SN000722 × 2211.18 × 11.18OK
          80008(01)09506000134352(17)280930(10)LOT42(21)SN000822 × 2211.18 × 11.18OK
          90009(01)09506000134352(17)280930(10)LOT42(21)SN000922 × 2211.18 × 11.18OK
          100010(01)09506000134352(17)280930(10)LOT42(21)SN001022 × 2211.18 × 11.18OK
          110011(01)09506000134352(17)280930(10)LOT42(21)SN001122 × 2211.18 × 11.18OK
          120012(01)09506000134352(17)280930(10)LOT42(21)SN001222 × 2211.18 × 11.18OK
          130013(01)09506000134352(17)280930(10)LOT42(21)SN001322 × 2211.18 × 11.18OK
          140014(01)09506000134352(17)280930(10)LOT42(21)SN001422 × 2211.18 × 11.18OK
          150015(01)09506000134352(17)280930(10)LOT42(21)SN001522 × 2211.18 × 11.18OK
          160016(01)09506000134352(17)280930(10)LOT42(21)SN001622 × 2211.18 × 11.18OK
          170017(01)09506000134352(17)280930(10)LOT42(21)SN001722 × 2211.18 × 11.18OK
          180018(01)09506000134352(17)280930(10)LOT42(21)SN001822 × 2211.18 × 11.18OK
          190019(01)09506000134352(17)280930(10)LOT42(21)SN001922 × 2211.18 × 11.18OK
          200020(01)09506000134352(17)280930(10)LOT42(21)SN002022 × 2211.18 × 11.18OK
          210021(01)09506000134352(17)280930(10)LOT42(21)SN002122 × 2211.18 × 11.18OK

          A4 label sheets

          Label grid in millimetres

          Common A4 label sheet layouts with the margins and gaps as these layouts are commonly published, written from memory and checked only for adding up to 210 × 297 mm. Measure your sheet or check its data sheet before a large print run.

          Code width: the largest code with its quiet zone that fits this width in whole printer dots per module (codes of different sizes then get different modules). A code that does not fit its label is an error, never shrunk.

            Sheet 1 of 1: label layout preview(01)09506000134352(17)280930(10)LOT42(21)SN0001(01)09506000134352(17)280930(10)LOT42(21)SN0002(01)09506000134352(17)280930(10)LOT42(21)SN0003(01)09506000134352(17)280930(10)LOT42(21)SN0004(01)09506000134352(17)280930(10)LOT42(21)SN0005(01)09506000134352(17)280930(10)LOT42(21)SN0006(01)09506000134352(17)280930(10)LOT42(21)SN0007(01)09506000134352(17)280930(10)LOT42(21)SN0008(01)09506000134352(17)280930(10)LOT42(21)SN0009(01)09506000134352(17)280930(10)LOT42(21)SN0010(01)09506000134352(17)280930(10)LOT42(21)SN0011(01)09506000134352(17)280930(10)LOT42(21)SN0012(01)09506000134352(17)280930(10)LOT42(21)SN0013(01)09506000134352(17)280930(10)LOT42(21)SN0014(01)09506000134352(17)280930(10)LOT42(21)SN0015(01)09506000134352(17)280930(10)LOT42(21)SN0016(01)09506000134352(17)280930(10)LOT42(21)SN0017(01)09506000134352(17)280930(10)LOT42(21)SN0018(01)09506000134352(17)280930(10)LOT42(21)SN0019(01)09506000134352(17)280930(10)LOT42(21)SN0020(01)09506000134352(17)280930(10)LOT42(21)SN0021
            Sheet 1 of 1: 21 labels on 1 A4 sheet, starting at label 1. Code 12.19 × 12.19 mm with its quiet zone (module 0.508 mm = 6 dots at 300 dpi).

            The sheets print through the browser on A4 without page margins: choose 100 % or “Actual size”, margins “None” and no headers or footers, and print one test sheet on plain paper held against the label sheet first. Every module starts on a printer dot of the chosen resolution.

            ZIP download

            File names from {row} (zero-padded row number), {label} and {data}: letters other than A–Z, a–z and 0–9 become “_”, and a repeated name gets -2, -3 …. The ZIP also holds manifest.csv (file, row, label, data, symbol, size). One batch is at most 10,000 codes.

            Download offline versionSingle HTML file · v1.6 · 752 KB · works without internet

            How the codes are made and read

            Two-dimensional codes for traceability labels, part marking and packaging: Data Matrix ECC 200 and QR Code model 2 are generated by FactoKit’s own encoders (no library), GS1 element strings are checked against GS1’s machine-readable Application Identifier table, and codes are read with the browser’s BarcodeDetector or a keyboard-wedge scanner. Everything runs in this browser.

            Worked example: GS1 DataMatrix with GTIN, expiry date and batch

            Data Matrix ECC 200

            QR Code model 2

            GS1 element strings

            Print size

            Reading

            Batch

            Not verified

            Questions

            Data Matrix or QR Code: which one should I use?
            For marking parts and packs in manufacturing and healthcare, Data Matrix is the usual choice: it is smaller for the same data, works well on small labels and direct part marking, and GS1 DataMatrix is widely used for healthcare items. QR Code is the one phones read without an app, so it suits web addresses and GS1 Digital Link. Both can carry GS1 element strings with FNC1. Follow your customer’s or your industry’s labelling specification when it names one.
            What are FNC1 and the GS separator in a GS1 code?
            A GS1 symbol starts with FNC1, which tells the reader that the data are GS1 Application Identifiers. AIs with a predefined length (such as (01) GTIN or (17) expiry date) need nothing after them; a variable-length AI (such as (10) batch or (21) serial number) that is not the last one is ended by another FNC1. Readers pass that separator on as the ASCII character GS (29). The brackets of the human-readable text are never encoded. The tool adds every FNC1 for you, and putting the fixed-length AIs first saves separators.
            How large should the code be printed?
            The size follows from the module size (the X dimension) times the number of modules, plus the quiet zone. Choose the module size your specification and your scanners need, then let the tool round it to whole printer dots: a 300 dpi printer can print 0.508 mm (6 dots) exactly, but not 0.5 mm (5.9 dots), and uneven modules read worse. Keep the quiet zone free: at least 1 module for Data Matrix and 4 modules for QR Code. Test-print and read the code with the scanner it is meant for.
            Why does the camera not read codes in my browser?
            The camera part uses the browser’s BarcodeDetector (Shape Detection API), which only some browsers offer; the page says whether yours does. The camera also needs your permission and a secure page (https or the downloaded offline file). Where it is missing, use a USB or Bluetooth barcode scanner with the scanner field: it works in every browser. Reading codes from image files is not offered.
            My scanner adds ]d2 or strange characters. What are they?
            Scanners can send a symbology identifier before the data: ]d2 means GS1 DataMatrix, ]Q3 GS1 QR Code, ]C1 GS1-128. The tool reads and removes it. GS (ASCII 29), the GS1 separator, cannot be typed on a keyboard, so a scanner in keyboard mode sends it as Ctrl+] or as text such as <GS>, depending on its set-up; the scanner field shows it as ␝ and understands the usual forms.
            How do I print many codes, for example serial numbers, on label sheets?
            Use the Batch part: paste a list, open a CSV or Excel table, or write a template with a counter such as (01)09506000134352(21)SN{0001..0500}. Every code is checked first (GS1 errors, data too long, repeated codes and serial numbers). Then choose an A4 label layout, the text under the code and the label to start on, and print the sheets at 100 % without page margins, or download a ZIP with one PNG or SVG file per code and a manifest. Print one test sheet on plain paper and hold it against the labels first.
            Are my data or the camera picture uploaded?
            No. The codes are generated, checked and read in your browser. The camera picture goes only to the browser’s BarcodeDetector on your device; frames are not stored or sent. The results leave the page only as the files you download.