DevToolBoxฟรี
บล็อก

QR Code Generator Online — Create Custom QR Codes Free

15 min readโดย DevToolBox

TL;DR

A QR code generator creates two-dimensional barcodes that encode URLs, text, WiFi credentials, contact cards, and more. Use SVG format for maximum quality and scalability. Choose error correction Level M (15%) for most use cases, or Level H (30%) if embedding a logo. Keep encoded data short (use URL shorteners for long links). For developers, the qrcode npm package (JavaScript) and qrcode pip library (Python) provide full programmatic control. You can generate QR codes online for free instantly with our tool.

Key Takeaways

  • QR codes are two-dimensional matrix barcodes that store data in both horizontal and vertical patterns, supporting up to 7,089 numeric characters.
  • Error correction uses Reed-Solomon codes with four levels: L (7%), M (15%), Q (25%), and H (30%), trading capacity for damage resilience.
  • Static QR codes encode data directly and cannot be changed; dynamic QR codes use redirect URLs that can be updated and tracked.
  • SVG format is recommended as the master output because it scales to any size without quality loss.
  • WiFi QR codes use the WIFI:T:WPA;S:SSID;P:password;; format to enable one-scan network connection.
  • Business applications include restaurant menus, contactless payments, product packaging, event tickets, and digital business cards.
  • Programmatic generation is available via the qrcode npm package, Python qrcode library, and the Web Crypto-compatible QR encoding APIs.
  • Best practices: maintain a 4-module quiet zone, use dark modules on light background, keep data minimal, and test on multiple devices.

What Is a QR Code? History and Fundamentals

A QR code (Quick Response code) is a two-dimensional matrix barcode that was invented by Masahiro Hara and his team at Denso Wave, a subsidiary of the Toyota Group, in 1994. Originally designed to track automotive parts during manufacturing, QR codes have since become the universal standard for encoding machine-readable data in a compact visual format.

Unlike traditional one-dimensional barcodes (like UPC codes on groceries) that encode data only in horizontal lines, QR codes store information in both horizontal and vertical directions across a grid of black and white squares called modules. This two-dimensional encoding allows QR codes to hold dramatically more data: up to 7,089 numeric characters, 4,296 alphanumeric characters, or 2,953 bytes of binary data at maximum capacity.

The "Quick Response" name reflects the original design goal: a barcode that could be scanned and decoded rapidly, even at high speed on a manufacturing line. Modern smartphones can decode a QR code in under 100 milliseconds using their built-in camera apps, making QR codes the fastest and most convenient way to transfer small amounts of data from the physical world to a digital device.

QR codes are an open standard (ISO/IEC 18004:2015) and are free to use without any licensing fees. This openness, combined with the ubiquity of smartphone cameras, has driven massive adoption across industries: marketing, payments, logistics, healthcare, education, hospitality, and government services.

Try our free QR Code Generator to create custom QR codes instantly for URLs, text, WiFi, vCards, and more.

QR Code Structure: Anatomy of a QR Code

Understanding the internal structure of a QR code helps you make better decisions about sizing, error correction, and design customization. Every QR code consists of several functional regions:

Finder Patterns: The three large squares located in the top-left, top-right, and bottom-left corners of every QR code. These distinctive patterns allow scanners to detect the presence of a QR code, determine its orientation, and calculate the angle of rotation. Each finder pattern is a 7x7 module square with alternating black-white-black rings. The absence of a finder pattern in the bottom-right corner is intentional and helps the scanner determine the correct orientation.

Alignment Patterns: Smaller squares (5x5 modules) that appear in QR codes of Version 2 and above. They help the scanner correct for perspective distortion when the code is photographed at an angle or on a curved surface. The number and position of alignment patterns increase with higher versions.

Timing Patterns: Alternating black and white modules that run horizontally between the top finder patterns and vertically between the left finder patterns. These patterns help the scanner determine the size of individual modules and synchronize its reading grid.

Format Information: A 15-bit data strip that encodes the error correction level and the mask pattern used. This information is stored redundantly in two locations for reliability.

Version Information: Present in QR codes Version 7 and above, this 18-bit field encodes the version number, allowing the scanner to determine the code dimensions.

Data and Error Correction Codewords: The remaining area contains the actual encoded data interleaved with Reed-Solomon error correction codewords. The data is split into segments, each preceded by a mode indicator (numeric, alphanumeric, byte, or kanji) and a character count.

Quiet Zone: The mandatory white border surrounding the entire QR code. The quiet zone must be at least 4 modules wide on all sides. This blank area tells the scanner where the QR code boundary is. Cropping or reducing the quiet zone is the most common cause of scanning failures.

QR Code Version Reference:
+----------+--------------+-------------------------------------+
| Version  | Modules      | Typical Use Case                    |
+----------+--------------+-------------------------------------+
| 1        | 21 x 21      | Short numeric codes, tiny URLs      |
| 2        | 25 x 25      | Short URLs with UTM tracking        |
| 3        | 29 x 29      | Standard URLs (50-70 chars)         |
| 5        | 37 x 37      | Long URLs, basic vCard              |
| 10       | 57 x 57      | Full vCard, WiFi config             |
| 15       | 77 x 77      | Large text blocks, detailed data    |
| 20       | 97 x 97      | Very large data payloads            |
| 40       | 177 x 177    | Maximum capacity (rarely needed)    |
+----------+--------------+-------------------------------------+

Types of QR Codes: Static vs Dynamic and Content Types

QR codes can be categorized in two fundamental ways: by their mutability (static vs dynamic) and by the type of data they encode.

Static QR Codes

Static QR codes embed the actual data (URL, text, phone number, etc.) directly into the module pattern. Once generated and printed, the content cannot be modified. Static codes are completely self-contained, work offline without any server dependency, are free to generate and use without subscriptions, and have no scan limits or expiration dates. The limitation is that any change to the content requires generating and reprinting a new QR code.

Dynamic QR Codes

Dynamic QR codes encode a short redirect URL (e.g., https://qr.example.com/abc123) instead of the actual destination. The redirect server maps this short URL to the real target and can be updated at any time. This provides several advantages: the destination URL can be changed without reprinting, scan analytics (count, location, device, time) are tracked automatically, expiration dates and access rules can be configured, and A/B testing between different landing pages becomes possible.

Dynamic codes typically require a subscription service. They depend on the redirect server being available, so if the service goes down or the subscription expires, the QR code stops working.

QR Code Content Types and URI Formats

QR codes can encode various structured data formats. Here are the most common content types with their encoding schemes:

Content TypeEncoding FormatExample
URLhttps://example.comOpens in browser
Plain TextAny UTF-8 textDisplayed as text
WiFiWIFI:T:WPA;S:SSID;P:pass;;Auto-connect to WiFi
Phonetel:+15551234567Initiates phone call
SMSsms:+15551234567?body=HelloOpens SMS with pre-filled text
Emailmailto:user@example.com?subject=HiOpens email client
vCardBEGIN:VCARD...END:VCARDAdds contact to phone
Geo Locationgeo:40.7128,-74.0060Opens map at location
Calendar EventBEGIN:VEVENT...END:VEVENTAdds event to calendar

Error Correction Levels: L, M, Q, and H Explained

QR codes use Reed-Solomon error correction, the same mathematical technique used in CDs, DVDs, and satellite communications, to allow scanning even when part of the code is damaged, dirty, or obscured. There are four error correction levels, each representing a different trade-off between data capacity and damage resilience:

LevelRecoveryBest ForTrade-off
L (Low)~7%Clean digital screens, maximum data capacityMaximum capacity, minimum resilience
M (Medium)~15%General purpose (recommended default)Balanced capacity and resilience
Q (Quartile)~25%Industrial, outdoor, textured surfacesReduced capacity, high resilience
H (High)~30%Logo embedding, harsh environmentsMinimum capacity, maximum resilience

How error correction works: Reed-Solomon encoding adds redundant parity codewords to the actual data. When a scanner reads the QR code, it uses these parity codewords to detect which modules have been misread (due to damage, dirt, or poor scanning conditions) and mathematically reconstructs the correct data. The higher the error correction level, the more parity codewords are added, leaving fewer codewords available for actual data content.

Recommendation: Use Level M as the default for most applications. It provides a solid balance between data capacity and damage tolerance. Use Level H if you plan to embed a logo in the center of the QR code, since the logo effectively destroys the modules underneath it and the scanner relies on error correction to recover that data. Use Level L only when you need absolute maximum data capacity and the code will be displayed in a controlled, clean digital environment.

Data Capacity: How Much Can a QR Code Store?

The maximum number of characters a QR code can hold depends on the encoding mode, error correction level, and QR code version. Here is the data capacity for a Version 40 QR code (the maximum size at 177x177 modules):

Data TypeLevel LLevel MLevel QLevel H
Numeric (0-9)7,0895,5963,9933,057
Alphanumeric4,2963,3912,4201,852
Binary (bytes)2,9532,3311,6631,273
Kanji1,8171,4351,024784

Practical advice: These are theoretical maximums. In practice, you should keep data as short as possible. A URL-shortened link (30-50 characters) fits in a Version 3-4 code (29x29 to 33x33 modules) that is easy to scan at small print sizes. Every additional character increases the version number, adding more modules and requiring the code to be printed larger to remain scannable. For URLs, always include the full protocol (https://). Without it, many scanners treat the content as plain text rather than a clickable link.

How to Generate QR Codes Programmatically

While online tools like our QR Code Generator are great for one-off creation, developers often need to generate QR codes programmatically for applications, APIs, batch processing, or dynamic content. Here is how to do it in JavaScript and Python.

JavaScript / Node.js with the qrcode Package

The qrcode npm package is the most popular QR code library in the JavaScript ecosystem with over 5 million weekly downloads. It supports multiple output formats, all four error correction levels, and both browser and Node.js environments.

// Install: npm install qrcode

const QRCode = require('qrcode');

// Generate QR code as a data URL (base64 PNG)
async function generateQRCodeImage(text) {
  try {
    const dataUrl = await QRCode.toDataURL(text, {
      errorCorrectionLevel: 'M',
      type: 'image/png',
      width: 400,
      margin: 2,
      color: {
        dark: '#000000',
        light: '#ffffff',
      },
    });
    console.log('Data URL:', dataUrl);
    return dataUrl;
  } catch (err) {
    console.error('QR generation failed:', err);
  }
}

// Generate QR code as SVG string
async function generateQRCodeSVG(text) {
  try {
    const svg = await QRCode.toString(text, {
      type: 'svg',
      errorCorrectionLevel: 'H',
      margin: 2,
    });
    console.log('SVG output:', svg);
    return svg;
  } catch (err) {
    console.error('SVG generation failed:', err);
  }
}

// Generate QR code to file (Node.js)
async function generateQRCodeFile(text, filePath) {
  try {
    await QRCode.toFile(filePath, text, {
      errorCorrectionLevel: 'M',
      type: 'png',
      width: 600,
      margin: 3,
    });
    console.log('QR code saved to', filePath);
  } catch (err) {
    console.error('File generation failed:', err);
  }
}

// Usage examples
generateQRCodeImage('https://viadreams.cc');
generateQRCodeSVG('WIFI:T:WPA;S:MyNetwork;P:SecurePass123;;');
generateQRCodeFile('https://example.com', './qr-code.png');

Browser-Side QR Code Generation

The same qrcode package works in the browser with a slightly different API. You can render QR codes directly into a Canvas element or generate data URLs for display in <img> tags:

// In a browser environment (using ES module import)
import QRCode from 'qrcode';

// Render to a Canvas element
const canvas = document.getElementById('qr-canvas');
QRCode.toCanvas(canvas, 'https://example.com', {
  errorCorrectionLevel: 'M',
  width: 256,
}, function (error) {
  if (error) console.error(error);
  console.log('QR code rendered to canvas');
});

// Generate as data URL for an <img> tag
QRCode.toDataURL('https://example.com', {
  width: 300,
  margin: 2,
  errorCorrectionLevel: 'M',
}).then(url => {
  const img = document.createElement('img');
  img.src = url;
  img.alt = 'QR Code';
  document.body.appendChild(img);
});

Python with the qrcode Library

The qrcode Python library is the standard choice for server-side QR code generation. It supports all error correction levels, custom colors, and multiple image formats through the Pillow (PIL) backend.

# Install: pip install qrcode[pil]

import qrcode
from qrcode.constants import ERROR_CORRECT_L, ERROR_CORRECT_M, ERROR_CORRECT_Q, ERROR_CORRECT_H

# Basic QR code generation
def generate_basic_qr(data, filename='qr_code.png'):
    """Generate a simple QR code and save as PNG."""
    img = qrcode.make(data)
    img.save(filename)
    print(f"QR code saved to {filename}")

# Advanced QR code with custom settings
def generate_custom_qr(data, filename='qr_custom.png'):
    """Generate a QR code with custom error correction,
    box size, border, and colors."""
    qr = qrcode.QRCode(
        version=None,  # Auto-detect smallest version
        error_correction=ERROR_CORRECT_H,  # 30% recovery
        box_size=10,   # Pixels per module
        border=4,      # Quiet zone width in modules
    )
    qr.add_data(data)
    qr.make(fit=True)

    # Create image with custom colors
    img = qr.make_image(
        fill_color='#1a1a2e',   # Dark navy modules
        back_color='#ffffff',    # White background
    )
    img.save(filename)
    print(f"Custom QR code saved to {filename}")
    print(f"Version: {qr.version}")
    print(f"Modules: {qr.modules_count}x{qr.modules_count}")

# Generate SVG output
def generate_svg_qr(data, filename='qr_code.svg'):
    """Generate QR code as SVG using the svg factory."""
    import qrcode.image.svg

    factory = qrcode.image.svg.SvgPathImage
    qr = qrcode.QRCode(
        error_correction=ERROR_CORRECT_M,
        box_size=10,
        border=4,
    )
    qr.add_data(data)
    qr.make(fit=True)

    img = qr.make_image(image_factory=factory)
    img.save(filename)
    print(f"SVG QR code saved to {filename}")

# WiFi QR code
def generate_wifi_qr(ssid, password, encryption='WPA'):
    """Generate a WiFi connection QR code."""
    wifi_string = f"WIFI:T:{encryption};S:{ssid};P:{password};;"
    generate_custom_qr(wifi_string, 'wifi_qr.png')

# Usage
generate_basic_qr('https://viadreams.cc')
generate_custom_qr('https://example.com/my-page')
generate_svg_qr('Hello, QR Code!')
generate_wifi_qr('OfficeNetwork', 'SuperSecure2026!')

QR Codes for Business: Menus, Payments, WiFi, and More

QR codes have transformed how businesses interact with customers. Here are the most impactful business applications and how to implement them effectively.

Restaurant Menus and Hospitality

Digital menus via QR codes exploded during the COVID-19 pandemic and remain standard practice. Place QR codes on table tents, coasters, or wall displays that link to your digital menu. Use a URL shortener or dynamic QR code so you can update menu items and prices without reprinting codes. Best practice: link to a mobile-optimized menu page (not a PDF) that loads in under 2 seconds. Include your restaurant name in the QR code label so customers know what they are scanning.

Contactless Payments

QR code payments are the dominant mobile payment method in many markets. Payment QR codes typically encode a payment URI that the customer's banking or payment app (PayPal, Venmo, Cash App, WeChat Pay, Alipay, UPI) interprets to pre-fill the recipient and amount. For point-of-sale, display a unique QR code per transaction. For tips and donations, a static QR code linking to a payment page works well. Always test the payment flow end-to-end before deploying.

WiFi Access for Guests

Instead of printing WiFi passwords on cards or walls, generate a WiFi QR code using the WIFI:T:WPA;S:NetworkName;P:Password;; format. When guests scan the code, their phone automatically connects to the network. This is ideal for hotels, cafes, co-working spaces, conference rooms, and Airbnb properties. Print the QR code at a size of at least 3cm x 3cm with clear labeling like "Scan for WiFi".

WiFi QR Code Format:
WIFI:T:<encryption>;S:<SSID>;P:<password>;H:<hidden>;;

Parameters:
  T = Encryption type: WPA, WEP, nopass (open network)
  S = SSID (network name) - use \; to escape semicolons
  P = Password - use \; to escape semicolons
  H = Hidden network: true or false (optional, default false)

Examples:
  WIFI:T:WPA;S:CoffeeShop_Free;P:Welcome2026!;;
  WIFI:T:nopass;S:PublicLibrary;;
  WIFI:T:WPA;S:HiddenOffice;P:s3cure!pass;H:true;;

Product Packaging and Inventory

QR codes on product packaging can link to user manuals, warranty registration, how-to videos, nutritional information, sustainability certifications, or augmented reality experiences. In logistics and warehousing, QR codes track inventory, shipments, and assets through the supply chain. For product authentication, each item gets a unique QR code that customers can scan to verify authenticity against a database.

Digital Business Cards (vCard QR Codes)

A vCard QR code encodes contact information in the standard vCard format. When scanned, the phone prompts the user to save the contact directly to their address book. This eliminates manual data entry and ensures accuracy. Include your name, job title, company, phone, email, website, and even a small photo URL. The vCard 3.0 format is most widely supported across devices.

Event Tickets and Check-In

QR codes on event tickets (digital or printed) serve as the entry credential. At the venue, staff scan the QR code with a dedicated app that validates the ticket against a database, marks it as used (preventing re-entry), and logs the check-in time. Each ticket should contain a unique identifier (UUID or hash) rather than sensitive personal data. Dynamic QR codes allow you to revoke or transfer tickets by updating the server-side mapping.

Best Practices for QR Code Design and Deployment

A well-designed QR code balances functionality with aesthetics. Follow these guidelines to ensure your QR codes scan reliably across all devices and conditions.

Size and Scanning Distance

The fundamental rule is the 10:1 ratio: a QR code should be at least 1/10th of the expected scanning distance. For handheld scanning at 30cm (12 inches), the code needs to be at least 3cm (1.2 inches) wide. For print materials (business cards, flyers), the absolute minimum is 2cm x 2cm (0.8 x 0.8 inches). For digital screens, use at least 240x240 pixels for standard displays or 320x320 CSS pixels for high-DPI (Retina) screens. For billboards at 10 meters, the code must be at least 1 meter x 1 meter.

Color and Contrast

QR codes work best with high contrast between modules and background. The standard is black modules on a white background. You can customize colors, but you must follow these rules: always use dark modules on a light background (never invert), maintain a minimum contrast ratio of 4:1 between foreground and background, avoid gradients on modules, never use transparent backgrounds, and test on at least 3 different devices before deploying colored codes.

Quiet Zone

The quiet zone is the mandatory white border surrounding the QR code. It must be at least 4 modules wide on all four sides. This blank area is how scanners determine where the QR code begins and ends. Cropping or encroaching on the quiet zone is the single most common cause of scanning failures. Never place text, logos, borders, or other design elements within the quiet zone.

Logo Embedding

You can place a logo in the center of a QR code, but only if you use error correction Level H (30%). The logo should cover no more than 10-15% of the total code area. Place it precisely in the center, add a white padding border around it so it does not blend into surrounding modules, and test on at least 5 different devices and scanning apps before deployment. The logo area destroys the modules underneath it, so the scanner relies entirely on error correction to recover that data.

Output Format

Always generate QR codes as SVG first. SVG is a vector format that scales to any size without quality loss, making it the ideal master format. Use SVG directly for web display and responsive layouts. For print, export the SVG to a high-resolution PNG (at least 1000x1000 pixels at 300 DPI) or embed the SVG in a PDF. Never generate a small raster PNG and then upscale it, because upscaling creates blurry module edges that scanners cannot reliably read.

QR Code Scanning Tips: Troubleshooting Common Issues

If your QR code does not scan reliably, here is a systematic troubleshooting guide:

  • Increase the size: If the code is smaller than 2cm printed or under 240px on screen, make it larger. This is the most common fix.
  • Check the quiet zone: Ensure there is a clear white border of at least 4 modules around the entire code. No text, images, or borders should encroach on this space.
  • Improve contrast: Switch to standard black-on-white if you are using custom colors. Verify the contrast ratio is at least 4:1.
  • Reduce data: If the code looks very dense (many tiny modules), shorten the encoded data. Use a URL shortener for long links.
  • Check the URL: Verify the encoded URL is correct, includes the https:// protocol, does not have typos, and the destination server is responding.
  • Test on multiple devices: Try iOS (Camera app), Android (Google Lens or built-in camera), and at least one dedicated QR scanner app. Different scanners have different tolerance levels.
  • Check lighting: Glare from glossy surfaces, extreme brightness (direct sunlight), and very dim environments can all interfere with scanning. Try different angles to reduce reflections.
  • Verify print quality: Blurry printing, low ink, misalignment, or printing on a textured surface can degrade module clarity. Use high-resolution source files (SVG or 300 DPI minimum).
  • Increase error correction: If the code will be placed in a harsh environment (outdoor, factory floor, packaging that gets handled roughly), increase to Level Q or H.

Dynamic vs Static QR Codes: Which Should You Choose?

The choice between static and dynamic QR codes is one of the most important decisions when planning a QR code campaign. Here is a detailed comparison to help you decide:

FeatureStatic QR CodeDynamic QR Code
Editable after printing?NoYes (change destination URL anytime)
Scan trackingNo analyticsFull analytics (scans, location, device)
Works offlineYes (data in code)No (requires redirect server)
CostFreeSubscription-based
Code densityVaries (depends on data length)Always small (short redirect URL)
ExpirationNever expiresCan expire if service is cancelled
Best forWiFi, vCards, personal use, permanent linksMarketing campaigns, A/B testing, temporary promotions

Recommendation: Use static QR codes for WiFi access, vCard contacts, permanent website URLs, and any scenario where the content will not change and you do not need analytics. Use dynamic QR codes for marketing campaigns, product packaging (where you might need to update landing pages), event promotions, and any context where scan analytics are valuable for measuring ROI.

Advanced QR Code Use Cases

Two-Factor Authentication (2FA)

Time-based One-Time Password (TOTP) authentication apps like Google Authenticator, Authy, and 1Password use QR codes to exchange the shared secret key. The QR code encodes a otpauth:// URI containing the secret, issuer name, account name, algorithm, digit count, and time period. When the user scans the QR code with their authenticator app, the secret is securely transferred and the app begins generating 6-digit rotating codes.

// TOTP Authentication QR Code URI format:
// otpauth://totp/LABEL?secret=SECRET&issuer=ISSUER&algorithm=SHA1&digits=6&period=30

// Example:
otpauth://totp/MyApp:user@example.com?secret=JBSWY3DPEHPK3PXP&issuer=MyApp&algorithm=SHA1&digits=6&period=30

Cryptocurrency Payments

Bitcoin, Ethereum, and other cryptocurrency wallets use QR codes to encode payment addresses and optionally pre-fill the amount. The Bitcoin URI format is bitcoin:ADDRESS?amount=VALUE&label=DESCRIPTION. This prevents typos when entering long cryptocurrency addresses manually and streamlines the payment flow in physical stores, donation pages, and peer-to-peer transactions.

Healthcare and Vaccine Certificates

During the COVID-19 pandemic, many countries adopted QR codes for digital vaccine certificates (EU Digital COVID Certificate, WHO Smart Vaccination Certificate). These QR codes encode digitally signed health credentials in compact binary formats (CBOR + COSE for the EU DCC). The digital signature prevents forgery while the QR code enables instant verification at borders and venues. This same technology is now being explored for broader digital health records and identity verification.

Common QR Code Mistakes to Avoid

Avoid these frequent mistakes that lead to scanning failures, poor user experience, and wasted resources:

  1. Printing too small: QR codes under 2cm for handheld scanning are the top cause of scan failures. Dense data in a small code is nearly impossible for older devices to read.
  2. Cropping the quiet zone: The 4-module white border is not decorative, it is functional. Without it, scanners cannot find the code boundaries.
  3. Low contrast colors: Light gray on white, dark blue on black, or any sub-4:1 contrast ratio combination will cause failures on many scanners.
  4. Inverting colors: White modules on a dark background breaks many older scanners. Always use dark-on-light.
  5. Too much data: Encoding a full paragraph of text or a 200-character URL creates a very dense code. Use URL shorteners and keep data minimal.
  6. Low-resolution raster images: Generating a 100x100px PNG and scaling it up for print produces blurry modules. Always use SVG or generate at the target resolution.
  7. Broken destination URLs: Printed QR codes are permanent. If the URL expires, changes, or returns an error, the code becomes useless. Use redirect-capable permanent URLs.
  8. No mobile testing: A code that scans on your phone may fail on other devices. Test on at least iOS, Android, and one dedicated QR app.
  9. Placing on curved surfaces: QR codes wrapped more than 30 degrees around a cylinder (bottles, pipes) become very difficult to scan.
  10. Wrong error correction for the environment: Using Level L for a code that will be on outdoor signage exposed to weather, or on packaging that gets scratched and dirty.

QR Codes in Digital Marketing and Analytics

QR codes bridge the gap between physical and digital marketing. When used strategically, they provide measurable engagement data from offline channels (print ads, billboards, product packaging, direct mail). Here are best practices for marketing QR codes:

  • Use UTM parameters: Append UTM tracking parameters to your QR code URLs (?utm_source=qr&utm_medium=print&utm_campaign=spring2026) so you can track QR code traffic separately in Google Analytics or other analytics platforms.
  • Create unique codes per channel: Use different QR codes (with different UTM parameters) for each placement (billboard vs. brochure vs. business card) to measure which channels drive the most scans.
  • Include a clear CTA: Always print a call-to-action next to the QR code: "Scan for 20% off", "Scan to see the menu", "Scan to connect to WiFi". A QR code without context has much lower scan rates.
  • Link to mobile-optimized pages: The destination must be mobile-friendly, load fast (under 3 seconds), and provide immediate value. A desktop-only page or a slow-loading PDF will frustrate scanners.
  • Consider dynamic codes for campaigns: Use dynamic QR codes for time-limited promotions so you can update the destination or deactivate the code after the campaign ends, and track scan analytics over time.

Generate QR Codes Online: Using the DevToolBox QR Code Generator

Our free QR Code Generator tool makes it easy to create QR codes for any purpose. Here is what you can do:

  • Encode any content type: URLs, plain text, WiFi credentials, phone numbers, email addresses, SMS messages, and vCard contacts.
  • Choose error correction level: Select from L, M, Q, or H based on your use case and environment.
  • Download as SVG or PNG: Get a vector SVG for maximum quality and scalability, or a high-resolution PNG for immediate use.
  • Customize size: Adjust the output dimensions to match your print or screen requirements.
  • No account required: Generate unlimited QR codes for free without registration, watermarks, or scan limits.
  • Privacy-first: All QR code generation happens in your browser. Your data never leaves your device.

Whether you need a QR code for a business card, restaurant menu, WiFi network, marketing campaign, or developer project, our generator handles it all. Try the QR Code Generator now.

Frequently Asked Questions

What is a QR code and how does it work?

A QR (Quick Response) code is a two-dimensional matrix barcode that stores data in both horizontal and vertical patterns of black and white squares called modules. Invented by Denso Wave in 1994, QR codes use finder patterns (three large corner squares) for orientation, alignment patterns for distortion correction, and Reed-Solomon error correction to remain scannable even when partially damaged. When a camera or scanner reads a QR code, it decodes the module pattern back into the original data, which can be a URL, text, WiFi credentials, contact information, or other structured data.

How do I generate a QR code for free?

You can generate a QR code for free using an online tool like DevToolBox QR Code Generator. Simply enter the data you want to encode (URL, text, WiFi credentials, vCard contact, email, or phone number), select the desired error correction level, adjust the size if needed, and download the generated QR code as SVG or PNG. For developers, you can also generate QR codes programmatically using the qrcode npm package in JavaScript/Node.js or the qrcode pip library in Python.

What is the difference between static and dynamic QR codes?

Static QR codes encode data directly into the code pattern and cannot be changed after creation. Dynamic QR codes encode a short redirect URL that points to a server, allowing you to change the destination URL without reprinting, track scan analytics, set expiration dates, and A/B test landing pages. Static codes are free, work offline, and never expire. Dynamic codes require a subscription but offer far greater flexibility for marketing and business use.

What are the four QR code error correction levels?

QR codes support four error correction levels: Level L (Low) recovers up to 7% damage, Level M (Medium) recovers up to 15% and is the recommended default, Level Q (Quartile) recovers up to 25% for harsh environments, and Level H (High) recovers up to 30% and is required when embedding logos. Higher correction means more redundant data and lower maximum capacity, but greater resilience to damage, dirt, and partial obstruction.

Can I generate QR codes programmatically with JavaScript or Python?

Yes. In JavaScript/Node.js, install the qrcode npm package (npm install qrcode) and use methods like QRCode.toDataURL() for base64 PNG output or QRCode.toString() for SVG. In Python, install the qrcode library (pip install qrcode[pil]), create a QRCode object with your desired settings (version, error correction, box size, border), add data, and save as PNG or SVG.

How do I create a QR code for WiFi network access?

Encode WiFi credentials in this standard format: WIFI:T:WPA;S:NetworkName;P:Password;; where T is the encryption type (WPA, WEP, or nopass), S is the SSID, and P is the password. When scanned, the smartphone automatically prompts to connect to the network. Most online QR code generators including our tool support dedicated WiFi QR code input forms.

What is the maximum data capacity of a QR code?

At the lowest error correction (Level L), a Version 40 QR code (177x177 modules) can store up to 7,089 numeric characters, 4,296 alphanumeric characters, or 2,953 bytes of binary data. In practice, keep data short because more data creates denser codes that require larger printing. A typical URL of 50-80 characters fits comfortably in a Version 3-5 code.

Should I use SVG or PNG format for my QR code?

Always generate as SVG first. SVG is a vector format that scales without quality loss, ideal as a master file. Use SVG for web display and convert to high-resolution PNG (1000x1000+ pixels at 300 DPI) for print. Never scale up a small raster PNG, as this creates blurry modules. PNG works for social media, email embedding, and platforms that do not support SVG.

Conclusion

QR codes have become an essential tool for bridging physical and digital experiences. Whether you are a developer integrating QR code generation into an application, a marketer tracking offline campaign performance, a restaurant owner replacing paper menus, or an IT administrator sharing WiFi credentials, understanding QR code fundamentals ensures your codes scan reliably and serve their purpose effectively.

The key principles to remember: keep encoded data short, use SVG format for quality, choose the right error correction level for your environment, maintain a proper quiet zone, ensure high contrast, and always test on multiple devices before deploying. With these practices in place, QR codes are a powerful, free, and universally accessible technology.

Ready to create your own QR code? Use our free QR Code Generator Online to generate custom QR codes for URLs, WiFi, vCards, and more, instantly in your browser with no account required.

𝕏 Twitterin LinkedIn
บทความนี้มีประโยชน์ไหม?

อัปเดตข่าวสาร

รับเคล็ดลับการพัฒนาและเครื่องมือใหม่ทุกสัปดาห์

ไม่มีสแปม ยกเลิกได้ตลอดเวลา

ลองเครื่องมือที่เกี่ยวข้อง

QR Code Generator

บทความที่เกี่ยวข้อง

ขนาด รูปแบบ และการแก้ไขข้อผิดพลาด QR Code: คู่มือปฏิบัติที่ดี

ทุกอย่างเกี่ยวกับขนาด รูปแบบ และระดับการแก้ไขข้อผิดพลาดของ QR code

Base64 Encoding ในทางปฏิบัติ: 7 การใช้งานจริงที่นักพัฒนาทุกคนควรรู้

ค้นพบ 7 การใช้งานจริงของ Base64 encoding: ฝังรูปภาพ, Kubernetes secrets, JWT tokens และ data URI

URL Encode & Decode: คู่มือ Percent-Encoding ฉบับสมบูรณ์

ตัวเข้ารหัสและถอดรหัส URL ฟรี เรียนรู้ percent-encoding พร้อมตัวอย่างใน JavaScript, Python, Bash และ PHP