Guide March 14, 2026

How to Generate QR Codes — Free Tool, Styles & Best Practices

QR codes pack a surprising amount of engineering into a small square. This guide covers how they actually work under the hood, the difference between styled and plain codes, sizing rules for print and screen, and where to generate them for free.

What Is a QR Code?

A QR (Quick Response) code is a two-dimensional barcode invented by Denso Wave in 1994. Unlike traditional barcodes that store data in one direction, QR codes use a grid of black and white modules (squares) to encode information both horizontally and vertically. This means they hold far more data in less space.

Every QR code has a few structural elements you can spot visually:

The format is an open standard (ISO/IEC 18004), and Denso Wave does not charge royalties. Anyone can generate and use QR codes freely.

How QR Codes Encode Data

When you feed a URL, text string, or other data into a QR code generator, several things happen before the final image appears.

Encoding modes

QR codes support four encoding modes, each optimized for different character sets:

ModeCharactersBits per characterMax capacity
Numeric0-9~3.37,089 digits
Alphanumeric0-9, A-Z, space, $%*+-./:~5.54,296 chars
ByteAny (ISO 8859-1 / UTF-8)82,953 bytes
KanjiShift JIS double-byte131,817 chars

The generator picks the most efficient mode automatically. A URL like https://example.com uses Byte mode because it contains lowercase letters. A phone number uses Numeric mode, which is three times more space-efficient.

Error correction

This is the feature that makes QR codes so resilient. Every QR code includes redundant data using Reed-Solomon error correction, which means the code still scans even if part of it is damaged, dirty, or obscured.

There are four error correction levels:

LevelRecovery capacityUse case
L (Low)~7%Clean environments, small codes
M (Medium)~15%General purpose (most common default)
Q (Quartile)~25%Outdoor use, moderate wear
H (High)~30%Harsh environments, logo overlays

Higher error correction means the code can survive more damage, but it also makes the code physically larger (more modules needed to store the redundant data). This is a direct tradeoff: if you want to overlay a logo on your QR code, you need level Q or H, which makes the code denser.

Practical rule: Use level M for most cases. Switch to H only if you plan to add a logo overlay or expect the code to get scuffed up (warehouse labels, outdoor signage).

Versions and module count

QR codes come in 40 "versions," where version 1 is a 21x21 module grid and version 40 is a 177x177 grid. Each version increase adds 4 modules per side. The generator selects the smallest version that fits your data at the chosen error correction level.

Short data (a 30-character URL at level M) produces a version 3 code — just 29x29 modules. Long data pushes the version up, resulting in a denser, harder-to-scan pattern. This is why keeping your encoded content short matters: shorter URLs produce simpler, more scannable codes.

Styled QR Codes vs. Plain QR Codes

A plain QR code is the standard black-on-white grid. It works everywhere and scans instantly. But it looks generic, and for branding purposes, many people want something with more personality.

Styled QR codes modify the appearance while preserving scannability:

Watch out: Every style modification reduces the reliability margin. A plain black-on-white code scans in milliseconds from any angle. A heavily styled code with a logo, gradient, and custom finders might fail on older phones or in poor lighting. Always test styled codes on at least 3-4 different devices before committing to print.

QR Code Best Practices

Keep URLs short

The shorter your encoded data, the fewer modules the code needs, and the easier it scans. If you're encoding a long URL, use a URL shortener or set up a clean redirect path on your own domain. example.com/menu produces a much cleaner code than a 150-character URL with UTM parameters.

Size it for scanning distance

The 10:1 rule works well: divide the expected scanning distance by 10 to get the minimum QR code dimension. A code on a business card (scanned from 15-20cm) can be as small as 2cm. A code on a conference banner (scanned from 3 meters) needs to be at least 30cm.

For print, always export at 300 DPI or higher. Vector formats (SVG, PDF) are ideal because they scale without quality loss.

Maintain contrast

Dark modules on a light background. That is the standard, and it works because every phone camera and scanner is optimized for it. If you invert the colors (light modules on dark background), some older scanners will fail. If you use brand colors, check the contrast ratio — WCAG AA contrast (4.5:1) is a good minimum target.

Add a quiet zone

The "quiet zone" is the blank margin around the QR code. The spec requires a minimum of 4 modules of white space on all sides. Cutting into this margin (by cropping the code or placing it too close to other design elements) is a common cause of scan failures.

Test before printing

This sounds obvious, but it is skipped constantly. Test your code on at least three devices: a recent iPhone, a recent Android phone, and an older device. Test in bright light, dim light, and at the angles your users will actually scan from. For printed codes, test the actual printed version — screens and paper render differently.

Use static codes for permanence

Dynamic QR codes (where the code points to a redirect service) are useful for tracking, but they create a dependency on that service staying online. If the redirect service shuts down or changes its pricing, your printed codes become dead links. For anything with a long lifespan — product packaging, signage, printed materials — encode the final destination URL directly.

Common Use Cases

QR codes have moved well beyond their origin in automotive parts tracking. Here are the most practical applications:

Generate QR codes for free — no signup, no watermarks, no limits.

Try qrmcp.dev

Free QR Code Generators Worth Using

There are hundreds of QR code generators online. Most of them work fine for basic use, but many add watermarks, require accounts, or upsell aggressively. Here are options that actually respect your time:

For most one-off needs — generating a QR code for a business card, a flyer, or a Wi-Fi password — qrmcp.dev handles it without friction. For programmatic or batch use, a library is the better path.

Generating a QR code with Python

If you prefer working in code, the qrcode library is straightforward:

import qrcode

qr = qrcode.QRCode(
    version=None,  # auto-select smallest version
    error_correction=qrcode.constants.ERROR_CORRECT_M,
    box_size=10,
    border=4,
)
qr.add_data("https://example.com")
qr.make(fit=True)

img = qr.make_image(fill_color="black", back_color="white")
img.save("my-qr-code.png")

Set error_correction to ERROR_CORRECT_H if you plan to overlay a logo. The box_size parameter controls pixel density — increase it for higher-resolution output.

Static vs. Dynamic QR Codes

This distinction matters more than most guides acknowledge.

A static QR code encodes the final data directly. The URL, Wi-Fi credentials, or vCard content is baked into the pattern. No server, no redirect, no dependency. The code works offline and will scan correctly for as long as the physical code exists.

A dynamic QR code encodes a short redirect URL (usually from the generator's domain). When scanned, the redirect forwards to your actual destination. This gives you analytics (scan counts, locations, timestamps) and the ability to change the destination URL without reprinting the code.

The tradeoff: dynamic codes depend on the redirect service. If that service goes offline, raises prices, or changes terms, every printed code pointing to it breaks. For printed materials with a long shelf life, static codes are the safer choice.

Frequently Asked Questions

What is the maximum amount of data a QR code can store?
A single QR code can hold up to 7,089 numeric characters, 4,296 alphanumeric characters, or 2,953 bytes of binary data. In practice, shorter content produces smaller, more reliable codes. A URL under 100 characters generates a clean code that scans quickly even at small sizes.
Do QR codes expire?
Static QR codes never expire — the data is encoded directly in the pattern and will scan forever as long as the code is intact. Dynamic QR codes (which encode a redirect URL) can effectively expire if the redirect service shuts down or the destination URL changes. If you want a permanent code, encode the final URL directly rather than using a redirect service.
Can I put a logo in the center of a QR code?
Yes, but only if you use a higher error correction level (Q or H). Error correction level H can recover up to 30% of damaged data, which gives you enough room to overlay a small logo in the center. Keep the logo under 20% of the total QR code area and always test the code with multiple scanning apps before printing.
What size should a QR code be for printing?
The minimum recommended size depends on scanning distance. For close-range scanning (handheld, business cards), 2cm x 2cm (0.8in) works if the code is simple. For posters or signs scanned from a distance, use the 10:1 rule — the code should be at least 1/10th of the expected scanning distance. A sign scanned from 1 meter away needs a code at least 10cm wide. Always export at 300 DPI or higher for print.
Are QR codes free to generate and use?
Yes. The QR code specification (ISO/IEC 18004) is openly available, and Denso Wave (the original inventor) does not charge royalties for generating or using QR codes. Many free QR code generators exist, including qrmcp.dev. The only costs you might encounter are from premium features like analytics tracking or dynamic redirect management offered by some commercial services.