Data Matrix Generator
Generate Data Matrix (ECC 200) codes, square or rectangular, including GS1 DataMatrix from AI syntax. Auto or fixed size, PNG or SVG.
Data Matrix is the small square 2D code found on electronic parts, medicine packs, surgical instruments and parcel labels. It holds far more than a linear barcode in very little space and can still be read when part of it is scratched. This generator builds standard ECC 200 symbols — square or rectangular — and GS1 DataMatrix from AI syntax, entirely in your browser.
How to use this tool
- Enter the text, or GS1 data such as (01)09506000134352(17)261231(10)ABC123 with the GS1 mode selected.
- Choose square or rectangular and Auto size (the smallest that fits), or pick a fixed size.
- Set the module size in pixels and the quiet zone around the symbol.
- Download PNG or SVG and scan a test print with the reader you will use.
Formula
symbol = data codewords + Reed–Solomon codewords over GF(256) with polynomial x⁸ + x⁵ + x³ + x² + 1, placed in the ISO/IEC 16022 “utah” pattern
Text is encoded in ASCII mode: two digits share one codeword (130 + the pair), other characters take one codeword (value + 1) and bytes above 127 add an upper-shift codeword. Free capacity is filled with the pad value 129 followed by pseudo-random pads. Error correction is fixed per size — for example 5 codewords in a 10 × 10 symbol — so there is no level to choose. GS1 DataMatrix starts with FNC1 (codeword 232) and uses it again after variable-length fields.
Example
123456 becomes three codewords: 12 → 142, 34 → 164 and 56 → 186. That fills the smallest symbol, 10 × 10, whose five error-correction codewords are 114, 25, 5, 88 and 102 — the worked example in ISO/IEC 16022. Hello needs five codewords, one per letter (H = 72 + 1 = 73), so it moves up to 12 × 12 or fits the 8 × 18 rectangle.
Frequently asked questions
Which scanners can read it?
Phone scanner apps and any 2D imaging scanner. Laser scanners that read only linear barcodes cannot read Data Matrix.
Does it support Korean, emoji or accented letters?
Yes. Latin-1 text (including é or ü) is stored directly; other characters are stored as UTF-8 with an ECI marker, which modern readers decode. Some older industrial scanners may display them incorrectly, so test first.
Why is my symbol bigger than another generator’s?
This encoder uses ASCII mode with digit pairs, which every reader supports. Some generators switch to the C40, Text or Base 256 modes for long text and can sometimes reach a smaller size.
Square or rectangular?
Rectangles (up to 16 × 48, 49 codewords) fit narrow spaces such as cable labels; squares hold much more, up to 1,558 codewords in 144 × 144.
Sources
Last updated: 2026-10-30