The short answer
There is no free font that turns typed text into a Data Matrix code. Data Matrix fonts only draw the squares after an encoder (a macro, add-in or DLL) has converted your data into special font characters, and the good ones are paid. For most jobs it is simpler to generate the codes as images: make one with our generator, or a whole spreadsheet's worth with the bulk generator, then insert the PNG or SVG.
A 1D barcode font such as Code 39 can get away with a direct mapping: each letter becomes a fixed pattern of bars. A Data Matrix cannot. Its squares are not your letters. They are your data compressed into codewords, mixed with Reed-Solomon error correction (extra data that lets a scanner rebuild damaged parts), then placed in a fixed pattern inside an L-shaped border. Only software can do that step.
How Data Matrix fonts work
A Data Matrix font is always half of a pair. The other half is an encoder, and the two must match: each vendor's encoder writes characters for its own font.
- You type your data in a cell or a document, for example a part number.
- The encoder (an Excel or Word add-in, a VBA macro, a DLL or a function in label software) works out the symbol: size, codewords and error correction. It returns several lines of odd-looking characters.
- The font turns each character into a small block of squares. The lines stack up into the finished symbol.
- 1
Your data
ASSET-2026-00042What you type in the cell.
- 2
Encoder output
PBOEIDKCIBIEMHIF PBGDMFJINEFNHINF PLBCECCFMJOHCKLF PJFDPJHJBPJPHNLF
A macro or add-in adds error correction and turns the result into font characters.
- 3
What the font draws
Each dashed band is one line of text. Line spacing must be exact.
Without step 2: type ASSET-2026-00042 straight into the font and you get one strip of squares like this. It has no finder
pattern and no error correction, so no scanner will read it.
That design is why font-based codes break in ways image-based codes do not:
- Line spacing must be exactly single, with no space before or after. Any gap opens white stripes across the code.
- Wrapping and shrink-to-fit in a cell rearrange or squash the lines.
- The font must be installed on every computer that opens or prints the file. Without it, the text shows in a normal font.
- Autocorrect can turn characters into curly quotes or symbols, which corrupts the code.
- Size is set by the font size, so the printed module size (each small square) is hard to control exactly.
Vendors such as IDAutomation, BarCodeWiz and Precision ID sell Data Matrix font-and-encoder packages for Office and other software. We have not tested them and do not endorse any; check the current license terms and test a printed code before you rely on one. Fonts named “matrix” on free font sites are decorative lettering, not barcodes.
Fonts vs images vs API
| Question | Font + encoder | Images (bulk generator) | IMAGE() + free API |
|---|---|---|---|
| Cost | Usually a paid license | Free | Free, rate-limited |
| Setup | Install font and add-in on every computer | None: runs in your browser | One formula, filled down |
| Updates when the value changes | Yes | No: make the files again | Yes |
| Print size control | Through font size and spacing | Exact: true-size PDF or SVG in mm | Scaled to fit the cell |
| Your data leaves your computer | No | No: nothing is uploaded | Yes: each value is sent in the image URL |
| Works offline | Yes | Needs the web page; the work runs locally | No |
| Best for | Daily Office printing you already run this way | Labels, batches, anything printed | Sheets that show a code beside each row |
Data Matrix in Excel
Route 1: Excel to Data Matrix codes, no font needed
The bulk Data Matrix generator reads your list in the browser and makes one code per row. Nothing is uploaded.
- Copy the column from Excel, or save the sheet as .xlsx or .csv.
- Paste it, or drop the file, into the bulk generator and pick the column to encode. Add a caption column or a number of copies if you need them.
-
Read the row checks. The tool flags spreadsheet damage it can spot, such as numbers turned into
1.23E+11or leading zeros that went missing, and never fixes them silently. - Download a ZIP of PNG or SVG files with a manifest CSV, or a labels PDF at true size.
One job takes up to 5,000 rows. To put the images back in Excel, use Insert, then Pictures.
Route 2: the IMAGE() formula and our free API
Excel for Microsoft 365 and Excel 2024 have an IMAGE() function that shows a picture from a web address inside a cell. Point it at our
Data Matrix API for Excel IMAGE() and every row gets a live code. With values in column A from row 2, put this in
B2 and fill down:
Excel on Windows
=IMAGE("https://datamatrixcodegenerator.com/api/v1/datamatrix?format=png&scale=8&data="&ENCODEURL(A2),A2,0) ENCODEURL makes the value safe for a web address. Microsoft says it does not work in Excel for Mac or Excel for the web, so use this
version there (it also works on Windows):
Excel on Mac, web or Windows
=IMAGE("https://datamatrixcodegenerator.com/api/v1/datamatrix?format=png&scale=8&data="&SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"%","%25"),"&","%26"),"#","%23"),"+","%2B")," ","%20"),A2,0)
It escapes the 5 characters that would break the address: % , & , # , + and space . Letters, digits and other common punctuation pass through. For accented letters or symbols, use the Windows formula or the bulk generator.
Google Sheets
=IMAGE("https://datamatrixcodegenerator.com/api/v1/datamatrix?format=png&scale=8&data="&ENCODEURL(A2),1) | Row | A | B |
|---|---|---|
| 1 | Value | Data Matrix |
| 2 | PART-000123 | |
| 3 | PART-000124 | |
| 4 | SN 2026/0042 | |
| 5 | A&B-7#3 |
Download a ready-made Excel template (CSV) with four sample values and the formula already in column B. Open it in Excel and replace the values.
Good to know before you rely on it:
- PNG only. The formulas ask for
format=png: Excel'sIMAGE()supports BMP, JPEG, GIF, TIFF, PNG, ICO and WEBP, not SVG. - Your values travel in the URL to our API. It renders the image and does not log the value, but do not use it for data you may not send to a third party. The bulk generator keeps everything on your computer.
- Length: Excel accepts addresses up to 255 characters, which leaves about 177 characters for the value after escaping.
- Limits: 2,000 new images per day for each connection, and bursts above about 60 a minute may be slowed. Images already made (the same GET URL) are served from cache and do not count. For bigger sheets, use route 1.
- Errors:
#CONNECT!means Excel could not reach the address;#BLOCKED!means your security settings block linked images;#VALUE!means an argument or the image format is wrong, so check the formula. - Printing: the picture is scaled to the cell, so its size is not exact. Fine for a stock list or a quick check, not for labels a scanner must read every time. Make those with the bulk generator or the labels tool.
Route 3: a font with an Excel add-in
If you print from Excel every day and cannot change the workflow, a paid font-and-encoder add-in keeps everything inside Excel and offline. Follow the vendor's steps exactly, set the cell to no wrap and single spacing, and test the first print with a scanner.
Data Matrix in Word and label software
- One code in Word: download an SVG (sharp at any size, supported by Word in Microsoft 365) or a PNG from the generator, then Insert, then Pictures. Resize from a corner with the aspect ratio locked, and keep blank space around it: at least one module on every side, which the download already includes.
- Many labels from Word: a mail merge with pictures is possible, but it needs field codes and breaks easily. The labels tool lays codes out on common label sheets and thermal rolls as a true-size PDF.
- Label software: most label design programs have a Data Matrix object built in, so you need no font. Type or link the data and pick Data Matrix as the barcode type.
- Zebra and other thermal printers: ZPL, the Zebra printer language, has its own Data Matrix command (
^BX), so the printer draws the code itself.
Check it scans