Data Matrix Generator
Generate a Data Matrix 2D barcode from text, a serial number, or any short string — square or rectangular symbol shape, configurable module size, output as a scalable SVG. Runs entirely in your browser.
Input
Output
Your Data Matrix code will appear here.
Guides
Turn text, a serial number, a product ID, or any short string into a Data Matrix — a dense 2D barcode common on small parts, PCBs, medical devices, and shipping labels because it stays readable at a very small physical size. Choose a square or rectangular symbol shape and a module size, then copy the SVG or use the preview image directly. Everything runs locally in your browser.
How to use it
- Type or paste the data you want to encode — a serial number, product ID, URL, or any short text.
- Choose a shape: square (the common choice) or rectangular, useful when the available label space is wide and short.
- Adjust module size to scale the barcode up or down.
- Copy the SVG source, or download it directly from the preview.
About Data Matrix codes
A Data Matrix encodes data in a grid of square modules bordered by a solid "L" pattern (the finder) on two adjacent sides, with alternating dark/light modules on the other two — that's what lets a scanner determine the symbol's orientation and size from any angle. Like QR and Aztec, it includes Reed–Solomon error correction, so a partially damaged or dirty label can still be read. It's the standard 2D barcode in electronics manufacturing and medical device marking (UDI), where physical space for a label is extremely limited.
Square or rectangular — which should I pick?
Square is the standard choice and reads reliably at the smallest sizes. Rectangular symbols trade some of that space efficiency for a wider, shorter footprint — useful when you're labeling something like a cable or a narrow strip where a square symbol wouldn't fit.
Is my data uploaded anywhere?
No. Barcode generation runs entirely in your browser (or, for API calls, isomorphically in the request handler) — nothing is sent to a third-party service.
Need a different barcode format?
Use the Aztec Code Generator for Aztec Codes, or the QR Code Generator for QR codes.
Use it from code
From 3 credits per callREST API
curl -X POST https://api.iotools.cloud/v1/tool/data-matrix-generator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"inputText": "SN-2026-0311-48291",
"shape": "square",
"moduleSize": "4"
}'Swap in your own key from your account. The tool's fields are the body — no wrapper.
Ask an AI agent
Use the IOTools `data-matrix-generator` tool (Data Matrix Generator) on this input:
YOUR_INPUT_HEREPaste this at any agent connected to the IOTools MCP server, then add your input.