Is it safe to scan a QR code? What a code can hold and how to spot a bad link
What is inside a QR code (links, Wi-Fi logins, contacts), why scanning is safe but opening can be risky, and five signs of a disguised link, with real examples.
Open the QR and barcode reader Free, in your browser, nothing uploaded.
A QR code is only text printed as a square pattern of dots. Reading that text can do no harm; the risk starts when a phone opens what the text points to, often a web address you never saw. This article explains what a code can hold, why stickers on parking meters and restaurant tables are a favourite trick, and how to read a link before you trust it. It is for anyone who scans menus, tickets, posters or bills. To make a barcode of your own, see barcode maker; if the camera will not start, check it with webcam Test; and if a screenshot is too large to read well, shrink it with image resizer.
What it is
A QR code stores up to a few thousand characters, with spare error correction so it still reads when part of it is dirty or covered. The scanner does not know what the text means. Apps recognise a few common shapes of text:
- Web link: starts with
https://orhttp://. - Wi-Fi login:
WIFI:T:WPA;S:network name;P:password;;, where T is the security, S the name and P the password. - Contact card: begins
BEGIN:VCARDorMECARD:. - Phone, text, email and map point:
tel:,smsto:,mailto:andgeo:followed by the details. - Anything else is plain text.
A web address has a structure worth knowing. In https://shop.example.com/pay, the part between // and the next / is the host. The last two parts of the host (here example.com) say who controls the site; everything before is chosen freely by that owner. Scammers rely on people reading the left end of an address instead of the right.
The reader shows the host separately and raises a warning when the address itself looks suspicious: plain http (not encrypted), a bare number instead of a name, look-alike letters (punycode, written xn--), a user name before an @, a known link shortener, or a host with more than four parts. These checks look only at the text; nothing is sent to any service.
How to use it
- Open the QR code reader and choose a photo or screenshot, or drop it on the box.
- Or press Start camera and hold the code steady; scanning stops by itself when a code is read.
- Look at the type and the fields: site, network name, contact details.
- Read any warnings, then use Open link only if the site is the one you expected, or Copy text to keep the raw text.
A worked example
We gave the reader’s classifier five texts of the kind found on stickers and flyers (all addresses are made up).
https://mybank.example@login-check.example/verify. It looks like a bank address, but the host is login-check.example: everything before@is a user name. Warning: a user name or password part before the site name.http://203.0.113.7/pay. Two warnings: not encrypted, and the address is a bare IP number.https://bit.ly/3xYzAbc. A link shortener, so the real destination is hidden until you open it.https://secure.account.bank.login.example.net/. Six parts; the owner is example.net, and “bank” is just a word they chose. Warning: many parts.WIFI:T:WPA;S:Cafe\;Corner;P:latte2026;H:true;;. A Wi-Fi network named Cafe;Corner (the backslash lets a semicolon sit inside the name), password latte2026, WPA security, hidden network yes.
Checked with the tools
All five results come from the reader’s own code (src/lib/qr/classify.ts), run in Node with classify() and linkWarnings(). While testing, we found that the shortener check matched only the end of the name, so harmless sites such as notbit.ly or react.co (ends in “t.co”) were flagged as shorteners. It now matches the whole name or a real subdomain, such as www.bit.ly, and a test covers it.
Where it is used
- Restaurants and shops. Menus, payment pages and loyalty sign-ups.
- Travel and events. Boarding passes and tickets, which usually hold a code number, not a link.
- Offices and homes. Wi-Fi guest codes on a card, so visitors do not type a long password.
- Teaching online safety. Showing a class how the host is read from the right is a five-minute lesson that sticks.
Common mistakes
- Trusting the place, not the link. A sticker can be pasted over a real code on a meter or poster. Check the host every time.
- Paying through a scanned link. For bills and parking, type the official address or use the official app instead.
- Reading the left side of the address.
bank.secure-login.examplebelongs tosecure-login.example, not to a bank. - Joining any Wi-Fi code. A café code can be swapped too. Ask staff for the network name.
Questions people ask
Can scanning a QR code hack my phone? Reading the text is safe. Harm comes from opening a bad site, installing an app it offers, or typing passwords or card details there.
Why is https not enough? Encryption hides your traffic from others on the network, but scam sites use https too. It says nothing about who runs the site.
What should I do with a suspicious code? Do not open it. Tell the business or venue so they can remove it.
Sources
- QR code symbol: ISO/IEC 18004. The page uses the browser's built-in BarcodeDetector where it exists, and the open-source jsQR library (Apache-2.0) otherwise; both run on the device.
- Wi-Fi (WIFI:), contact (MECARD and vCard), sms, tel, mailto and geo contents follow common conventions used by phone scanner apps. Link warnings are fibub's own checks on the address text only; they do not look the site up anywhere.
If you are an author or publisher and want a credit or a passage changed or removed, tell us and we will act quickly.