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:
- Finder patterns — the three large squares in the corners. These let scanners detect the code's position and orientation, even at an angle.
- Alignment patterns — smaller squares that appear in larger codes to correct for surface distortion (like a code printed on a curved bottle).
- Timing patterns — alternating black and white modules between the finder patterns that help the scanner determine module size and grid coordinates.
- Data and error correction area — everything else. This is where your actual content lives, interleaved with error correction codewords.
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:
| Mode | Characters | Bits per character | Max capacity |
|---|---|---|---|
| Numeric | 0-9 | ~3.3 | 7,089 digits |
| Alphanumeric | 0-9, A-Z, space, $%*+-./: | ~5.5 | 4,296 chars |
| Byte | Any (ISO 8859-1 / UTF-8) | 8 | 2,953 bytes |
| Kanji | Shift JIS double-byte | 13 | 1,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:
| Level | Recovery capacity | Use 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.
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:
- Custom colors — dark blue modules on a light background instead of black on white. The key constraint: maintain high contrast between foreground and background.
- Rounded modules — replacing sharp squares with rounded rectangles or dots. Most scanners handle this fine as long as the module positions remain accurate.
- Logo overlays — placing a small image (company logo, icon) in the center of the code. This physically destroys some data modules, so you need error correction level Q or H to compensate.
- Gradient fills — applying a color gradient across the modules. This can reduce contrast at certain points, so test thoroughly.
- Custom finder patterns — redesigning the three corner squares with brand-specific shapes. Risky — some scanners rely on exact finder pattern geometry.
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:
- URLs and landing pages — the most common use. Print ads, business cards, product packaging, event flyers. Scan to visit a website without typing.
- Wi-Fi network sharing — encode your network name, password, and encryption type. Guests scan the code and connect automatically. The format is
WIFI:T:WPA;S:NetworkName;P:Password;; - Contact information (vCard) — encode a full vCard with name, phone, email, and address. Scanning adds the contact directly to the phone's address book.
- Payment — widely used in mobile payment systems. In many countries, QR-based payments have largely replaced card taps for small transactions.
- Event tickets and boarding passes — airlines, concert venues, and transit systems encode ticket data in QR codes for fast, scannable entry.
- Restaurant menus — accelerated by the pandemic. A table-top QR code linking to a digital menu saves printing costs and allows real-time updates.
- Authentication and 2FA — apps like Google Authenticator use QR codes to transfer TOTP secrets during setup. Scan once, generate codes forever.
- Inventory and asset tracking — manufacturing, warehousing, and IT asset management. QR codes hold more data than traditional barcodes and can be read from any orientation.
Generate QR codes for free — no signup, no watermarks, no limits.
Try qrmcp.devFree 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:
- qrmcp.dev — free, no signup required. Generates clean QR codes with customizable error correction levels. Good for developers who want straightforward output without the marketing noise.
- Python's
qrcodelibrary — if you need to generate codes programmatically,pip install qrcode[pil]gives you full control. Great for batch generation or integrating QR codes into automated workflows. - Browser-based JavaScript libraries — libraries like
qrcode.jsgenerate codes entirely client-side. No data leaves the browser, which matters if you're encoding sensitive information like Wi-Fi passwords.
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.