You can generate a QR code in minutes using free online tools or code libraries

A QR code is a square barcode that stores information — a URL, text, contact details, WiFi credentials, or almost anything else. Creating one requires no design skills or special software. You pick a generator tool (online or in code), enter what you want the code to contain, and download the image. The whole process takes under five minutes.

The choice between tools depends on what you're building. If you're making a one-off code to print on a flyer, an online generator is fastest. If you're building an application that generates codes on demand — say, a ticketing system or inventory tracker — you'll use a code library in your programming language instead.

Key Takeaways

  • Free online generators like QR Code Generator, QR Server, and Segno work for single codes without installing anything.
  • For applications that create many codes automatically, use a library in your language: qrcode in Python, QRCode.js in JavaScript, or ZXing in Java.
  • The data you encode determines the code's complexity; longer text or URLs produce denser, more detailed codes.
  • Downloaded codes work best at 200 pixels or larger, and you should test them with a phone camera before printing or distributing.

Using an online generator for a single code

Online QR code generators are the fastest route if you need one or a few codes. Go to QR Code Generator (qr-code-generator.com), QR Server (qr-server.com), or Segno (segno.readthedocs.io/en/stable/). Each works the same way: paste or type the content you want encoded, adjust size and error correction if the tool offers it, then download the image as PNG or SVG.

QR Code Generator and QR Server have no login required and no limits on free use. Segno is a Python library, so you run it from the command line, but it's free and produces very clean output. For most people, QR Code Generator is the simplest choice — the interface is straightforward and the download options are clear.

Test the code before you use it. Open your phone's camera app, point it at the downloaded image on your screen, and tap the notification that appears. It should open the URL or display the text you encoded. If nothing happens, the code didn't generate correctly — try a different generator or check that your content doesn't have special characters that need escaping.

Generating codes in your application with a library

If you're building software that needs to create QR codes on the fly — a ticketing app, a checkout page, a label printer — use a code library instead of an online tool. Libraries let you generate codes programmatically and embed them directly in your application.

Python: The qrcode library is the standard. Install it with pip install qrcode[pil], then generate a code with a few lines:

import qrcode qr = qrcode.QRCode() qr.add_data("https://example.com") qr.make() img = qr.make_image() img.save("code.png")

JavaScript: QRCode.js (davidshimjs.github.io/qrcodejs/) runs in the browser. Include the library, create a container div, and generate the code:

<div id="qrcode"></div> <script src="qrcode.js"></script> <script> new QRCode(document.getElementById("qrcode"), "https://example.com"); </script>

Java: ZXing (github.com/zxing/zxing) is widely used. Add the dependency to your build file, then use the QRCodeWriter class to generate and save an image.

Each library handles error correction automatically — if part of the code is damaged or obscured, it can still be read. You don't need to configure this unless you have specific requirements.

Understanding QR code size and error correction

QR codes come in 40 versions, from 21×21 pixels (version 1) to 177×177 pixels (version 40). The version your code uses depends on how much data it contains. A short URL might be version 2; a long block of text might be version 8 or higher. Generators and libraries choose the version automatically.

When you download or generate a code, you can scale it up without losing quality — a version 2 code can be printed at 200 pixels or 2000 pixels and still scan correctly. The minimum practical size is around 100 pixels, though larger is always safer.

Error correction lets QR codes work even if they're partially damaged or obscured. There are four levels: L (7% recovery), M (15% recovery), Q (25% recovery), and H (30% recovery). Most generators default to M, which is fine for most uses. If your code will be printed on a surface that might get dirty or folded, choose H. If you're displaying it on a screen, L is sufficient.

Choosing what data to encode

QR codes can hold different types of data, and the format matters. A URL should start with https:// or http://. Contact information should follow the vCard format if you want it to auto-populate a phone's contact app. WiFi credentials need the WIFI format: WIFI:T:WPA;S:networkname;P:password;;

Plain text works for anything else — a code, a message, a serial number. Keep it under 2953 bytes if you want to may provide it fits in version 40. Most codes you'll create will be much smaller.

Avoid encoding sensitive information like passwords or API keys in a QR code. Anyone who scans it can see what's inside. If you need to protect data, use a short URL that points to a secure page instead.

Testing and troubleshooting your code

Before you print or distribute a code, test it on at least two different phones. Open the camera app, point it at the code, and verify that it opens the correct URL or displays the correct text. Some older phones may not scan codes reliably, but most phones from the last five years will work.

If a code won't scan, the most common causes are: the image is too small (scale it up to at least 150 pixels), the contrast is too low (make sure the code is black on white or a light background), or the content has special characters that weren't encoded correctly. Try regenerating the code with a different tool or simplifying the content.

If you're embedding a code in a document or image, leave white space around it — at least one quiet zone, which is typically 4 modules (the small squares that make up the code) on each side. This helps phones focus on the code itself.

Frequently Asked Questions

Can I customize the colors or add a logo to my QR code?

Yes, but carefully. You can change the foreground and background colors in most generators, and some let you add a logo in the center. Keep contrast high — dark on light works best. If you add a logo, make sure it covers no more than 20% of the code, or it may not scan. Test it on multiple phones before using it.

What's the difference between a QR code and a barcode?

A barcode stores data in one dimension (left to right); a QR code stores it in two dimensions (left to right and top to bottom). QR codes hold much more information — up to 2953 bytes — and work at any angle. Barcodes are simpler and faster to scan in retail settings, but QR codes are more versatile.

Do I need to pay for a QR code generator?

No. Free generators like QR Code Generator and QR Server have no limits and no hidden costs. Some paid services offer analytics (tracking how many times a code was scanned) or custom branding, but those are optional features. For most uses, free is sufficient.

How long does a QR code stay valid?

A QR code itself doesn't expire — the image is just data. But if the code points to a URL, that URL can go offline or change. If you're encoding a static URL, test it periodically to make sure the page still exists. If you're encoding plain text or contact information, it's permanent.

Can I track how many people scan my QR code?

Not with a free generator. To track scans, use a URL shortener like Bit.ly or TinyURL, encode that shortened URL in the QR code, and check the shortener's analytics. Alternatively, some paid QR code services offer built-in tracking, but you'll need to create an account and may pay a monthly fee.