What a QR code is and why you'd create one

A QR code is a square barcode that stores information — usually a URL, text, contact details, or WiFi credentials — in a pattern that a smartphone camera can read instantly. When someone points their phone at it, the camera app or a QR reader opens whatever is encoded inside. You create one by running data through a QR code generator, which converts your information into that distinctive grid of black and white squares.

Developers and businesses use QR codes to bridge the gap between physical and digital. A printed QR code on a poster can send someone to a landing page. A QR code in an email can trigger a phone call or open an app. A QR code on a product label can pull up instructions or warranty information. The code itself is just the medium — you decide what happens when someone scans it.

The most common reason to create one is to make a URL clickable without typing. But QR codes also encode plain text, email addresses, phone numbers, calendar events, and WiFi network details. Some generators let you customize the appearance — adding a logo in the center or changing the colors — though this requires the code to stay readable.

Key Takeaways

  • QR codes are generated by encoding data (usually a URL) through a QR code generator, which outputs an image you can download and use anywhere.
  • Free online generators like QR Code Generator, QR Server, and Segno work without registration and produce standard QR codes in seconds.
  • For programmatic generation in your own code, libraries like Segno (Python), qrcode (Node.js), and ZXing (Java) let you create codes on demand.
  • Static QR codes (pointing to fixed data) are simpler and more reliable than dynamic codes (which redirect through a tracking service).
  • Test every QR code with at least two different phone cameras before printing or publishing, because some generators produce codes that certain devices struggle to read.

Using a free online QR code generator

The fastest way to create a single QR code is through a web-based generator. Open QR Code Generator (qr-code-generator.com), QR Server (qr-server.com), or GoQR (goqr.me) in your browser. Each works the same way: paste or type the data you want to encode, choose the format (URL, text, phone number, WiFi, etc.), and the generator produces an image.

Paste your URL into the input field. Most generators default to URL mode, but if you're encoding a phone number, email, or WiFi credentials, select that option from a dropdown. The code appears instantly as you type. Download the image as PNG or SVG — PNG is smaller and works everywhere, SVG is vector-based and scales without losing quality. Right-click the code and select "Save image as" to download it to your computer.

These generators are stateless, meaning they don't track scans or require you to log in. The QR code points directly to whatever you encoded, so if you change your mind about the destination later, you'll need to generate a new code. This is called a static QR code, and it's the most reliable type because there's no middle service that could go down or change the redirect.

Creating QR codes in your own code

If you're building an application that needs to generate QR codes on demand — for example, a ticketing system that creates a unique code for each purchase — use a QR code library instead of calling an external API. Libraries run locally, generate codes instantly, and don't depend on a third-party service staying online.

Python: Install Segno with pip install segno. Then create a code in three lines:

import segno qr = segno.make('https://example.com') qr.save('code.png')

Node.js: Install qrcode with npm install qrcode. Generate and save a code like this:

const QRCode = require('qrcode'); QRCode.toFile('code.png', 'https://example.com', (err) => {   if (err) throw err;   console.log('Code saved'); })

Java: Use ZXing (Zebra Crossing), Google's open-source barcode library. Add it to your Maven or Gradle build, then generate a code with a few method calls. Documentation is available on the ZXing GitHub repository.

All three libraries produce standard QR codes that any phone can read. They also support customization — changing the error correction level (which determines how much of the code can be damaged and still scanned), adding a logo, or resizing the output. Start with the defaults and customize only if you have a specific reason.

Static versus dynamic QR codes

A static QR code encodes the actual destination directly into the pattern. When someone scans it, their phone decodes the pattern and goes straight to that URL or phone number. Static codes never expire, don't require a service to stay online, and work offline. They're what you get from every free generator and every library mentioned above.

A dynamic QR code encodes a short redirect URL instead. When scanned, the phone visits that redirect service, which then sends the user to the real destination. This lets you change where the code points without reprinting it — useful for marketing campaigns where you want to swap the landing page mid-campaign. The trade-off is that the redirect service must stay online, and you're trusting a third party with your traffic data.

For most projects, static codes are the right choice. They're simpler, more reliable, and don't lock you into a service. Use dynamic codes only if you genuinely need to change the destination after the code is printed or published, and only if you're willing to pay for the redirect service (most charge a monthly fee).

Customizing appearance without breaking readability

QR codes can be customized — you can change the colors, add a logo in the center, or adjust the border — but every change risks making the code unreadable. The code works because it uses error correction, which means up to 30% of the pattern can be damaged or obscured and still scan correctly. A logo in the center uses up some of that error correction budget.

If you want to customize, start conservative. Change the foreground color (the black squares) to a dark color and the background to a light color — high contrast is what matters. Add a logo only if it covers less than 10% of the code's area, and only if you've tested it with multiple phones. Avoid gradients, transparency, or artistic effects; they confuse scanners.

Most online generators offer basic color customization. Libraries like Segno and qrcode let you pass color parameters when generating. Test the customized code with at least two different phone cameras before using it in production. A code that looks good on your screen might fail on older phones or in poor lighting.

Testing and troubleshooting your QR code

Before you print or publish a QR code, scan it with at least two different phones. Use the built-in camera app on an iPhone and an Android phone if you have access to both. Some generators produce codes that work perfectly on modern devices but fail on older phones with weaker cameras. Testing catches this before the code goes live.

If a code doesn't scan, the most common causes are: the image is too small (print it at least 1 inch by 1 inch), the contrast is too low (make sure the foreground is dark and the background is light), or the code was customized too heavily (a large logo or artistic effect can break readability). Regenerate the code without customization and test again.

If you're generating codes programmatically and they're not scanning, check the error correction level. Most libraries default to a medium level, which is fine for most use cases. If codes are being printed in harsh conditions or will be partially obscured, increase the error correction level to high — this makes the code larger but more resilient.

Embedding QR codes in documents and designs

Once you have a QR code image, you can place it anywhere: a PDF, a Word document, a poster, a website, an email, or a product label. Download the code as PNG for most uses — it's a standard image format that every tool supports. If you're designing something in a vector program like Adobe Illustrator or Figma, download as SVG so you can scale it without losing quality.

In a document or design, the code should be at least 1 inch by 1 inch (2.5 cm by 2.5 cm) when printed. Smaller codes are harder to scan, especially with older phone cameras. Leave some white space around the code — don't let text or images touch the edges. This border, called the quiet zone, helps phones recognize where the code starts and ends.

If you're embedding a code in a website, use an <img> tag pointing to the PNG file. If you're generating codes dynamically on a web page (for example, a checkout page that creates a unique code for each order), use a JavaScript QR library like qrcode.js, which generates codes directly in the browser without needing a server call.

Frequently Asked Questions

Can I change where a QR code points after I've printed it?

Not with a static QR code — the destination is baked into the pattern. If you need to change it, you'll have to print a new code. Dynamic QR codes let you change the destination, but they require a paid redirect service and add a dependency on that service staying online.

What's the difference between QR codes and barcodes?

Barcodes (the striped lines on product labels) store data in one dimension and require a specific scanner. QR codes store data in two dimensions and work with any smartphone camera. QR codes can hold much more information and are easier to scan in real-world conditions.

Do QR codes expire?

Static QR codes don't expire — the pattern is permanent and will scan as long as the image exists. Dynamic QR codes depend on the redirect service, which could shut down or delete your account. If you stop paying for a dynamic QR service, the codes stop working.

How much data can a QR code hold?

A standard QR code can hold up to 4,296 characters of text or about 2,953 bytes of binary data. That's enough for most URLs, contact information, and WiFi credentials. Longer data requires a larger code, which takes up more space and is harder to scan from a distance.

Can I use a QR code to collect data or track scans?

Static QR codes don't track anything — they're just an image. To track scans, you need a dynamic QR code that redirects through a tracking service, or you need to point the code to a URL on your own server that logs visits. The server approach gives you full control over what data you collect.