Skip to content

QR Code Generator

Embed

Paste this where you want QR Code Generator on your site. Adjust the height to fit.

<iframe src="https://www.browserutils.dev/embed/qr-code-generator/" width="100%" height="500" frameborder="0" loading="lazy" title="QR Code Generator"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://www.browserutils.dev/tools/qr-code-generator/">QR Code Generator</a> by BrowserUtils</p>

Generate QR codes from text or URLs.Runs in this tab.

How to use QR Code Generator

  1. Paste a URL or other text into Text or URL. The code redraws as you type. The field starts as https://example.com.
  2. Set Error Correction (default Medium, 15%) and Size (default 256px). Dark and Light pick the module colors.
  3. Download PNG, or Copy Data URI. The size is a target: the image is the nearest width where every module is a whole number of pixels, including the quiet zone.

How the generator sizes the code

The generator uses the open-source qrcode library and redraws on every keystroke. It picks the smallest QR version (1 to 40) that fits your text at the chosen error-correction level. A version v symbol is 17 + 4v modules (the individual squares) on a side, so version 1 is 21 × 21 and version 40 is 177 × 177.

The library also splits the text into segments and stores each one in the cheapest mode it fits:

Mode Characters Cost
Numeric 0–9 10 bits per 3 digits
Alphanumeric 0–9, A–Z (uppercase only), space, $ % * + - . / : 11 bits per 2 characters
Byte Everything else, as UTF-8 8 bits per byte

Lowercase letters aren’t in the alphanumeric set, so an ordinary URL is stored as bytes. The scheme and host of a URL are case-insensitive, so uppercasing them is always safe and can drop a version. Uppercase the path only if your server treats it case-insensitively, like a short-link code you control. Here’s the version each text gets at each level:

Text Length L M Q H
https://example.com 19 2 2 2 3
https://example.com/r/7KQ2X9 28 2 3 3 4
HTTPS://EXAMPLE.COM/R/7KQ2X9 28 2 2 2 3
WIFI:T:WPA;S:MyNetwork;P:correct-horse-battery;; 48 3 4 4 6
A URL with three UTM parameters 98 5 6 8 9

Byte-mode capacity by version:

Version Modules L M Q H
1 21 × 21 17 14 11 7
2 25 × 25 32 26 20 14
3 29 × 29 53 42 32 24
4 33 × 33 78 62 46 34
6 41 × 41 134 106 74 58
10 57 × 57 271 213 151 119
20 97 × 97 858 666 482 382
40 177 × 177 2,953 2,331 1,663 1,273

These limits are in bytes, so é takes 2 and most emoji take 4. The text isn’t tagged with a character set (there’s no ECI header), and most scanners read it as UTF-8. Past the version 40 limit for your level, the tool shows “The amount of data is too big to be stored in a QR Code”. At the default M level that happens at 2,332 bytes of plain text. Switching to L raises the limit to 2,953.

What to type for each kind of content

The scanning phone decides what to do from the text’s prefix. The input is a single-line field, so you can’t enter line breaks: pasted ones are dropped or turned into spaces, depending on the browser.

Content Type this
Web page https://example.com/menu
Email mailto:jane@example.com?subject=Order%20123
Phone call tel:+15555550123
Wi-Fi WIFI:T:WPA;S:Cafe Guest;P:espresso42;;
Contact, one line MECARD:N:Doe,Jane;TEL:+15555550123;EMAIL:jane@example.com;;
Authenticator account otpauth://totp/Example:jane@example.com?secret=JBSWY3DPEHPK3PXP&issuer=Example
  • Wi-Fi: T is WPA (for WPA and WPA2), WEP or nopass. Leave out P for an open network, and add H:true; if the SSID is hidden. Escape \, ;, ,, " and : with a backslash inside the SSID or password, so the network Cafe;Guest with password p@ss:word becomes WIFI:T:WPA;S:Cafe\;Guest;P:p@ss\:word;;.
  • Contacts: a vCard needs a line break between fields, so you can’t build one in this input. MECARD is the single-line alternative, but scanner support for it varies, so test on the phones your audience uses. To make a full vCard, use the command line below.
  • Authenticator accounts: the TOTP generator guide explains the otpauth:// parameters.

Pixel size, quiet zone and printing

The size menu is a target, not an exact width. The tool draws every module the same whole number of pixels, and picks the number that brings the whole image, quiet zone included, closest to the size you chose. The image is then (modules + 8) times that number wide, which is rarely exactly 128, 256, 512 or 1024, so the line under the preview gives the actual size:

Size menu Version 2 (33 modules across) Version 6 (49 modules across)
128 px 4 px per module, 132 px 3 px per module, 147 px
256 px 8 px per module, 264 px 5 px per module, 245 px
512 px 16 px per module, 528 px 10 px per module, 490 px
1024 px 31 px per module, 1023 px 21 px per module, 1029 px

https://example.com at M is version 2. From version 26 (121 modules, 129 across with the quiet zone), a 128 px image can’t hold the code even at 1 px per module. The tool then draws 1 px per module, 129 to 185 px wide, and says so under the preview. Choose 256 px or more for codes that dense.

  • Print size: at 300 dpi, the 1023 px version 2 file prints 8.7 cm (3.4 in) wide, with modules 2.6 mm across. For anything bigger, scale it by a whole factor (2×, 3×) with nearest-neighbor resampling, which keeps every module the same width and the edges sharp, or make an SVG with the command line below.
  • Quiet zone: the image includes the light border of 4 modules on each side that ISO/IEC 18004 requires, drawn in the light color. Don’t crop into it when you place the code. On a colored or busy background, keep the whole border in the code’s light color rather than letting the background show through.
  • Colors: both colors are always opaque, because the color pickers have no alpha channel, so you can’t make a transparent background. Keep the dark color clearly darker than the light one.
  • Logos: the tool doesn’t add logos. If you place one afterwards, switch to H, keep the logo small and centered, keep it off the three corner squares, and test-scan the result.

Copy Data URI copies a data:image/png;base64,… string you can paste into an <img src>. The image to Base64 converter does the same for any image file.

Command-line equivalent

The same library includes a CLI that writes SVG and reads multi-line input from stdin:

# Vector output with the standard 4-module quiet zone
npx qrcode -e M -q 4 -o menu.svg "https://example.com/menu"

# A vCard, line breaks included
printf 'BEGIN:VCARD\r\nVERSION:3.0\r\nN:Doe;Jane;;;\r\nFN:Jane Doe\r\nTEL;TYPE=CELL:+15555550123\r\nEMAIL:jane@example.com\r\nEND:VCARD\r\n' \
  | npx qrcode -e M -o contact.svg

The output type comes from the file extension, so -o code.png writes a PNG. For a larger raster, set the pixels per module with -s 32 rather than a width with -w 2048: a width that isn’t a multiple of the module count leaves some modules a pixel wider than others.

Next step

Questions

How do I make a QR code from a URL?
Paste the URL into Text or URL. Leave Error Correction on Medium (15%) and Size on 256px, then click Download PNG. https://example.com is version 2 at level M. The guide below has the version table and the Wi-Fi, mailto, and tel formats.
What is the maximum amount of data a QR code can hold?
At error correction L, version 40 holds 2,953 bytes. At the default M level the byte-mode limit is 2,331 bytes, and the tool errors past the version 40 limit for the level you picked. The guide lists the byte capacities.
Can I generate a QR code for Wi-Fi credentials?
Paste WIFI:T:WPA;S:NetworkName;P:Password;; into Text or URL. The phone decides what to do from that prefix. The input is a single line, so a vCard needs the CLI method in the guide.
What size should I print a QR code for reliable scanning?
For close-range scanning, print the code at least 2 cm (0.8 inches) wide. For a poster, keep each module at least 1 to 2 mm wide. The on-page size control is a pixel target for the PNG, including a 4-module quiet zone.

More in Image & Media

All 19 image & media