How to 3D Print a QR Code That Scans Reliably
A 3D printed QR code scans reliably when three things are right: each module is several nozzle widths wide, the contrast is strong, and the code carries as little data as possible.
Updated 20 October 2026 · 7 min read
Learning how to 3D print a QR code is mostly about respecting the limits of the printer. A phone camera needs crisp, high-contrast squares with clean edges, while an FDM printer works in 0.4 mm lines and 0.2 mm layers. Get the module size, data length and colour change right and a printed code scans as fast as a paper one. Get them wrong and you have a nice-looking tile that no phone recognises. This guide gives the numbers and the workflow.
How a QR code is built (and why it matters for printing)
A QR code is a grid of square modules. The smallest, version 1, is 21 × 21 modules; each version adds 4 modules per side, so version 2 is 25 × 25, version 3 is 29 × 29 and version 4 is 33 × 33. Around the grid sits a blank quiet zone that the standard sets at 4 modules wide.
The version is chosen automatically from how much data you encode and which error-correction level you pick. More data means more modules, and at a fixed physical size more modules means each one is smaller and harder to print. That is the single most important relationship in this guide.
What size should a 3D printed QR code be?
Size it from the module, not from the overall code. With a standard 0.4 mm nozzle:
| Module size | Result on a 0.4 mm nozzle |
|---|---|
| Under 1.0 mm | Corners round off, gaps between modules close up; scanning is unreliable |
| 1.0–1.2 mm | Works with a well-tuned printer and a short URL; little margin |
| 1.5–2.0 mm | Reliable default; 4–5 extrusion lines per module |
| 2.5 mm and up | Very robust; scans from further away, good for signs |
A practical rule: make each module at least 3–4 nozzle widths wide. With a 0.2 mm nozzle you can go smaller, but a resin printer is the better tool for very small codes.
Worked example: a version 2 code (25 modules) at 1.5 mm per module is 37.5 mm across. Add a 4-module quiet zone on each side (2 × 6 mm) and the printed tile is 49.5 mm square. The same data as a version 4 code (33 modules) at the same module size needs 61.5 mm.
Scanning distance scales with size too. A common rule of thumb is that a code reads reliably from up to about 10 times its width, so a 40 mm code is comfortable at arm's length and a sign meant to be read from 2 m needs a code around 200 mm wide.
Keep the data short
Because size is fixed by the module, the cheapest way to get a smaller or more robust code is to encode fewer characters. Byte-mode capacity for the first few versions:
| Version (modules) | L | M | Q | H |
|---|---|---|---|---|
| 1 (21 × 21) | 17 | 14 | 11 | 7 |
| 2 (25 × 25) | 32 | 26 | 20 | 14 |
| 3 (29 × 29) | 53 | 42 | 32 | 24 |
| 4 (33 × 33) | 78 | 62 | 46 | 34 |
A URL like https://example.com/menu is 24 characters and fits version 2 at level M. A long link with tracking parameters can easily push you to version 5 or 6. Use a short domain or a redirect you control; the redirect also lets you change the destination later without reprinting.
Which error-correction level to use
QR codes include redundant data so they can be read even when part of the code is damaged or unclear. There are four levels:
- L – recovers about 7% of the data
- M – about 15%
- Q – about 25%
- H – about 30%
For printed codes, M is a good default and Q is worth it for outdoor signs or tags that will get scratched. Use H only if you plan to place a logo over the centre. Higher levels add modules, so check that the module size still meets the minimum above.
How to get enough contrast
A scanner looks for dark modules on a light background. Shape alone (a raised pattern in a single colour) relies on shadows and usually fails under flat lighting. You need two colours. The common methods:
Colour change at layer height
Print the base plate in a light colour, then pause and swap to a dark filament at the first layer of the raised modules. In most slicers you add a filament change or pause at that height in the layer preview (for Marlin printers this inserts M600 or a pause command). It works on any single-extruder printer and is the most common approach.
Face-down inlay
Model the code flush with the surface, place that face on the bed, and print the first 2–3 layers (0.4–0.6 mm) with the modules in dark filament and the background in light, using a multi-material system or manual swaps. The result is perfectly flat with the bed's texture, which scans very well and survives handling.
Multi-material printers
With an AMS, MMU or tool changer, assign the module bodies and the base to different filaments. Expect purge waste on every layer that contains both colours, so keep the two-colour section thin.
Whatever the method, use matte filament where you can. Glossy or silk PLA creates specular highlights that wash out modules at some angles. Black on white is best; dark blue or dark green on white also work. Avoid light-on-dark (inverted) codes: some scanners handle them, many do not.
Raised vs recessed QR codes
| Raised modules | Recessed modules | |
|---|---|---|
| Colour change | Easy: swap at one layer height | Needs fill (paint, epoxy) or inlay |
| Durability | Edges can chip or wear | Protected below the surface |
| Dirt | Stays clean | Collects dust in pockets |
| Typical depth | 0.6–1.0 mm (3–5 layers at 0.2 mm) | 0.6–1.0 mm |
For most projects, raised modules with a colour change are the easiest. Keep the height low; tall modules cast shadows that make adjacent light modules look dark when the light comes from the side.
Step-by-step: printing a QR code
- Shorten the content (URL, Wi-Fi string or text) as much as practical.
- Open the QR code STL generator, enter the content and choose error-correction level M or Q.
- Set the module size to 1.5–2 mm, the base thickness to 1.5–2 mm and the module height to 0.6–1 mm. Keep the full 4-module quiet zone.
- Download the STL and check it in the STL viewer: confirm the overall size and that the modules are separated by clean gaps.
- Slice with 0.2 mm layers (0.12–0.16 mm if modules are close to 1 mm). Add a filament change at the first layer above the base.
- Print the first layer slowly; an uneven first layer distorts every module above it.
- Test before mounting (see below).
Want text or a label beside the code? Generate it separately with the text to STL tool and combine the parts in your slicer.
How to test whether your printed QR code scans
- Scan with at least two phones, ideally one iPhone and one Android, using the default camera app.
- Try three lighting conditions: diffuse daylight, a single overhead lamp, and light from the side.
- Try angles up to about 45° and distances from close-up to the intended viewing distance.
- If it fails, inspect the corners of the three large position markers first. Merged or blobby finder patterns are the usual culprit; increase module size or lower layer height.
Print a quick test of just the bottom 1–2 mm before committing to a large sign. It costs a few grams of filament and catches nearly every problem.
Uses: signs, tags, Wi-Fi and NFC combos
- Wi-Fi guest tile: encode
WIFI:T:WPA;S:NetworkName;P:password;;and phones offer to join the network when scanned. - Table and shelf signs: menus, product pages, manuals; mount on a wedge stand angled 60–75° so the code faces the user.
- Equipment and asset tags: link to a manual or service log; use PETG or ASA outdoors, as PLA softens in hot sun.
- QR + NFC: add a pocket sized for an NFC sticker or coin tag (NTAG21x tags are commonly 25 mm across), pause the print above the pocket, drop the tag in and print over it. A 0.6–1 mm PLA cover does not stop a phone reading it. Phones that do not scan QR codes can tap instead.
- Logos and branding: extrude a logo with SVG to STL and place it beside the code rather than on top of it, unless you use level H.
FAQ
What is the minimum size for a 3D printed QR code?
It depends on module size, not overall size. With a 0.4 mm nozzle, keep modules at least 1–1.2 mm, preferably 1.5 mm. A short URL at version 2 then needs a tile of about 40–50 mm including the quiet zone.
Can a single-colour 3D printed QR code be scanned?
Sometimes, under strong side lighting, but not reliably. Scanners need contrast between dark and light modules. Use a filament change, an inlay, or paint the raised tops with a dark marker.
Which error-correction level is best for 3D printing?
M (about 15% recovery) suits most indoor items. Use Q (about 25%) for outdoor or heavily handled pieces, and H only when you intend to cover part of the code with a logo.
Should the quiet zone be included in the print?
Yes. The standard calls for a 4-module light border. If the code sits on a dark or busy surface without it, scanners often fail to find the edges.