Testing Environment: Our tools are currently under heavy testing. You may experience slower performance or temporary issues.

📱

QR Code Generator

Generate QR codes from text, URLs, and other data types

QR Code Type

Content & Settings

QR Code Options

QR Code Preview

📱

No QR Code Generated

Fill in your content and click "Generate QR Code" to create your QR code.

Quick Presets

📱 QR Code Tips

  • Size: Larger QR codes are easier to scan from a distance
  • Contrast: Use high contrast colors for better scannability
  • Error Correction: Higher levels allow scanning even when damaged
  • Testing: Always test your QR codes with different scanner apps
  • Quiet Zone: Leave white space around QR codes when printing

About QR Code Generation

QR (Quick Response) codes are two-dimensional barcodes that can store various types of information and be quickly scanned by smartphones and QR code readers. Perfect for sharing URLs, contact information, WiFi credentials, text messages, and business information.

  • Generate QR codes for multiple data types (URL, text, email, phone)
  • Customize colors, sizes, and error correction levels
  • High-resolution output for print and digital use
  • Batch generation for multiple codes
  • Vector formats (SVG) and raster formats (PNG, JPG)

Types of QR Codes

Basic QR Codes

  • URL: Direct link to websites
  • Text: Plain text messages
  • Email: Mailto links with subject/body
  • Phone: Telephone numbers for calling
  • SMS: Text message with pre-filled content

Advanced QR Codes

  • WiFi: Network credentials for auto-connect
  • vCard: Contact information cards
  • Event: Calendar event with details
  • Location: GPS coordinates
  • App Store: Direct app download links

Advertisement

AdSense Banner Ad Placeholder

Frequently Asked Questions

What's the maximum data capacity of QR codes?

QR codes can store up to 7,089 numeric characters, 4,296 alphanumeric characters, or 2,953 bytes of binary data. Actual capacity depends on the error correction level and data type.

What are error correction levels?

QR codes have four error correction levels: L (~7% recovery), M (~15% recovery), Q (~25% recovery), and H (~30% recovery). Higher levels allow the code to remain readable even when damaged.

Can I customize the appearance of QR codes?

Yes! You can change colors (foreground and background), add logos or images in the center, customize module shapes, and adjust sizes while maintaining scannability.

Are QR codes free to use commercially?

Yes, QR codes are an open standard and free to use for any purpose, including commercial applications. No licensing fees or royalties are required.

QR Code Examples

Business Applications:

Website QR Code:
URL: https://mycompany.com
Use: Business cards, brochures
Contact vCard:
Name, phone, email, address
Use: Networking events
WiFi Access:
Network: "Office_WiFi"
Use: Guest access, cafes

Personal Use:

Social Media:
Instagram profile link
Use: Profile sharing
Event Details:
Calendar event with location
Use: Invitations, posters
App Download:
Direct App Store link
Use: Marketing materials

Sponsored Content

AdSense Square Ad Placeholder

QR Code Generation Implementation

JavaScript QR Code Generator:

class QRCodeGenerator {
  constructor() {
    this.errorCorrectionLevels = {
      L: 'Low (~7% recovery)',
      M: 'Medium (~15% recovery)', 
      Q: 'Quartile (~25% recovery)',
      H: 'High (~30% recovery)'
    };
    
    this.qrTypes = {
      TEXT: 'text',
      URL: 'url',
      EMAIL: 'email',
      PHONE: 'phone',
      SMS: 'sms',
      WIFI: 'wifi',
      VCARD: 'vcard',
      EVENT: 'event',
      LOCATION: 'location'
    };
  }
  
  // Generate QR code for different data types
  generateQR(data, options = {}) {
    const defaultOptions = {
      size: 256,
      errorCorrectionLevel: 'M',
      foregroundColor: '#000000',
      backgroundColor: '#FFFFFF',
      margin: 4,
      format: 'PNG'
    };
    
    const config = { ...defaultOptions, ...options };
    
    try {
      // Format data based on type
      const qrData = this.formatData(data);
      
      // Generate QR code using library (e.g., qrious, qrcode.js)
      const qrCode = this.createQRCode(qrData, config);
      
      return {
        success: true,
        dataUrl: qrCode.toDataURL(),
        svg: config.format === 'SVG' ? qrCode.toSVG() : null,
        size: config.size,
        data: qrData,
        errorCorrectionLevel: config.errorCorrectionLevel
      };
    } catch (error) {
      return {
        success: false,
        error: error.message
      };
    }
  }
  
  // Format data for different QR code types
  formatData(data) {
    switch (data.type) {
      case this.qrTypes.URL:
        return this.ensureHttpProtocol(data.content);
        
      case this.qrTypes.EMAIL:
        return `mailto:${data.email}${data.subject ? '?subject=' + encodeURIComponent(data.subject) : ''}${data.body ? (data.subject ? '&' : '?') + 'body=' + encodeURIComponent(data.body) : ''}`;
        
      case this.qrTypes.PHONE:
        return `tel:${data.phone}`;
        
      case this.qrTypes.SMS:
        return `sms:${data.phone}${data.message ? '?body=' + encodeURIComponent(data.message) : ''}`;
        
      case this.qrTypes.WIFI:
        return `WIFI:T:${data.encryption || 'WPA'};S:${data.ssid};P:${data.password};H:${data.hidden ? 'true' : 'false'};;`;
        
      case this.qrTypes.VCARD:
        return this.generateVCard(data);
        
      case this.qrTypes.EVENT:
        return this.generateVEvent(data);
        
      case this.qrTypes.LOCATION:
        return `geo:${data.latitude},${data.longitude}${data.altitude ? ',' + data.altitude : ''}`;
        
      case this.qrTypes.TEXT:
      default:
        return data.content || data.text;
    }
  }
  
  // Generate vCard format for contact information
  generateVCard(data) {
    let vcard = 'BEGIN:VCARD\nVERSION:3.0\n';
    
    if (data.name) {
      vcard += `FN:${data.name}\n`;
      const nameParts = data.name.split(' ');
      if (nameParts.length >= 2) {
        vcard += `N:${nameParts[nameParts.length - 1]};${nameParts.slice(0, -1).join(' ')};;;\n`;
      }
    }
    
    if (data.organization) vcard += `ORG:${data.organization}\n`;
    if (data.title) vcard += `TITLE:${data.title}\n`;
    if (data.phone) vcard += `TEL:${data.phone}\n`;
    if (data.email) vcard += `EMAIL:${data.email}\n`;
    if (data.website) vcard += `URL:${data.website}\n`;
    
    if (data.address) {
      vcard += `ADR:;;${data.address.street || ''};${data.address.city || ''};${data.address.state || ''};${data.address.zip || ''};${data.address.country || ''}\n`;
    }
    
    vcard += 'END:VCARD';
    return vcard;
  }
  
  // Generate vEvent format for calendar events
  generateVEvent(data) {
    let vevent = 'BEGIN:VCALENDAR\nVERSION:2.0\nBEGIN:VEVENT\n';
    
    if (data.title) vevent += `SUMMARY:${data.title}\n`;
    if (data.description) vevent += `DESCRIPTION:${data.description}\n`;
    if (data.location) vevent += `LOCATION:${data.location}\n`;
    
    if (data.startDate) {
      vevent += `DTSTART:${this.formatDateForVEvent(data.startDate)}\n`;
    }
    
    if (data.endDate) {
      vevent += `DTEND:${this.formatDateForVEvent(data.endDate)}\n`;
    }
    
    // Generate unique ID
    vevent += `UID:${Date.now()}@qrcodegenerator.com\n`;
    
    vevent += 'END:VEVENT\nEND:VCALENDAR';
    return vevent;
  }
  
  // Format date for vEvent (YYYYMMDDTHHMMSSZ)
  formatDateForVEvent(date) {
    const d = new Date(date);
    return d.toISOString().replace(/[-:]/g, '').split('.')[0] + 'Z';
  }
  
  // Ensure URL has proper protocol
  ensureHttpProtocol(url) {
    if (!/^https?:\/\//.test(url)) {
      return 'https://' + url;
    }
    return url;
  }
  
  // Batch generate multiple QR codes
  batchGenerate(dataArray, options = {}) {
    const results = [];
    
    for (let i = 0; i < dataArray.length; i++) {
      const data = dataArray[i];
      const filename = data.filename || `qr_code_${i + 1}`;
      
      const result = this.generateQR(data, options);
      results.push({
        ...result,
        filename: filename,
        index: i
      });
    }
    
    return results;
  }
  
  // Download QR code as image
  downloadQR(dataUrl, filename = 'qrcode', format = 'PNG') {
    const link = document.createElement('a');
    link.download = `${filename}.${format.toLowerCase()}`;
    link.href = dataUrl;
    document.body.appendChild(link);
    link.click();
    document.body.removeChild(link);
  }
  
  // Create QR code with custom styling
  createStyledQR(data, style = {}) {
    const options = {
      size: style.size || 256,
      errorCorrectionLevel: style.errorCorrection || 'M',
      foregroundColor: style.foregroundColor || '#000000',
      backgroundColor: style.backgroundColor || '#FFFFFF',
      margin: style.margin || 4
    };
    
    // Add logo/image in center if provided
    if (style.logo) {
      options.logo = {
        src: style.logo,
        width: style.logoSize || 60,
        height: style.logoSize || 60,
        excavate: true // Remove QR modules behind logo
      };
    }
    
    return this.generateQR(data, options);
  }
  
  // Validate QR code data
  validateData(data) {
    const errors = [];
    
    switch (data.type) {
      case this.qrTypes.EMAIL:
        if (!data.email || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(data.email)) {
          errors.push('Invalid email address');
        }
        break;
        
      case this.qrTypes.PHONE:
        if (!data.phone || !/^[+]?[\d\s\-()]+$/.test(data.phone)) {
          errors.push('Invalid phone number');
        }
        break;
        
      case this.qrTypes.URL:
        if (!data.content || !/^(https?:\/\/)?[\w\-._~:/?#[\]@!$&'()*+,;=]+\.[\w\-._~:/?#[\]@!$&'()*+,;=]+$/.test(data.content)) {
          errors.push('Invalid URL format');
        }
        break;
        
      case this.qrTypes.WIFI:
        if (!data.ssid) {
          errors.push('WiFi network name (SSID) is required');
        }
        break;
        
      case this.qrTypes.LOCATION:
        if (!data.latitude || !data.longitude) {
          errors.push('Latitude and longitude are required for location');
        }
        if (Math.abs(data.latitude) > 90 || Math.abs(data.longitude) > 180) {
          errors.push('Invalid GPS coordinates');
        }
        break;
    }
    
    return {
      valid: errors.length === 0,
      errors: errors
    };
  }
  
  // Get QR code information
  getQRInfo(dataUrl) {
    // This would typically use a QR code reader library
    return {
      estimated_version: 'Unknown',
      modules: 'Unknown',
      data_capacity: 'Unknown',
      error_correction: 'Unknown'
    };
  }
}

// Usage examples
const generator = new QRCodeGenerator();

// Generate URL QR code
const urlQR = generator.generateQR({
  type: 'url',
  content: 'https://www.example.com'
}, {
  size: 300,
  errorCorrectionLevel: 'M'
});

// Generate WiFi QR code
const wifiQR = generator.generateQR({
  type: 'wifi',
  ssid: 'MyNetwork',
  password: 'mypassword123',
  encryption: 'WPA',
  hidden: false
});

// Generate contact vCard
const contactQR = generator.generateQR({
  type: 'vcard',
  name: 'John Doe',
  phone: '+1234567890',
  email: 'john@example.com',
  organization: 'Example Corp',
  website: 'https://johndoe.com'
});

console.log('QR codes generated successfully!');
            

QR Code Specifications

Version & Capacity:

Version 1 (21×21):25 chars
Version 10 (57×57):395 chars
Version 20 (97×97):1,273 chars
Version 40 (177×177):4,296 chars

Error Correction:

Level L:~7% recovery
Level M:~15% recovery
Level Q:~25% recovery
Level H:~30% recovery

QR Code Best Practices

  • Sufficient Contrast: Ensure high contrast between foreground and background colors
  • Adequate Size: Minimum 2×2 cm for print, larger for distance scanning
  • Quiet Zone: Leave white space around the QR code for better scanning
  • Error Correction: Use higher levels for codes that may get damaged
  • Test Scanning: Always test with different devices and apps before use
  • Keep URLs Short: Shorter URLs create simpler, more scannable codes
  • Logo Placement: Center logos and don't exceed 30% of code area

Common Use Cases

  • Business card contact information
  • Restaurant menu digital access
  • Event registration and ticketing
  • Product information and manuals
  • WiFi network sharing
  • Social media profile links
  • App download promotion
  • Payment and donation links

Advertisement

AdSense Bottom Ad Placeholder