Skip to the tool workspace
Browser 123

How-to QR codes

How to add a logo to a QR code without breaking it

Why a logo fits in a QR code at all, how big it can be at each error correction level, and how to check the result still scans.

A QR code can hold a logo because of error correction: part of every code is spare data, from which a reader rebuilds whatever it cannot read. A logo uses that budget on purpose. Use too much of it and the code stops scanning.

The budget per level

Level Restores about With a logo
L 7% No
M 15% Only a small one
Q 25% Yes
H 30% Yes, the best choice

These are shares of the code's data, not of its area. A logo that covers a fifth of the width covers about 4% of the area, which leaves level H plenty of room for a crease, a reflection or a dirty lens. The higher the level, the denser the code, so it needs a little more space for the same content.

What a logo must not cover

  • The three finder patterns in the corners. Readers find the code by them.
  • The quiet zone, the empty margin around the code.
  • More than the level can rebuild. Leave room: a code that only just scans on your screen will fail on a curved bottle.

On the command line

The direct wayqrencode + ImageMagickLinux · macOS · Windows (WSL)

Make the code at level H, then place the logo in the centre with ImageMagick. The code below is 444 pixels wide, so a 90-pixel logo is about a fifth of it:

qrencode -o code.png -s 12 -m 4 -l H "https://example.com"
convert code.png \( logo.png -resize 90x90 \) -gravity center -composite code-logo.png

Read it back to check it still scans:

zbarimg --raw code-logo.png
Add a logo safely
  1. Set error correction to H.
  2. Add the logo in the middle, at about a fifth of the code's width.
  3. Check the code still scans, and that it still does printed small and in dim light.
  4. If it is marginal, make the logo smaller before you make the code bigger.

Questions people ask

How big can a logo in a QR code be?

It depends on the error correction level. Level H restores about 30% of the data, so the logo has to cover less than that, with room to spare for wear and bad light. About a fifth of the code's width is a common, safe starting point.

Does the logo have to be in the middle?

The middle is safest. The three large squares in the corners are the finder patterns readers locate the code by, and a logo must never cover them.

Should I remove the modules behind the logo?

It looks cleaner and makes no difference to error correction: the covered modules have to be rebuilt either way.

Tools in this guide

Everything runs on your device

All guides

/
123 items
Runs in your browser·Your files stay on this device
Out0 B
Ready—