Tutorials

QR Code Generator: Complete Guide to Creating Custom QR Codes

March 11, 20266 min readNebulaTool

QR codes have become a standard method for encoding data in a machine-readable format. Originally developed in 1994 by Denso Wave for tracking automotive parts, the technology now appears on restaurant menus, product packaging, business cards, and digital marketing materials. This guide covers every QR code type, the technical details behind error correction, and practical formatting examples you can use right away.

QR Code Types Explained

A QR code is not limited to storing website URLs. The data payload determines what action a scanning device takes, and several standardized formats exist for different use cases.

URL. The most common type. The QR code contains a plain URL string such as https://example.com/page. When scanned, the device opens the link in a browser.

WiFi. Encodes a network name, password, and encryption type. Scanning the code connects the device to the network automatically, without manual entry.

vCard. Stores structured contact information including name, phone number, email, organization, and address. Scanning adds the contact directly to the phone address book.

Email. Encodes a mailto: URI with a recipient address and optional subject line and body text. Scanning opens the default email client with the fields pre-filled.

Phone. Contains a tel: URI with a phone number. Scanning triggers a phone call or presents the number for dialing.

Plain Text. Stores arbitrary text content up to approximately 4,296 alphanumeric characters. Useful for serial numbers, reference codes, or short messages.

Each type uses a specific data format that scanning apps recognize and act on. The sections below show the exact syntax for WiFi and vCard formats.

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

QR codes use Reed-Solomon error correction to remain scannable even when partially damaged or obscured. The ISO/IEC 18004 standard defines four levels:

  • Level L (Low): Recovers up to 7% of data. Produces the smallest, least dense QR code. Best for clean digital displays where damage is unlikely.
  • Level M (Medium): Recovers up to 15% of data. The default for most generators. A good balance between size and resilience.
  • Level Q (Quartile): Recovers up to 25% of data. Suitable for printed codes that may get scuffed, folded, or partially covered.
  • Level H (High): Recovers up to 30% of data. Required when placing a logo or image over the center of the QR code, since the logo effectively "damages" that region.

Higher error correction means a denser QR code with more modules (the small black and white squares). If you plan to add a logo overlay, use Level H to ensure the code remains scannable despite the covered area.

Customization Options: Colors and Size

Modern QR code generators allow visual customization beyond the standard black-on-white pattern.

Foreground and background colors. You can change the color of the modules and the background. The critical requirement is sufficient contrast. A contrast ratio of at least 4:1 between the foreground and background ensures reliable scanning. Dark modules on a light background work best. Avoid inverting the pattern (light modules on a dark background), as many older scanners do not handle it well.

Module size and resolution. QR code size depends on two factors: the data version (how much data is encoded) and the module pixel size. For digital use, a minimum of 200 by 200 pixels works for most screen sizes. For print, generate the image at a high resolution, at least 300 DPI, and export as SVG or high-resolution PNG. Vector formats (SVG) scale without quality loss, making them ideal for print materials.

Quiet zone. The white border surrounding the QR code is called the quiet zone. It must be at least 4 modules wide on all sides. Cropping into this zone or placing other design elements too close will cause scanning failures.

Best Practices for Print vs Digital

The medium where your QR code appears affects how you should generate and size it.

Print (posters, business cards, packaging):

  • Export as SVG or PDF for lossless scaling
  • Minimum printed size of 2 cm by 2 cm (roughly 0.8 by 0.8 inches) for simple URLs
  • Use error correction Level Q or H to account for printing imperfections
  • Test the printed code with at least three different scanning apps before finalizing
  • Avoid glossy surfaces that cause glare under certain lighting

Digital (websites, emails, presentations):

  • PNG at 300 by 300 pixels or larger is sufficient for most screens
  • Use error correction Level L or M to keep the code visually clean
  • Ensure the code is not compressed by the platform (social media image compression can destroy scanability)
  • Link to a redirect URL rather than a final destination, so you can update the target without regenerating the code

WiFi QR Code Format

WiFi QR codes follow a specific string format that scanning devices parse to extract network credentials. The format is:

WIFI:T:<encryption>;S:<network-name>;P:<password>;H:<hidden>;;

Here is a concrete example for a WPA2 network:

WIFI:T:WPA;S:MyHomeNetwork;P:s3cur3Pa$$w0rd;H:false;;

The parameters break down as follows:

  • T is the encryption type: WPA, WEP, or nopass for open networks
  • S is the SSID (network name), which is case-sensitive
  • P is the password, omitted for open networks
  • H is true if the network is hidden, false otherwise

Special characters in the SSID or password (such as semicolons, colons, commas, and backslashes) must be escaped with a backslash. For example, a password containing a semicolon would be written as P:my\;password.

vCard QR Code Format

vCard QR codes encode contact information in the vCard text format. Most scanners support vCard version 3.0. The format looks like this:

BEGIN:VCARD
VERSION:3.0
N:Doe;Jane;;;
FN:Jane Doe
ORG:Acme Corporation
TITLE:Software Engineer
TEL;TYPE=CELL:+1-555-867-5309
TEL;TYPE=WORK:+1-555-123-4567
EMAIL:jane.doe@acme.com
ADR;TYPE=WORK:;;123 Main St;Springfield;IL;62701;US
URL:https://janedoe.dev
END:VCARD

Each field is on its own line. The N field uses the order: last name, first name, middle name, prefix, suffix, separated by semicolons. The FN field is the full display name. Multiple phone numbers and email addresses are supported by repeating the TEL and EMAIL fields with different TYPE values.

Keep vCard data concise. QR codes have a character limit, and dense codes with many fields become harder to scan, especially at small sizes. Include only the essential contact fields.

Frequently Asked Questions

What is the maximum amount of data a QR code can store?

A single QR code can store up to 7,089 numeric characters, 4,296 alphanumeric characters, or 2,953 bytes of binary data. The practical limit is lower because higher data volumes produce denser codes that are harder to scan, particularly at small sizes or with lower-quality cameras.

Can I change the destination of a QR code after printing it?

Only if you use a dynamic QR code. A dynamic code points to a short redirect URL that you control. You can change the final destination by updating the redirect, without regenerating the code. A static QR code has the data baked in permanently and cannot be changed after creation.

Will adding a logo to my QR code break it?

Not if you use error correction Level H, which allows up to 30% of the code to be unreadable. The logo should cover no more than 20 to 25% of the total code area and should be placed in the center. Always test the code after adding a logo to confirm it still scans reliably.

What is the minimum size for a printable QR code?

For a simple URL with error correction Level M, the minimum recommended print size is 2 cm by 2 cm (about 0.8 by 0.8 inches). Codes with more data or higher error correction levels need to be larger. As a rule, ensure each individual module is at least 0.75 mm wide for reliable scanning.

Do QR codes expire?

Static QR codes do not expire. The data is encoded directly in the pattern and will remain scannable indefinitely, as long as the physical code is not damaged. Dynamic QR codes depend on the redirect service remaining active. If the service goes offline or the subscription lapses, the redirect will stop working.

Generate QR Codes with NebulaTool

The NebulaTool QR Code Generator supports all the types covered in this guide: URL, WiFi, vCard, email, phone, and plain text. You can customize colors, adjust error correction levels, and download the result as PNG or SVG. Everything runs in your browser with no data sent to a server.

Whether you need a WiFi QR code for your office lobby or a vCard code for your business card, the generator handles the formatting automatically. Just select the type, fill in the fields, and download.


For more practical tool guides, see our Regex Tutorial for Beginners and our Base64 Encoding Explained guide.


Ready to try it yourself?

Open Qr Code Generator