Tools
Guides

Data Matrix Generator

QR

Generate a Data Matrix 2D code (ECC200) — the compact symbol used for logistics and electronic-component marking. Choose shape, module size and margin, then export as PNG or SVG.

100% client-side No backend
Preview
On this page

What is a Data Matrix code?#

Data Matrix is a square (or rectangular) 2D code made of light and dark modules arranged around an L-shaped finder pattern. Like a QR code it stores bytes redundantly and survives damage, but it was engineered for a different niche: very small footprints on industrial parts, printed circuit boards, medical devices and GS1 logistics labels. Because a Data Matrix stays readable at a few millimetres across — smaller than a QR code of the same capacity — it is the standard for direct part marking and serial-number etching.

This page renders ECC200 Data Matrix symbols (the modern, universally-scanned variant) via the bwip-js library. You give it text; it picks the smallest symbol that fits and draws it onto a canvas or exports it as SVG.

A key difference from QR: Data Matrix error correction is fixed by the symbol size, not user-selectable. Each symbol dimension has its Reed-Solomon guard band baked in, so there is no separate “error correction level” knob — the tool intentionally does not expose one.

How to use it#

  1. Type or paste the text to encode into the input box. This is typically a serial number, GTIN, lot/batch code or a short identifier.
  2. Choose a Shape: square (the default datamatrix bcid) or rectangular (datamatrixrectangular) for tight horizontal spaces.
  3. Set Size (module pixel size, 3 / 5 / 8 / 10 px) and Margin (quiet-zone padding, 0 / 2 / 4 / 8 px). The quiet zone matters — scanners need a clear border of empty modules around the code to find the finder pattern.
  4. Click Sample for a realistic identifier, Clear to reset.
  5. Download as PNG (for screen and documents) or SVG (for laser etching, screen printing or any vector workflow).

The tool caps input at 1500 characters. That is well below the ECC200 theoretical maximum (around 3116 numeric / 2335 ASCII) but deliberately tight: large Data Matrix symbols scan poorly on phone cameras, and the use cases this tool targets — small part marking — rarely need more than a few dozen characters anyway.

Key features#

  • ECC200, the modern standard. The variant every contemporary industrial scanner reads; older ECC000–ECC140 symbols are obsolete.
  • Square or rectangular symbols. Rectangular symbols fit narrow labels and wire markings where a square would not.
  • Quiet zone control. The margin selector directly governs the empty border scanners rely on to locate the L-shaped finder.
  • SVG export for marking. Vector output is what laser etchers, screen printers and CAD toolchains actually consume; a raster PNG at the wrong DPI scales badly on physical parts.
  • Local render. bwip-js is bundled with the page; nothing about your serial number or lot code is transmitted.

Worked example#

A medical-device manufacturer needs to mark a UDI (Unique Device Identification) string on a circuit board. The payload is a GS1 element string:

(01)04012345678901(17)261231(10)LOT2026A

Paste it, leave Shape on square, Size 5 px, Margin 4 px. The renderer picks the smallest ECC200 square that holds the 40-character payload and draws it. At 5 px per module the resulting symbol is roughly a centimetre across — small enough to etch onto a board yet readable by a handheld industrial scanner.

For a shorter asset tag like SN-2024-A8F3-001 (15 characters), the same settings produce a noticeably smaller, denser symbol because the library steps down to a more compact matrix size.

FAQ#

Data Matrix or QR — which should I use?#

QR when the code is consumed by consumers’ phones (links, WiFi, contacts, menus) — phone makers optimise their camera stacks for QR and the finder pattern is larger and faster to acquire. Data Matrix when the code is small, etched onto a part, or scanned by dedicated industrial or medical equipment — it stays readable at sizes where a QR becomes unreliable.

Why is there no error-correction level dropdown?#

Because ECC200 fixes the Reed-Solomon redundancy per symbol size. Unlike QR (where you trade capacity for robustness at L/M/Q/H), the matrix dimensions themselves decide the correction ratio — so exposing a knob would only mislead.

Can it encode binary or Kanji?#

Yes. ECC200 supports byte-mode encoding including arbitrary bytes; non-ASCII text is encoded per the standard. For Kanji-heavy payloads a QR code is usually more compact, but Data Matrix handles it correctly.

My symbol scans on the industrial gun but not my phone. Why?#

Phone cameras are tuned for QR’s larger finder pattern and can struggle with tiny Data Matrix symbols. Increase Size to 8 or 10 px and Margin to at least 4 px, hold the camera steady, and the scan should land.