Free QR Code and Data Matrix Generator with Logo, Styles, SVG, PDF and DXF Export for Laser Part Marking

Make QR codes and Data Matrix codes for websites, Wi-Fi, contacts and more, or for marking parts with a part number, CAGE code, serial number and date. Style them, add a logo, and export PNG, SVG, PDF, EPS or a true-size DXF for CAD and laser engravers. Free, no sign-up, and the codes never expire.

1 · What goes in the code

Starts with https:// if you leave it off. Shorter addresses make smaller, easier-to-scan codes.

Exact text inside the code

              
Control characters are shown as tags: <RS> record separator (30), <GS> group separator (29), <EOT> end of transmission (4).
2 · Code settings

3 · Style
Logo in the middle
Banner across the middle
Caption below

A banner switches error correction to H and makes the QR code bigger, so the band covers only about a tenth of its height. Logos, banners and styles hide part of the code. Error correction rebuilds what's covered, so raise it to Q or H and watch the scan check beside the preview.

4 · True size, laser marking and CAD

CAD exports (DXF, CAD SVG, PDF, EPS) are always plain black squares at exactly this cell size, whatever the style above. "Shrink" makes each square smaller by your beam width; it applies to one-square-per-cell geometry.

5 · Drawing note

              
            
Preview
Scan check: waiting…
Picture
CAD and laser, true size

Read a QR code or Data Matrix from a picture

See exactly what an existing code holds, including hidden control characters. Pick a photo or screenshot, or paste one (Ctrl+V). It's read on your device.

What each type puts in the code

A QR code holds only text. Your phone decides what to do from how that text starts. These are the formats this page writes.

TypeText in the code (example)What a phone does
Websitehttps://example.com/pageOpens the page
Plain textAny text you typeShows the text
Part marking, labeledPN:ABC-100 DOM:05/2026 MFR:1A2B3 SN:0001Shows the text; scanners send it to a database
Part marking, ISO/IEC 15434 format 12[)><RS>12<GS>MFR 1A2B3<GS>PNO ABC-100<GS>SEQ 0001<RS><EOT>Industrial readers split it into fields
Part marking, ISO/IEC 15434 format 06[)><RS>06<GS>17V1A2B3<GS>1PABC-100<GS>S0001<RS><EOT>Industrial readers split it into fields
Phonetel:+15550100199Offers to call
Text messageSMSTO:+15550100199:HelloOpens a new message
Emailmailto:name@example.com?subject=HiOpens a new email
Wi-FiWIFI:T:WPA;S:Shop Wi-Fi;P:secret;;Offers to join the network
Contact cardBEGIN:VCARD … END:VCARD (vCard 3.0)Offers to save the contact
Social mediahttps://www.instagram.com/nameOpens the profile
Locationgeo:47.6062,-122.3321Opens a map
EventBEGIN:VEVENT … END:VEVENT (iCalendar)Offers to add it to the calendar
Reference Guide: QR Codes and Part Marking
01

QR Code or Data Matrix?

QR CodeData Matrix (ECC 200)
StandardISO/IEC 18004ISO/IEC 16022
Phone camerasRead by the built-in camera on iPhone and AndroidRead by scanner apps; many camera apps read only QR
Size for the same dataLargerSmaller
Error correctionChoose L, M, Q or HFixed, built into each size
Quiet zone4 cells1 cell minimum
DoD unique item ID (MIL-STD-130)Not acceptedRequired

Use a QR code when people will scan it with a phone: websites, manuals, Wi-Fi, contact cards, or commercial part marks a customer asks for.

Use Data Matrix for parts going to the U.S. Department of Defense and most aerospace programs. MIL-STD-130 requires Data Matrix ECC 200 for the machine-readable unique item identifier (UII). It also packs the same data into a smaller square, which helps on small parts. The Data Matrix Generator builds MIL-STD-130 constructs, ISO/IEC 15434 messages and GS1 codes.

Check your contract or purchase order. It names the symbol, the data format and the marking spec. Mark what it says, even when another choice seems better.
02

Error Correction Levels

LevelData that can be rebuiltUse for
Labout 7%Clean screens and paper; smallest code
Mabout 15%General use (default)
Qabout 25%Part marks, labels that get dirty or scratched
Habout 30%Logos and banners over the code; harsh conditions

Percentages from ISO/IEC 18004. Data Matrix ECC 200 has no levels: its correction is fixed for each size.

Higher correction makes the code bigger for the same data, because more of it is spare. On a part with a fixed marking area, that means smaller cells, which are harder to mark and read.

For laser marks, Q is a common choice. It survives scratches and coating wear without growing the code as much as H.

03

Sizing a Code for a Part

Symbol size = cells × cell size

A version 1 QR code is 21 × 21 cells; each version adds 4 cells per side, up to 177 × 177 (version 40). At a 0.020 in (0.51 mm) cell, a 29 × 29 code is 0.580 in (14.7 mm) square, plus the quiet zone. The size readout in step 4 does this math for you.

Make the data short
  • Uppercase letters, digits, space and $ % * + - . / : use QR "alphanumeric" mode, which takes less room than lowercase.
  • Drop labels you don't need, and use the shortest date format your customer accepts.
  • Each extra character can push the code to the next size.
Cell size

Bigger cells read more reliably. Typical laser marks use cells of about 0.010–0.030 in (0.25–0.75 mm). Below 0.010 in, mark and reader quality matter a lot. These are typical values; your marking spec and reader set the real limit.

Quiet zone

Leave clear, unmarked space around the code: 4 cells for QR, at least 1 cell for Data Matrix (more is better on textured metal). Edges, fillets, holes and other markings must stay out of it.

Curved parts

On a cylinder the code wraps around the curve. Keep it small compared with the diameter so the cells don't distort; many marking guides keep the code to a small fraction of the circumference. Check your marking spec.

04

Calling Out a Code on a Drawing

A complete note says
  1. Symbol: QR code or Data Matrix ECC 200.
  2. Method and spec: laser engrave, dot peen, label… per the marking spec (for example AS478, MIL-STD-130).
  3. Where: a leader to the marking area, ideally with a box sized for the code plus quiet zone.
  4. Cell size (minimum), error correction (QR) and quiet zone.
  5. The data, character for character: the format, every separator, and which fields change from part to part.
  6. Quality: the verification standard and minimum grade, if required (for example ISO/IEC 29158 for direct part marks, or AS9132).
  7. Finish: any protective coat over the mark.
Example: QR code with labeled fields
LASER ENGRAVE QR CODE IN AREA SHOWN PER AS478.
CELL SIZE .020 IN [0.51 MM] MIN. ERROR CORRECTION LEVEL Q. QUIET ZONE 4 CELLS MIN.
ENCODE: PN:ABC-100 DOM:MM/YYYY MFR:1A2B3 SN:XXXX
Example: Data Matrix with ISO/IEC 15434
LASER ENGRAVE DATA MATRIX ECC 200 IN AREA SHOWN PER MIL-STD-130.
ENCODE: [)><RS>12<GS>MFR 1A2B3<GS>PNO ABC-100<GS>SEQ XXXX<RS><EOT>
1 SPACE BETWEEN EACH TEXT ELEMENT IDENTIFIER AND ITS DATA.

Show changing fields as placeholders (XXXX, MM/YYYY) and say where the value comes from, such as "serial number per router" or "per customer purchase order". Spell out every space: a reader treats MFR 1A2B3 and MFR1A2B3 as different data. Step 5 above writes a note like these.

05

Part Number, Serial Number and CAGE Formats

The ISO/IEC 15434 envelope

Industrial marks wrap the data so a reader can tell the format and split the fields:

PieceMeaning
[)><RS>Message header: "fields follow"
12 or 06Format: 12 = text element identifiers, 06 = data identifiers
<GS>Between fields (ASCII 29)
<RS><EOT>End of format, end of message (ASCII 30, 4)

RS, GS and EOT are invisible control characters. This page shows them as tags so you can check them.

Format 12: text element identifiers (ATA Spec 2000)

MFR manufacturer's CAGE code, PNO part number, SEQ serial number within that part number, SER serial number unique across the enterprise. One space separates each identifier from its data. MIL-STD-130 construct 2 uses MFR + PNO + SEQ; construct 1 uses MFR + SER.

Format 06: data identifiers (ANSI MH10.8.2)

17V CAGE code, 1P part number, S serial number. No space between identifier and data.

CAGE code

The 5-character Commercial and Government Entity code identifies the manufacturer. Look it up in SAM.gov or the DLA CAGE system.

Labeled text

Simple PN:… SN:… strings are fine for internal tracking and phone scanning, but they are not a standard format. Spell the exact layout out on the drawing.

06

Laser Engraving Tips

  • Dark or light marks. On bare steel or titanium the laser usually darkens the surface: engrave the dark cells. On anodized or painted parts it usually removes the coating and makes a light mark: pick Light cells + quiet zone so the code still reads dark-on-light. Most readers also read inverted (light-on-dark) codes.
  • Plain squares. Turn on laser mode. Rounded cells, dots, logos and banners lower the read rate on metal.
  • Beam width. A laser line has width, so filled cells grow. Use Shrink each cell with one square per cell, or set the fill offset in your laser software.
  • Merged outlines make the fewest, closed shapes. Fill them in the laser software (hatch fill).
  • Contrast is what readers need. Test marks on scrap of the same material and finish.
  • Verify. A phone reading the mark is a quick check, not a grade. Where the drawing calls for a grade, use a verifier to ISO/IEC 29158 (direct part marks) or ISO/IEC 15415.
  • Coating over the mark can lower contrast. Test after coating, not before.
07

Logos, Banners, Colors and Styles

A logo or banner works because error correction rebuilds the cells it covers. Keep the covered area well under the level's limit: about 30% for H. This page clears the cells under the logo, which reads better than drawing over them.

The three big corner squares (finder patterns) let a scanner find the code. Style them, but never cover them.

  • Contrast: dark code on a light background. Light-on-dark and low-contrast colors fail on some phones.
  • Gradients: keep both ends dark.
  • Transparent background: only on a light surface.
  • Always test with the scan check here and with a phone or two before printing.
  • Logo file: a square PNG or SVG with a transparent background works best. The Image Converter turns HEIC, WebP or BMP logos into PNG.
08

Putting the Code in CAD

DXF

The DXF is AutoCAD R12 format, which every CAD and laser program reads. Coordinates are in the units you picked, with the lower-left corner of the quiet zone at 0,0. Layers: QR_ENGRAVE (the cells), QR_SYMBOL_EDGE and QR_QUIET_ZONE (reference boxes you can hide or delete).

SolidWorks: File → Open the DXF and choose to import it as a 2D sketch in a new part, or open a part sketch and use Insert → DXF/DWG. Set the import units to match the file. AutoCAD: open the file, or attach or insert it into your drawing.

Why no DWG?

DWG is Autodesk's closed format, and no free software can write it reliably in a browser. Every program that opens DWG also opens DXF; save it as DWG from there if you need to.

SVG, PDF and EPS

The CAD SVG is sized in real inches or millimeters, so Inkscape, Illustrator and laser software place it at true size. PDF and EPS are vector too, for drawing packages and print shops. The plain SVG button keeps your colors and logo.

09

Free, Private, and It Never Expires

The code is made in your browser. What you type, your logo and any picture you read are never sent anywhere. KasperCalc does not own any servers: the site is a set of fixed files delivered by Cloudflare.

To check, open your browser's developer tools (F12, or right-click → Inspect), pick the Network tab and make a code. The only requests are this page's own scripts. Entries starting with blob: or data: are the browser reading its own memory.

These are static codes: the text is inside the code itself, so it works forever without any service. Some websites make "dynamic" codes that point to their own short link, so they can count scans, and the code stops working if you stop paying.

10

Sources and Software

Standards

ISO/IEC 18004 (QR Code); ISO/IEC 16022 (Data Matrix); ISO/IEC 15434 (syntax for high-capacity media); ANSI MH10.8.2 (data identifiers); ATA Spec 2000 (text element identifiers); MIL-STD-130 (identification marking of U.S. military property); SAE AS478 (identification marking methods); SAE AS9132 (Data Matrix quality requirements for parts marking); ISO/IEC 29158 (direct part mark quality); ISO/IEC 15415 (2D symbol print quality); RFC 2426 (vCard 3.0); RFC 5545 (iCalendar).

Software used on this page

QR codes: QR Code generator library by Project Nayuki (MIT). Data Matrix codes and the scan check: zxing-wasm 3.1.8 (MIT), built on zxing-cpp (Apache-2.0); it loads the first time it's needed. Licenses are next to each file in js/vendor/qr/. Styling, DXF, SVG, PDF and EPS output are KasperCalc's own code.