Skip to content
TrueScalers

QR code generator

A QR code stores data in a square grid of modules read optically in two dimensions. Error correction level M recovers the code when up to 15% of it is damaged or covered, and level H raises that to 30%. A version 4 code holds 33 × 33 modules and encodes up to 78 alphanumeric characters at level M.

Loading tool…

How to use the QR code generator

  1. 01

    Choose what the code should do

    Select a type: a website URL, plain text, a Wi-Fi network, a contact card, an email, a phone number or an SMS.

  2. 02

    Fill in the content

    Enter the destination or details. The correct payload prefix is added automatically so scanners offer the right action.

  3. 03

    Set error correction

    Use level M for screens and level Q or H for anything printed, placed outdoors, or covered by a logo in the centre.

  4. 04

    Adjust size and colours

    Set the pixel size and quiet zone, and change the foreground and background colours while keeping strong contrast.

  5. 05

    Download and test

    Download as PNG for general use or SVG for print, then scan the finished code with a real phone before distributing it.

The formula

modules = 4 × version + 17,   version from 1 to 40
version
The QR symbol version from 1 to 40, chosen automatically from the data length and error-correction level.
modules
The grid width in modules — 21 × 21 at version 1, rising to 177 × 177 at version 40.
error correction
Reed-Solomon redundancy at level L, M, Q or H, recovering 7%, 15%, 25% or 30% of the symbol respectively.
quiet zone
The blank margin around the symbol, required by the standard to be at least 4 modules wide.

Error correction and capacity trade against each other: at a fixed version, moving from level L to level H roughly halves how much data fits, because the redundancy occupies the space the payload would have used. Higher levels are worth it for printed codes, which get scuffed, and for codes with a logo placed over the centre.

Worked example

Content
https://truescalers.com
Error correction
M — recovers 15% damage
Size
512 px
Quiet zone
2 modules
Result
Version 2 — a 25 × 25 module grid, exported at 512 × 512 pixels

The URL is 23 characters, which fits inside version 2 at error-correction level M. Version 2 gives 4 × 2 + 17 = 25 modules per side. Exported at 512 pixels, each module is 512 ÷ 25 ≈ 20.5 pixels square, comfortably above the 4-pixel minimum any camera needs to resolve. Raising error correction to level H on the same content would push the symbol to version 3, a 29 × 29 grid, because redundancy takes space the payload previously used.

Frequently asked questions

How does a QR code work?

A QR code encodes data as a grid of black and white modules read in two dimensions. Three large squares in the corners let a scanner find and orient the symbol regardless of rotation, and Reed-Solomon error correction lets it reconstruct the data even when part of the code is damaged, dirty or obscured.

What error correction level should be used?

Level M, recovering 15%, is the sensible default for a code displayed on a screen. Level Q at 25% or level H at 30% suit printed material, outdoor signage and anything likely to be scuffed or partly covered. Placing a logo over the centre of a code requires level H, since the logo destroys modules the scanner must reconstruct.

Do these QR codes expire or track scans?

Neither. The code generated here is static: the destination is encoded directly into the pattern, so it works forever and no server sits between the scanner and the destination. Many free generators produce dynamic codes that point at their own redirect domain, which lets them count scans and disable the code later, often behind a subscription.

How much data fits in a QR code?

The maximum at version 40 with error correction level L is 7,089 numeric digits, 4,296 alphanumeric characters, or 2,953 bytes. Practical limits are far lower: past roughly 300 characters the modules become too small to scan reliably from a phone at arm's length unless the code is printed large.

What size should a printed QR code be?

The usual rule is that the code should be at least one tenth of the scanning distance. A code read from 30 centimetres needs to be about 3 centimetres square; one read from 3 metres needs about 30 centimetres. Add the mandatory quiet zone of at least four modules, and never print smaller than 2 centimetres.

Can QR code colours be changed?

Yes, provided contrast stays high and polarity is preserved — the foreground must be darker than the background, because scanners expect dark modules on a light field. Inverting that breaks many readers. Keep a contrast ratio of at least 4:1, avoid gradients across the symbol, and always test the finished code on a real phone.

How does a Wi-Fi QR code work?

A Wi-Fi code encodes a specific string, "WIFI:T:WPA;S:network;P:password;;", which phones recognise and turn into a join-network prompt. The password is stored in plain text inside the pattern, so anyone who scans or photographs the code obtains it — that is fine for a guest network printed on a café card, and unwise for a primary network.

Sources

Last reviewed: · Formula and sources verified by Syed Aqeel Ahmad Gillani. See the methodology for how every calculation is derived.