QR3D Craft

How to 3D print a QR code that scans first time

By · 10 min read · Updated 25 October 2026

Leer en español

Nearly every 3D printed QR code that fails to scan fails for the same reason, and it is not the printer. It is a two-line calculation you do before sending the piece to print. Here is that calculation, and the other eight steps it takes to get it right first time.

1. The module is the unit that matters

A QR code is not made of pixels or of millimetres: it is made of modules, the individual little squares it is built from. A version 3 code is 29 modules a side. A version 10 is 57. They are always square and they are always all the same size.

When that code becomes a printed piece, each module turns into a small prism the printer has to raise. And that is where the physical limit almost nobody calculates shows up: a printer cannot draw a square narrower than its nozzle. If the module is smaller than the extrusion width, the machine does what it can: it rounds the corners, joins neighbouring modules that should be separate, and leaves gaps where there should be material.

The phone's camera then sees a smudge, not a grid. And it does not read.

That limit belongs to the printer, not to the code. A resin machine has no nozzle, so the minimum drops a long way and is set by the camera that will read the piece: that is what makes possible the codes that filament cannot manage, and it is in the resin guide (in Spanish).

The rule: the module must be at least twice the nozzle diameter. With the standard 0.4 mm nozzle, that is 0.8 mm a module. With a 0.6 mm one, 1.2 mm. Below that the code comes out dirty even with a perfectly calibrated printer. That rule is the general one; to find the number for your machine there is a six-piece test kit (in Spanish) that prints in one go.

Twice the nozzle is not a magic number: it is what it takes for each module to be formed by two passes of material and have straight walls instead of one rounded bead. With a single pass the square turns into something closer to a lentil, and the four around it stick to it.

The three areas of a QR codeA version 3 QR code. The three finder patterns marked in orange, the timing pattern in green, and the rest, data and error correction.Finder patternsThey tell the reader where the code is andhow it is rotated. There are always three.Timing patternIt sets the pitch of the grid. Without itthe reader cannot tell where a module ends.Data and correctionEverything else: your link and the modulesthat recover it if part of the code getsdamaged.
Only the dark area carries your link. The corners and the band are structure: if the design covers or distorts them, the code stops reading however good it looks.

2. Shorten the link before you generate anything

The more characters you put in the code, the more modules it needs, and the more modules it has, the smaller each one is for the same size of piece. It is the cheapest lever you have: removing characters makes the modules bigger without making the object bigger.

These are the real versions that ordinary addresses produce, worked out with the same encoder this site uses, at correction level M:

LinkCharactersVersionModules
https://a.co/x14121 × 21
https://qr3dcraft.com21225 × 25
https://instagram.com/mybusiness32329 × 29
https://www.mybusiness.co.uk/menu-202651433 × 33

The difference between 21 and 33 modules does not look like much on screen, but on a 40 mm piece it means going from 1.4 mm modules to 0.9 mm modules. Any machine prints the first. The second is right on the limit.

Three ways to trim, from most to least advisable:

3. Pick the error correction level

The QR standard stores redundant information so the code still reads with part of it covered or damaged. There are four levels, and each eats into the capacity:

LevelTolerates damage ofCharacters at version 3
L (low)~7 %53
M (medium)~15 %42
Q (high)~25 %32
H (maximum)~30 %24

The temptation is to set H «just in case». In 3D printing that is usually a bad idea, for a specific reason: raising the level forces a higher version, and a higher version shrinks the modules. You end up with a code that is theoretically tougher but physically worse printed, which is exactly the damage you were protecting yourself from.

M is the sweet spot for nearly everything that gets printed. Go up to Q or H only when the code will carry a logo in the middle, which covers real modules, or when the piece is going to get dirty or scratched: a keychain living in a pocket, a plate in a workshop.

4. Work out the minimum size of the piece

With the rule from point 1 you can already work out the exact minimum size. The full formula is:

side = (modules + 8) × module size

The eight extra modules are the compulsory quiet zone that point 7 is about. With a 0.4 mm nozzle and therefore a 0.8 mm module, this is the table:

VersionModulesCode onlyWith quiet zone
121 × 2116.8 mm23.2 mm
225 × 2520.0 mm26.4 mm
329 × 2923.2 mm29.6 mm
433 × 3326.4 mm32.8 mm
537 × 3729.6 mm36.0 mm
641 × 4132.8 mm39.2 mm
849 × 4939.2 mm45.6 mm
1057 × 5745.6 mm52.0 mm

That is the absolute minimum, the point where the code prints cleanly with nothing to spare. For real use it pays to leave room, because size also decides how far away it can be scanned from. The practical reference is that a phone reads a QR from about ten times the side of the code:

The whole calculation, with tables for both nozzles, is in the minimum size guide.

5. Pick the two filaments

A QR printed in a single colour is a relief, not a code. The camera needs to tell the dark modules from the light background and, with no colour difference, all it has to work with is the shadow the relief casts, which changes with every lamp in the room. Sometimes it reads. Most of the time it does not.

With two filaments the problem disappears. Two criteria and that is it:

What to avoid without exception: two colours of similar lightness. Red on black, navy on bottle green or mid grey on dark grey look different to the naked eye, but in black and white — which is how the reader processes them — they are almost the same tone. The full list is in the filament colours guide.

6. Decide the relief height

Between 0.8 and 1.2 mm on plates and stands, which is four to six layers of 0.2 mm. That range is not arbitrary:

On small pieces the figure is different: 0.6 mm. The real ceiling depends on module size, because the wall of the relief hides part of the light module behind it as soon as the phone tilts. The short rule is not to go past 70 % of the module, and on a 40 mm keychain that is 0.64 mm: the one millimetre the generator offers by default stops reading at 25° of tilt. The whole calculation is in the relief height guide (in Spanish).

At 1 mm of relief the piece also feels good in the hand, which is half the reason for printing this in 3D instead of sticking on a sticker.

7. Do not trim the quiet zone

Around the code there has to be a plain band in the base colour, four modules wide on each side. It is called the quiet zone and it is not decoration: it is what tells the reader where the code ends. Without it the algorithm cannot find the edges and fails even with a perfectly printed code.

It is the most frequent mistake when somebody designs the piece themselves: the QR gets pushed out to the edge of the keychain to make use of the space and the result never reads. Four modules of 0.8 mm is 3.2 mm a side. That is the plain border to respect before the text, the ring hole or the edge of the piece begins.

8. The three slicer settings

The first layer squashes the modules

If the nozzle runs too low, the first layer spreads — the effect known as elephant foot — and each dark module grows a few tenths on every side. On an ordinary piece that does not matter. On a QR, those tenths close the light corridors separating the modules and turn the grid into patches. If your printer has elephant foot compensation, turn it on; if not, raise the z-offset by a couple of hundredths.

With the piece sitting the way it comes out of the file, the bottom layer is the base and none of this reaches the code. It changes if you turn it over so the code sits against the bed, which gives the smoothest face a printer knows how to make and costs more than it looks: it is measured in the face up or face down guide (in Spanish).

The relief starts where the base ends

That is what makes it possible to print this in two colours on an ordinary single-extruder printer. Nothing needs cutting or splitting: all it takes is setting a filament change at the exact height where the base ends. Every current slicer allows it with a right click on the layer bar. If the base is 2 mm and the layers are 0.2 mm, the change goes at layer 11. For the piece to reach the slicer with the base and the relief already separate you have to download it as 3MF and not STL, for the reasons the file formats guide (in Spanish) compares.

Ironing on the top face

If your slicer has ironing, turn it on for the top surface only. It smooths the face of the code, reduces the nozzle marks between one module and the next, and improves reading noticeably. It makes the print longer, but on a small piece that is minutes.

9. Check it before spending filament

Two checks that take under a minute and save hours of printer time:

  1. Scan the preview on screen with your own phone, and with another one if you can. If it does not read on a monitor, with perfect contrast and no shadows, it certainly will not read printed. This step rules out address and correction-level mistakes in one go.
  2. Look at the modules in the slicer. Switch to layer view, go to the first layer of the relief and check that the lone modules look like separate squares and not one continuous mass. If they are stuck together, the piece is too small: go back to point 4.

If what you are printing is a run and not a single piece, it is worth extending those two checks into a protocol with the piece in your hand, which is what the testing guide (in Spanish) sets out.

A note on material: PETG and ABS shrink more than PLA as they cool, and on a large plate that shrinkage distorts the grid slightly. For QR codes, PLA is the most reliable material. Save PETG for pieces that will sit in the sun or outdoors, and in that case print the code 15 % larger than the table says. What to plan for on a piece that lives outside — PETG's shine, the colour fading and how much margin to buy — is in the outdoor guide (in Spanish).

All of this comes already worked out

The generator applies these rules on its own: it picks the lowest possible version for your link, respects the four-module quiet zone, separates the base from the relief for the colour change and gives you the 3MF with both filaments already assigned.

Generate my QR code

Summary in nine lines

Keep reading