# Making QR codes that scan: payloads, error correction and size

> What goes into a URL, Wi-Fi or contact QR code, how the four error-correction levels trade damage tolerance for density, how much a code can hold, why the picture size is not always what you chose, and how to test a code before printing.

- Tool: [QR Code Generator](https://toolsg.com/en/qr-code-generator)
- Language: en (available: en, zh, ms, ta)
- Last verified against official sources: 2026-10-18
- Source site: ToolSG — a planning guide, not official or financial advice. Cite the agencies listed under Sources.

## Key figures at a glance

| Fact | Value | Source |
| --- | --- | --- |
| Error-correction levels | L about 7%, M about 15%, Q about 25%, H about 30% — Share of the code's data that can be restored if part of it is damaged. This tool defaults to M. | [Wikipedia](https://en.wikipedia.org/wiki/QR_code) |
| Largest code (version 40) | 177 × 177 modules, up to 2,953 bytes at level L — At level H the limit falls to 1,273 bytes. Digits only reach 7,089 at level L. | [Denso Wave](https://www.qrcode.com/en/about/version.html) |
| Quiet zone (margin) | 4 modules wide, and this tool's default is 4 — The blank border around the code. The margin field accepts 0 to 20, but do not use 0 for printed codes. | [Denso Wave FAQ](https://www.qrcode.com/en/faq.html) |
| Wi-Fi payload | `WIFI:T:WPA;S:name;P:password;;` — The format documented by the ZXing project. Hidden networks need an extra H:true field, which this tool does not add. | [ZXing wiki](https://github.com/zxing/zxing/wiki/Barcode-Contents) |
| Downloads | PNG, SVG and JPG — Width options 128, 256 or 512 px. SVG is vector, JPG is lossy. |  |

## Making a QR code people can actually scan

Most failed QR codes fail because of size, contrast or a wrong payload, not because of the generator.

1. **Choose the payload type** (First) — URL or text, Wi-Fi, or a contact card. The type decides the exact string that is encoded.
2. **Keep the content short** (Before generating) — Fewer characters mean fewer, larger modules, which scan faster and survive poor printing. Shorten long links before encoding them.
3. **Pick the error-correction level** (In the settings) — M suits screens and clean paper. Choose Q or H for stickers, outdoor signs or surfaces that will wear. Higher levels make the code denser.
4. **Set size, colours and margin** (In the settings) — Dark code on a light background with the default 4-module margin. Prefer SVG for print because it stays sharp at any size.
5. **Test before you publish** (Last) — Scan the exact file or printout with two different phones. You can also read it back with the decoder. Tools: [QR Code Decoder](https://toolsg.com/en/qr-code-decoder)

## What the tool encodes

A QR code stores one string. The tool builds that string from the type you pick:

| Type | String encoded | Notes |
| --- | --- | --- |
| URL / Text | Exactly what you typed, with leading and trailing spaces removed | Include `https://` so phones treat it as a link. |
| Wi-Fi | `WIFI:T:WPA;S:HomeNet;P:secret123;;` | Security is WPA/WPA2, WEP or none (`nopass`). The characters `\ ; , : "` in the name and password are escaped with a backslash, as ZXing specifies. Spaces at the start or end of the name or password are removed. Hidden networks are not supported. |
| Contact | A vCard 3.0 block with `FN`, `TEL`, `EMAIL` and `ORG` lines | You need at least a name, phone or email. Fields are inserted as typed. |

The vCard block has a `FN` line but no `N` line, and the lines end in a plain line feed. RFC 2426 requires `N`, requires commas and semicolons inside values to be escaped, and ends lines with CRLF. Many scanners cope anyway, but test with the phones you care about, and avoid commas and semicolons in the fields.

The code is **static**. The data is baked into the pattern, so it cannot be edited later and there is no scan tracking. A static code never expires, but a link inside it works only as long as the page does. The tool has no logo overlay and does not build payment (for example PayNow) payloads.

## Error correction and capacity

Reed–Solomon error correction lets a scanner rebuild missing data. A higher level spends more of the code on repair, so the same message needs a bigger, denser code.

| Level | Restores about | Largest text at version 40 (bytes) | Chinese characters (3 bytes each in UTF-8) |
| --- | --- | --- | --- |
| L | 7% | 2,953 | 984 |
| M | 15% | 2,331 | 777 |
| Q | 25% | 1,663 | 554 |
| H | 30% | 1,273 | 424 |

The code size depends on both the message and the level. These were computed with the same library the tool uses (modules per side, margin not counted):

| Message | Length | L | M | Q | H |
| --- | --- | --- | --- | --- | --- |
| `https://www.iras.gov.sg/` | 24 chars | 25 × 25 | 25 × 25 | 29 × 29 | 29 × 29 |
| `WIFI:T:WPA;S:HomeNet;P:secret123;;` | 34 chars | 25 × 25 | 29 × 29 | 29 × 29 | 33 × 33 |
| A link with tracking parameters | 109 chars | 41 × 41 | 45 × 45 | 49 × 49 | 57 × 57 |

Digits pack tightest (7,089 at level L, 3,057 at level H), then upper-case letters with a few symbols, then ordinary bytes. A lower-case URL uses byte mode. If the message is too long for the chosen level, the tool shows a generation error and you need a lower level or shorter text.

## Size, colour and margin

- **Size is a target, not a guarantee.** The width includes the margin and is shared across all modules. With the default margin, the 25-module IRAS link occupies 33 modules, so 256 px gives 7.76 px per module. The 109-character link needs 53 modules at level M and 65 at level H, so the same 128 px gives only 2.42 and 1.97 px per module. If the pixels per module are not a whole number, module edges differ by a pixel, so print from SVG.
- **Small can grow.** If the code plus margin is wider than the chosen width, the library ignores the width and uses 4 px per module. A 1,000-character text at level M is 121 modules, so "Small (128px)" produces a 516 px image. The 256 and 512 options always fit.
- **Colours.** Use a dark foreground on a light background with strong contrast. Tested with the library's output: dark red on white reads in this site's [QR code decoder](https://toolsg.com/en/qr-code-decoder), but a light code on a dark background does not, and neither does mid-grey on light grey. Other scanners vary, so inverted codes are a risk.
- **Margin.** Four modules is the standard quiet zone. Cropping it tightly is a common reason a printed code will not scan.
- **Format.** SVG scales without blur, so use it for posters and stickers. PNG suits screens. JPG is lossy (quality 0.95) and is saved on a white background.

> **Tip:** Scan from the real distance. A code read from 3 metres needs to be far bigger than one on a business card, and no setting here changes that.

## Privacy

Codes are generated in your browser and nothing is sent to a server. The tool does keep a history of your last 20 codes in your browser's local storage, including Wi-Fi names and **passwords in plain text**. It stays until you delete entries, press Clear All, or clear site data; closing the browser does not remove it. Clear the history on a shared computer.

## Common mistakes

- **Encoding a link without `https://`.** Some scanners show it as plain text.
- **Low contrast or inverted colours.**
- **No margin** on printed codes.
- **Stretching the image** so the modules are no longer square.
- **Choosing the highest level for a long message.** The code gets so dense that the modules print too small.
- **Using a short-lived link** and expecting the printed code to keep working.
- **Putting a Wi-Fi password in a code displayed publicly.** Anyone who scans it can join the network.

## Related tools

- [QR code decoder](https://toolsg.com/en/qr-code-decoder) — read a code back to check what it contains.
- [Image converter](https://toolsg.com/en/image-converter) — convert a downloaded PNG to another format.
- [Text to slug converter](https://toolsg.com/en/text-to-slug) — build clean, short URL paths to encode.

## Frequently asked questions

**How do I create a QR code?**

Simply enter your text, URL, or data in the input field and click "Generate QR Code". The QR code is instantly created and ready to download.

**Is the QR code generator free?**

Yes, this QR code generator is completely free with no limits. Generate as many QR codes as you need without registration or payment.

**Are my QR codes stored on your servers?**

No, all QR code generation happens entirely in your browser. Your data never leaves your device, ensuring complete privacy and security.

**Can I customize the QR code appearance?**

Yes, you can customize colors, size, error correction level, and margin. Keep strong contrast between the two colors so the code stays scannable.

**What error correction level should I use?**

Use Low (7%) for clean printing, Medium (15%) for standard use, Quartile (25%) for damaged surfaces, and High (30%) when you expect wear.

**How large should my QR code be for printing?**

For print, QR codes should be at least 2x2 cm (0.8x0.8 inches). Larger is better for scanning from a distance. For print, download the SVG, or the 512px PNG at minimum.

**Can I create PayNow QR codes?**

While this generates standard QR codes, PayNow QR codes have specific formats. For PayNow, use your bank's official app or generator to ensure proper formatting and compliance.

**Do QR codes expire?**

QR codes themselves never expire - they're static images. However, if your QR code links to a URL, that webpage can change or be removed, effectively "breaking" the QR code.

**Can I track QR code scans?**

Static QR codes can't be tracked. For analytics, use dynamic QR code services. This tool creates static QR codes for privacy and simplicity.


## Sources

- [Denso Wave — QR Code error correction](https://www.qrcode.com/en/about/error_correction.html) — Defines the correction function; confirms the M (15%) and Q (25%) figures.
- [Denso Wave — QR Code versions and capacity](https://www.qrcode.com/en/about/version.html) — Versions 1 to 40, from 21 × 21 to 177 × 177 modules.
- [Denso Wave — FAQ](https://www.qrcode.com/en/faq.html) — A white space of 4 modules is needed around the code; about 3 KB maximum at version 40, level L.
- [Wikipedia — QR code](https://en.wikipedia.org/wiki/QR_code) — All four correction levels and the version 40 capacity by data type.
- [ZXing wiki — Barcode Contents (Wi-Fi format and escaping)](https://github.com/zxing/zxing/wiki/Barcode-Contents)
- [RFC 2426 — vCard MIME Directory Profile (vCard 3.0)](https://www.rfc-editor.org/rfc/rfc2426)
- [node-qrcode — the library this tool uses](https://github.com/soldair/node-qrcode)
