Data Matrix Generator

This free Data Matrix generator creates compact 2D DataMatrix barcodes for small parts, pharmaceuticals, and electronics. Encodes up to 2,335 characters. Download SVG or PNG.

What Is a Data Matrix Barcode?

Data Matrix is defined by ISO/IEC 16022 and uses an ECC200 error correction algorithm based on Reed-Solomon codes that can restore up to 30% of a damaged or obscured symbol. The barcode is built on a square or rectangular grid with a solid "L-shaped" finder pattern on two sides (the timing pattern) and an alternating border on the other two sides that a scanner uses to determine the symbol's orientation, size, and module count. Data Matrix symbols range from 10×10 to 144×144 modules in the square configuration, encoding between 1 and 2,335 alphanumeric characters or up to 3,116 numeric digits. The ECC200 Galois field arithmetic means that a Data Matrix printed on a corroded metal part, laser-etched on a semiconductor wafer, or partially overprinted by a second label can still decode correctly — a property that makes it the mandated symbology in FDA pharmaceutical serialization under DSCSA, U.S. Department of Defense item marking under MIL-STD-130, and automotive direct part marking under AIAG standards.
Data Matrix (also written as DataMatrix) is a two-dimensional barcode symbology defined in the ISO/IEC 16022 standard that encodes data in a compact square or rectangular pattern of black and white cells. A Data Matrix generator produces these codes for marking small parts, pharmaceutical packages, electronic components, surgical instruments, and any item where physical space is severely constrained. A single Data Matrix symbol can encode up to 2,335 alphanumeric characters or 3,116 numeric digits in an area as small as 2.5 mm by 2.5 mm, making it the preferred symbology for direct part marking (DPM) in aerospace, automotive, and medical device manufacturing. Unlike linear barcodes, Data Matrix includes built-in Reed-Solomon error correction that allows the symbol to be read even when up to 30% of the pattern is damaged or obscured. This DataMatrix generator creates compliant symbols that scan with all industrial vision cameras, handheld 2D imagers, and smartphone barcode readers.

Data Matrix uses Reed-Solomon error correction (ECC200), which allows the barcode to remain readable even when up to 30% of the symbol is damaged. This robustness makes it the standard choice for direct part marking (DPM) on metal, glass, and circuit boards using laser etching or dot peen technology.

The format is mandated by several industry standards including FDA pharmaceutical serialization (DSCSA), automotive part traceability (AIAG), and U.S. Department of Defense item marking (MIL-STD-130). Use this Data Matrix generator to create compliant symbols for any of these applications.

Data Matrix vs QR Code

Data Matrix and QR Code are both two-dimensional barcode formats that encode data in a grid of modules, but they are optimized for fundamentally different use cases. Data Matrix achieves a smaller minimum symbol size -- as compact as 2.5 mm square -- making it the standard for direct part marking on tiny electronic components, surgical instruments, pharmaceutical vials, and aerospace parts where physical space is severely constrained. QR Code requires a larger minimum size (roughly 10 mm square for reliable scanning) but supports higher data capacity at 4,296 alphanumeric characters versus Data Matrix's 2,335. The decisive difference for most users is scanner compatibility: every modern smartphone camera recognizes QR Codes natively through the built-in camera app, while Data Matrix typically requires a dedicated barcode scanning application or industrial vision system. Choose Data Matrix for industrial, regulatory, and manufacturing applications. Choose QR Code for consumer-facing use cases such as marketing materials, product packaging links, WiFi credentials, and event tickets.
FeatureData MatrixQR Code
ShapeSquare or rectangularSquare only
Max capacity2,335 alphanumeric4,296 alphanumeric
Min size~2.5mm (very compact)~10mm (larger minimum)
Error correctionECC200 (Reed-Solomon)Up to 30% (Level H)
Best forIndustrial, pharmaceutical, electronicsConsumer, marketing, URLs
Smartphone readableWith dedicated appBuilt into camera app

Use this Data Matrix generator for industrial and regulatory applications. For consumer-facing use (marketing materials, website links), the QR Code generator is the better choice because smartphone cameras recognize QR natively.

Industries Using Data Matrix

Data Matrix barcodes are mandated or widely adopted across industries that require permanent, compact, machine-readable identification on parts, packages, and devices. The pharmaceutical industry uses Data Matrix as required by the FDA Drug Supply Chain Security Act (DSCSA), encoding GS1 Application Identifiers for product serialization, lot numbers, and expiration dates on every drug package sold in the United States. Aerospace and defense manufacturers follow MIL-STD-130 and IUID (Item Unique Identification) requirements, which mandate Data Matrix for unique item identification on weapons systems, aircraft components, and military equipment. The automotive industry uses AIAG standards to embed Data Matrix codes on engine parts, transmissions, and safety-critical components for supply chain traceability from raw material to finished vehicle. Electronics manufacturers mark printed circuit boards, integrated circuits, and connectors with Data Matrix using laser etching or ink-jet printing for production line tracking and quality control.
  • Pharmaceuticals -- FDA serialization (DSCSA) requires Data Matrix with GS1 Application Identifiers on drug packaging
  • Aerospace & defense -- MIL-STD-130 requires Data Matrix for unique item identification (UID) on defense assets
  • Automotive -- AIAG standard for part traceability throughout the supply chain
  • Electronics -- PCB marking and component traceability on circuit boards
  • Medical devices -- FDA UDI (Unique Device Identification) on implants, instruments, and devices

Need a different format? Try Code 128 for shipping labels, UPC for retail products, or the main generator for all 50+ formats.

Related Barcode Formats

Data Matrix is the industrial 2D choice. Pair it with these formats depending on the scan context:

  • QR Code -- Use QR instead when the end user scans with a smartphone camera (marketing, product inserts, WiFi prompts) rather than industrial scanners.
  • UPC-A -- Retail point-of-sale barcode for the saleable pharmaceutical or electronics unit that also carries a Data Matrix for serialization.
  • EAN-13 -- International retail equivalent of UPC-A for products sold outside North America with Data Matrix serialization underneath.
  • Code 128 -- Linear alternative when the label area is large enough and scanners only support 1D symbologies (older warehouse and logistics systems).
  • Bulk Generator -- Generate large batches of Data Matrix symbols from CSV for pharmaceutical serialization, PCB marking, and medical device UDI rollouts.

Data Matrix FAQ

Data Matrix is a specialized two-dimensional barcode format used primarily in industrial, pharmaceutical, aerospace, and electronics manufacturing applications where compact size and high reliability are critical requirements. This Data Matrix generator FAQ answers the most common questions about what data types and character sets Data Matrix can encode, how it compares to QR Code in terms of minimum symbol size, data capacity, error correction capability, and scanner compatibility for different commercial and industrial use cases, and the minimum physical size achievable when direct-part-marking small components using laser etching, dot peen, or chemical etch processes. Whether you are implementing FDA Drug Supply Chain Security Act (DSCSA) pharmaceutical serialization with GS1 Application Identifiers, MIL-STD-130 defense part marking for unique item identification on military assets, AIAG automotive traceability throughout the manufacturing supply chain, or direct part marking on electronic circuit boards and semiconductor packages, these answers explain how to create ISO/IEC 16022 compliant Data Matrix symbols.

Data Matrix is a 2D barcode format that stores data in a square or rectangular pattern of black and white cells. It can encode up to 2,335 alphanumeric characters in a very small space, making it ideal for marking small parts, pharmaceuticals, and electronics.
Data Matrix is preferred for industrial applications (part marking, pharmaceutical packaging, electronics) due to its compact size and robust ECC200 error correction. QR Code is better for consumer applications (marketing, URLs) because smartphone cameras recognize it more reliably without a dedicated scanning app.
Data Matrix can be printed as small as approximately 2.5mm square for short data strings. The minimum size depends on the amount of data encoded and the printing/marking technology used. For laser etching on metal parts, modules as small as 0.25mm are achievable.
Sources: ISO/IEC 16022:2024 (Data Matrix) · GS1 DataMatrix Guideline · FDA DSCSA · FDA UDI Basics