免费二维码生成器

即时为URL、文本、邮箱等创建二维码。自定义颜色、添加logo并以高质量下载。无需注册。100%永久免费。

1M+已生成的二维码
100%永久免费
0s需要注册

生成您的二维码

更高级别允许二维码在部分损坏时仍可扫描

预览和下载

📱

您的二维码将显示在这里

填写详细信息并点击"生成"

💡 专业提示

  • 保持URL简短以获得更简单、更易扫描的二维码
  • 批量打印前测试二维码
  • 保持良好的对比度(深色在浅色上)
  • 更高的纠错等级=更好的抗损坏能力
  • 在二维码周围添加间距以便更好地扫描

常见用例

了解二维码如何在各种场景中使用

🌐

网站链接

即时分享您的网站URL。非常适合名片、传单和营销材料。

https://your-website.com
📱

联系信息

创建包含您联系方式的vCard二维码。一次扫描即可添加到联系人。

BEGIN:VCARD...
📶

WiFi凭据

让客人无需输入密码即可连接WiFi。非常适合咖啡馆和办公室。

WIFI:T:WPA;S:NetworkName...
💳

支付链接

使用二维码接受付款。链接到PayPal、Stripe或加密钱包。

https://paypal.me/username
📧

撰写邮件

预填收件人和主题。一次扫描打开邮件客户端准备发送。

mailto:hello@example.com
📍

位置坐标

分享精确的GPS坐标。在地图应用中打开并准备导航。

geo:40.7128,-74.0060

二维码生成如何工作

了解二维码背后的技术

1

数据编码

您的输入被转换为二进制格式,并使用Reed-Solomon纠错编码。

2

模式生成

编码数据在2D矩阵中排列,带有定位标记和对齐模式。

3

渲染

矩阵被渲染为黑白模块,可选择颜色自定义。

4

导出

完成的二维码导出为PNG、SVG或其他格式以便通用使用。

How to Generate QR Codes in Your Code

Complete implementation examples in 8+ programming languages

JavaScript / Node.js Implementation

Using the qrcode package (most popular, 8M+ downloads/week):

// Install package
npm install qrcode

// Basic usage
const QRCode = require('qrcode');

// Generate QR code and save as image
QRCode.toFile('qrcode.png', 'https://all-tools.online', {
  color: {
    dark: '#000000',
    light: '#FFFFFF'
  },
  width: 512,
  errorCorrectionLevel: 'M'
}, function (err) {
  if (err) throw err;
  console.log('QR code saved!');
});

// Generate as Data URL (for web)
QRCode.toDataURL('https://all-tools.online')
  .then(url => {
    console.log(url);
    // Use this URL in <img src="...">
  })
  .catch(err => console.error(err));

// Generate as SVG string
QRCode.toString('https://all-tools.online', {
  type: 'svg'
}, function (err, string) {
  if (err) throw err;
  console.log(string);
});

// Advanced options
const options = {
  errorCorrectionLevel: 'H',  // L, M, Q, H
  type: 'image/png',
  quality: 0.92,
  margin: 1,
  color: {
    dark: '#2563eb',
    light: '#f3f4f6'
  },
  width: 1024
};

QRCode.toDataURL('https://all-tools.online', options)
  .then(url => {
    // Use the QR code
  });

Browser Implementation (Client-side)

<!-- Include from CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>

<div id="qrcode"></div>

<script>
  // Generate QR code
  var qrcode = new QRCode(document.getElementById("qrcode"), {
    text: "https://all-tools.online",
    width: 512,
    height: 512,
    colorDark : "#000000",
    colorLight : "#ffffff",
    correctLevel : QRCode.CorrectLevel.H
  });

  // Update QR code
  qrcode.clear();
  qrcode.makeCode("New content here");
</script>

Frequently Asked Questions

What is a QR Code?

QR (Quick Response) Code is a two-dimensional barcode that can store various types of data including URLs, text, contact information, and more. It was invented in 1994 by Denso Wave for tracking automotive parts but is now widely used for marketing, payments, and information sharing.

Are the QR codes generated here free?

Yes! All QR codes generated on AllTools are 100% free forever. There are no limits, no watermarks, and no registration required. You can generate unlimited QR codes for personal or commercial use.

Do QR codes expire?

No, static QR codes (like the ones generated here) never expire. However, if the content they point to (like a URL) becomes unavailable, the QR code will stop working. Dynamic QR codes from paid services may expire when your subscription ends.

What's the difference between error correction levels?

Error correction allows QR codes to remain scannable even if partially damaged:
Low (L): ~7% damage recovery
Medium (M): ~15% damage recovery
Quartile (Q): ~25% damage recovery
High (H): ~30% damage recovery
Higher levels create more complex QR codes but offer better damage resistance.

Can I use custom colors in QR codes?

Yes, but maintain good contrast between the foreground and background colors. The general rule is to keep the foreground color dark and background light. Avoid using colors that are too similar, as this may make the QR code unscannable.

What size should my QR code be?

The minimum recommended size depends on scanning distance:
• For close-up scanning (business cards): 2cm × 2cm
• For normal distance (flyers): 3-4cm × 3-4cm
• For far distance (posters): Scale up proportionally
Rule of thumb: QR code size = scanning distance ÷ 10

Can I add a logo to my QR code?

Yes, you can add a logo to the center of a QR code due to error correction. However, the logo should not cover more than 30% of the QR code (use High error correction level). Always test the QR code after adding a logo to ensure it still scans properly.

Which format should I use: PNG or SVG?

PNG is best for web use, digital displays, and when you need a specific size.
SVG is best for print materials, as it scales infinitely without losing quality. Use SVG for business cards, billboards, and any printed materials.

How much data can a QR code hold?

The capacity depends on the data type and error correction level:
• Numeric only: up to 7,089 characters
• Alphanumeric: up to 4,296 characters
• Binary/Byte: up to 2,953 characters
• Kanji/Kana: up to 1,817 characters
For best scanning results, keep URLs short (under 100 characters).

Can QR codes be tracked?

Static QR codes (generated here) cannot be tracked. If you need analytics (scans, locations, devices), you'll need to use a URL shortener service or dynamic QR code service that provides tracking. The QR code itself contains no tracking capability.

Are QR codes secure?

QR codes themselves are just data containers and are not inherently secure or insecure. The security depends on what they link to. Always verify the destination before scanning unknown QR codes, as they could link to malicious websites or trigger unwanted actions.

Why isn't my QR code scanning?

Common issues:
• Poor contrast between colors
• QR code too small or too large
• Image quality too low (pixelated)
• Insufficient lighting
• Damaged or dirty QR code
• Logo covers too much of the code
• Camera focus issues
Try generating a new code with higher contrast and test before printing.

© 2026 DevToolbox. 保留所有权利。