Guide

QR Codes & Barcodes Explained

How QR codes store data, error correction levels, common payload formats (WiFi, vCard, TOTP, SEPA), and how QR compares to Data Matrix, Aztec and 1D barcodes.

Last updated: 26 July 2026

A QR code (Quick Response code) is a two-dimensional (2D) matrix barcode: a square grid of black and white cells that encodes data in both the horizontal and vertical directions. Invented by Denso Wave in 1994 and standardised as ISO/IEC 18004, QR codes can store far more than a traditional 1D barcode and can still be read even when partly dirty or damaged. Today they appear on payments, tickets, packaging, WiFi sign-in cards, business cards and app-download links.

How a QR code stores data

The individual black and white cells are called modules. Data is encoded as a bit stream — each byte becomes a pattern of dark (1) and light (0) modules — then arranged into the grid following a fixed placement algorithm.

Several structural features let a scanner locate and decode the grid regardless of angle or orientation:

Versions

QR codes come in 40 versions, from version 1 (21×21 modules) to version 40 (177×177 modules). Each step up adds 4 modules per side and stores more data. The generator picks the smallest version that fits your payload at the chosen error-correction level.

Error correction levels

QR codes use Reed–Solomon error correction, so a code stays readable even when part of it is obscured or damaged. There are four levels, trading data capacity for robustness — a higher level adds redundant data, meaning fewer usable modules and therefore a denser or larger code for the same payload.

Level Approx. recovery Trade-off Typical use
L (Low) ~7% Most data capacity, least robust Clean on-screen display, short-lived codes
M (Medium) ~15% Balanced default General print and web use
Q (Quartile) ~25% Denser, more robust Codes exposed to dirt or wear
H (High) ~30% Least capacity, most robust Codes with a centre logo, industrial/outdoor use

If you place a logo in the middle of a code, use level H so the covered modules can be reconstructed.

Common QR payload formats

A QR code just stores text — but scanners recognise certain conventional string formats and act on them. The exact syntax matters; a stray character can stop a phone from offering the right action.

URL — the most common payload. Just the full address:

https://codingsetu.com/tools/qr

WiFi — join a network. Escape any ; , : \ in the SSID/password with a backslash:

WIFI:T:WPA;S:MyNetwork;P:MyPassword;;

T is the auth type (WPA, WEP, or nopass), S the SSID, P the password. For a hidden network append H:true;.

vCard / MeCard — a contact. MeCard is more compact:

MECARD:N:Doe,John;TEL:+911234567890;EMAIL:john@example.com;;
BEGIN:VCARD
VERSION:3.0
N:Doe;John
TEL:+911234567890
EMAIL:john@example.com
END:VCARD

Email, SMS, phone, location:

mailto:hello@example.com?subject=Hi&body=Message
SMSTO:+911234567890:Your message here
tel:+911234567890
geo:19.0760,72.8777

otpauth:// (TOTP) — provision a two-factor authenticator app. Defined by the Key URI format:

otpauth://totp/Example:alice@example.com?secret=JBSWY3DPEHPK3PXP&issuer=Example&algorithm=SHA1&digits=6&period=30

WhatsApp — open a chat via wa.me (number in international format, no + or spaces):

https://wa.me/911234567890?text=Hello

SEPA / EPC (Girocode) — a European bank transfer. The EPC QR standard uses a fixed line order:

BCD
002
1
SCT
BANKBEBBXXX
Jane Doe
BE72000000001616
EUR12.50

Invoice 123

1D vs 2D barcodes

A 1D (linear) barcode — EAN-13, UPC, Code 128, Code 39 — encodes data in the varying widths of vertical bars, read along a single line. It holds only a small amount of data (typically a product number) and has no error correction, but it is compact and universally supported at retail.

A 2D barcode stores data in a grid, packing much more information into a smaller area and adding error correction. The main 2D symbologies:

Symbology Strengths Typical use
QR code High capacity, ubiquitous phone support, error correction Marketing, payments, WiFi, tickets, GS1 Digital Link
Data Matrix Very high density at tiny sizes; needs only 20% quiet zone Direct part marking on small components, electronics, pharma (GS1)
Aztec No quiet zone needed; central finder; robust on low-quality print Transit and airline boarding passes / e-tickets

Data Matrix wins where space is extremely tight (marking a circuit board or surgical instrument). Aztec is common on rail and airline tickets because it needs no surrounding quiet zone and reads well from a phone screen or crumpled printout. QR dominates consumer-facing uses thanks to camera support on every phone. All three are increasingly used to carry GS1 structured data — see GS1 Digital Link, which lets a single QR act as both a product barcode and a web link.

Practical tips

Standards & references

Try it

Generate QR codes and barcodes for any of the formats above — entirely in your browser, with nothing uploaded — using the CodingSetu QR & barcode tools linked below.

Frequently asked questions

What's the maximum data a QR code can hold?

The theoretical maximum (version 40, error correction level L) is about 7,089 numeric digits, 4,296 alphanumeric characters, 2,953 bytes, or 1,817 Kanji characters. In practice you should stay far below this — dense QR codes need a high-resolution scan and a clean print, so keep payloads short and prefer a shortened URL over embedding large blobs.

Which error correction level should I use?

Use L or M for clean on-screen or high-quality print where nothing overlaps the code. Use Q or H when the code may get dirty, damaged, or has a logo placed in the centre — H can recover about 30% of the code. Higher correction means more modules for the same data, so the code becomes denser or physically larger.

Can a QR code contain a WiFi password?

Yes. A WiFi payload uses the format WIFI:T:WPA;S:MyNetwork;P:MyPassword;; — most phone cameras recognise it and offer to join the network. Note the password is stored in plain text inside the code, so anyone who scans (or photographs) the code can read it. Treat a printed WiFi QR like a written-down password.

Is the QR code generated privately in my browser?

Yes. The CodingSetu QR and barcode tools build the code entirely in your browser using client-side JavaScript. Your URL, WiFi password, contact details or any other payload never leave your device and are not uploaded to a server.

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

A traditional barcode (like EAN-13 or Code 128) is 1D — it encodes data in the widths of vertical bars and is read across one line. A QR code is 2D — it stores data in a square grid of modules read in both directions, so it holds far more data in a smaller area and survives partial damage thanks to built-in error correction.

Related tools