How to 3D print a two-colour QR code with a single-nozzle printer

You do not need an AMS or a multi-material unit. A QR code is flat: the base is one colour up to a certain height and the code is another colour above it. One filament change at the right layer is all it takes.

Updated 17 October 2026 · 7 min read

Why two colours (and not just a raised code)

A phone does not read the relief, it reads the difference in brightness between the little squares and the background. A white code raised 1 mm on a white base looks great on a shelf, but under even light the camera sees one flat white surface and gives up. With a dark code on a light base it scans at the first try, from any angle.

The good news is that a QR part is the easiest two-colour print there is: every layer is either all base or all code. There is no colour mixing inside a layer, so a single pause is enough.

The height where the code starts

Every 3MF from CodiQR3D is a flat base with the code (and the text) sitting on top. The base thickness depends on the format, and it is chosen to be a multiple of 0.2 mm, so with 0.2 mm layers the change falls exactly between two layers:

FormatBase ends atFirst code layer (0.2 mm layers)
Keychain3.0 mmlayer 16 (3.0–3.2 mm)
Wall plaque3.6 mmlayer 19 (3.6–3.8 mm)
Fridge magnet4.0 mmlayer 21 (4.0–4.2 mm)
Coaster4.0 mmlayer 21 (4.0–4.2 mm)
Business card2.4 mmlayer 13 (2.4–2.6 mm)
Table standNot possible with one pause: the code sits on a 45° face, so it shares layers with the base. Use a multi-material printer, or print the plaque format instead.

The layer numbers assume a 0.2 mm first layer and 0.2 mm layers after it. With other settings, use the rule that never fails: the change goes right before the first layer that shows only the code in the slicer preview.

Cross-section of a QR keychain: white base up to 3 mm and black code from 3 to 4.2 mm, with the filament change between the two filament change base · colour 1 · 0 → 3.0 mm code · colour 2 · 3.0 → 4.2 mm
Keychain cross-section (not to scale). Everything below the dashed line is base colour; everything above it is code colour.

PrusaSlicer

  1. Open the 3MF, slice it and go to the Preview.
  2. Drag the top handle of the vertical layer slider down until you see the first layer where only the code is drawn (3.20 mm on a keychain).
  3. Click the orange + icon next to the handle. That adds a colour change (M600) before that layer.
  4. Export the G-code. When the printer reaches that layer it parks the head, unloads the filament and asks you to load the second colour.

If your printer does not understand M600 (many stock Ender firmwares do not), right-click the + icon and choose Add pause print instead, then swap the filament by hand from the printer menu.

Bambu Studio and OrcaSlicer

  1. Slice the plate and open the Preview tab.
  2. Move the layer slider to the first code-only layer.
  3. Right-click the + next to the slider and choose Add pause. If you have an AMS and two filaments set up, choose Change filament instead and it will do it on its own.
  4. When the printer pauses, unload, load the second colour from the printer screen, purge until the colour comes out clean, and resume.

With an AMS you can skip all this: the 3MF already contains two parts, so you can simply assign filament 1 to the base and filament 2 to the code in the object list.

Cura

  1. Go to Extensions → Post Processing → Modify G-Code and add the Pause at height script (or Filament Change if your firmware supports M600).
  2. Set it to pause by layer number and enter the number of the first code-only layer as Cura shows it in the preview (16 on a keychain with 0.2 mm layers).
  3. Check the result in the preview before printing: the layer just below the pause must still show the whole base.

Careful with the height option: in Cura, pausing at "3.0 mm" usually pauses before the last base layer, so that layer comes out in the code colour and the whole top of the base turns dark. Pausing by layer number avoids it.

The mistakes that ruin the code

No filament change at all?

Print everything in one light colour and paint only the top of the code: roll acrylic paint over it with a small foam roller, or go over it with a paint marker. Because the code is raised, the paint only touches the tops. It takes patience, but it scans just as well.

Frequently asked questions

Do I need an AMS or a multi-material printer?

No. Except for the table stand, every format can be printed in two colours with a single pause at the height where the code starts.

At what height do I change the filament?

Keychain 3.0 mm, wall plaque 3.6 mm, fridge magnet and coaster 4.0 mm, business card 2.4 mm. The change goes before the first layer above that height.

Why can't the table stand be done with a pause?

Its code sits on a 45° face, so every layer contains a bit of base and a bit of code at the same time. It needs a printer that can switch colours within a layer.

Can I use the STL instead of the 3MF?

Yes. The STL download contains two files, base and code, already lined up. Import both together as one object with two parts. The 3MF is simpler because the colours come inside.

How long does the filament change take?

One or two minutes per plate. If you print several keychains at once, they all change colour in the same pause.

More guides

Size, colours and how to print in two colours with a single-nozzle printer.

📏

The right size

A calculator with the minimum size for your link, plus nozzle, layers and scanning distance.

🌈

Colours that scan

Contrast measured between common filament colours, and the finishes that cause trouble.