Email, SMS and phone call QR codes
Make an email QR code, plus SMS and phone call codes. See the exact mailto, SMSTO and tel text, how to encode a subject, and how big each code gets.
An email QR code is a mailto: link turned into a square. When someone scans it, their phone opens a draft in the mail app, addressed to you, with the subject and message already filled in. An SMS code does the same with a text message, and a phone code starts a call. None of them sends anything by itself: the person scanning reads the draft and presses send.
All three are plain text under the pattern, which means you can write them by hand, check them, and understand why one of them occasionally misbehaves. You can also let a tool do it: the free email QR code maker, the SMS one and the phone call one build the text for you and encode it correctly. This page covers what that text is, where it goes wrong, and how big the codes come out. For the other kinds, the pillar guide on how to make a QR code walks through all eleven.
What each one stores
We measured these with node scripts/qr-facts.mjs at error correction level M. Version is the size class of the code; the module count is the grid it draws, before the four-module margin.
| Kind | Starts with | Example | Version | Grid |
|---|---|---|---|---|
| Phone call | tel: |
tel:+919876543210 |
1 | 21 by 21 |
| Email, address only | mailto: |
mailto:[email protected] |
2 | 25 by 25 |
| Email with subject | mailto: |
...?subject=Order%20enquiry |
4 | 33 by 33 |
| Email with subject and message | mailto: |
111 bytes, shown below | 7 | 45 by 45 |
| SMS with message | SMSTO: |
46 bytes, shown below | 3 | 29 by 29 |
A phone number is the smallest code you can make: a version 1 code, 21 by 21 modules. A full email draft is more than twice as wide. That matters when the code is going on a card or a sticker, because the same printed square gets smaller dots as the code gets denser. What size should a QR code be when printed? turns that into sizes by use.
Email: the mailto format
The mailto: scheme is defined in RFC 6068. The shape is the address, then a question mark, then fields joined by ampersands:
mailto:[email protected]?subject=Order%20enquiry&body=Hi%2C%20I%20would%20like%20to%20ask%20about%20my%20order.
That’s the exact text our generator produces for an address, a subject of “Order enquiry” and a message of “Hi, I would like to ask about my order.” It’s 111 bytes, and the code comes out at version 7, 45 by 45 modules at level M.
Five rules from the RFC cover nearly every mistake:
- One question mark. The
?introduces the first field. After that, every field starts with&. RFC 6068 givesmailto:[email protected][email protected]&body=helloas the correct form and calls a second?invalid. - Spaces become
%20. The RFC says all spaces should be encoded as%20when producing a link. - Escape
&,=,?and#inside the text. They’re structure characters. Per the RFC,?,=and&must be written as%3F,%3Dand%26when they aren’t acting as delimiters, and#as%23. A subject of “Fish & Chips” typed raw ends at the&, and what follows is read as the next field. - Line breaks are
%0D%0A. That’s what the RFC specifies for a body, and it’s what our generator writes. Many other tools write a bare%0A(the browser’s encoder does that by default), which most mail apps accept, but if a multi-line message matters, scan a proof before you print. - Non-English text is UTF-8 percent-encoded. Hindi, Tamil or accented text in a subject is converted to bytes and each byte is written as
%XX. That makes the code bigger: most Devanagari and Tamil characters take three bytes, which is nine characters of payload each, so a short subject in Devanagari can cost more than a long one in English.
You can add cc and bcc fields, and several recipients separated by commas. An example written by hand rather than from our generator:
mailto:[email protected],[email protected][email protected]&subject=Table%20booking&body=Name%3A%20%0D%0APeople%3A%20%0D%0ADate%3A%20
That one is 136 bytes and a version 8 code, 49 by 49 modules. It opens a draft with a three-line template for the customer to fill in. It’s useful, and it’s already at the size where a business card gets crowded.
Be careful with bcc. The RFC’s security section says addresses in a bcc field are publicly visible in the link, so anyone who decodes the code can read them. The same is true of every address in the code, and that includes yours. A printed code publishes the address it holds to anyone who scans it or points a decoder at a photo of it. Use a role address such as orders@ or hello@ that you can filter, not your personal one.
SMS: three spellings, one safe choice
Text message codes have no single standard in practice, and that’s where trouble starts. Three forms are in use.
SMSTO:919876543210:Hi, I want to book a table.
sms:+919876543210?body=Hi%2C%20I%20want%20to%20book%20a%20table.
sms:+919876543210:Hi%2C%20I%20want%20to%20book%20a%20table.
The second is the official form. RFC 5724 defines the sms: scheme with a ?body= field, a percent-encoded UTF-8 body that may appear only once, and comma-separated recipients. The third, sms:number:text, is listed on the ZXing wiki’s page on barcode contents as a form with the text after a second colon. The first, SMSTO:, appears there as a form “observed in the wild”.
Our generator writes the first one, which also happens to be the smallest. The SMSTO: code for that sentence is 46 bytes, version 3, 29 by 29 modules. The sms: code with ?body= is 64 bytes, version 4, 33 by 33, because the message has to be percent-encoded and the encoded commas and spaces take three characters each.
The more important point is iPhone support. Apple’s iOS 11 developer session QR Code Recognition on iOS 11 says tapping an SMS URI brings you to the compose window for that number in Messages, and that “the SMSTO format is also supported for describing a text message action”, which “allows you to prepopulate the text message content.” So both forms are documented as working. We haven’t tested every iOS and Android version, and apps differ, so print a proof and scan it on at least one iPhone and one Android phone.
A few details to get right:
- Write the number with its country code, such as
91for India, and no spaces or brackets. Our generator strips everything except digits and a plus sign. - Keep the message short. A text message code with a long sentence turns dense quickly; anything past a line is better as a link.
- RFC 5724 notes that characters the SMS character set cannot represent may be dropped or converted, with the user told. Try an emoji or a rare script on your own phone first.
- The person scanning still has to press send, so a code can only prefill a draft. That is also why you should read the number and the text whenever you scan an SMS code from a stranger: the draft is the whole check. Our scanner shows both before it opens anything.
If your customers use WhatsApp more than SMS, the WhatsApp QR code guide covers the wa.me link, which opens a chat instead.
Phone: tel and the plus sign
The call code is the simplest of the three:
tel:+919876543210
RFC 3966 defines the tel: scheme. It says globally unique numbers are identified by a leading + and carry the country code and the national number, and that local numbers must carry a phone-context and should be avoided unless there’s no way to give the global form. In plain terms: always write the plus, the country code and the full number, with no spaces. The RFC allows hyphens, dots and brackets for readability, but it says spaces must not be used, so leave all of it out. Apple’s session says a tapped tel: code starts a call in the Phone app.
What phones do with them
Apple’s session lists the actions: a mailto: code opens a new message in Mail with the recipient filled in, an SMS code opens the compose window in Messages, and a tel: code starts a call in the Phone app. For Android, we found no Google page that documents which payloads the camera acts on, so we won’t describe it as certain. Pixel and Galaxy phones each route a scan through their own camera app, so test on the phones your customers are likely to carry.
That’s why the habit that matters is the proof. Before you print:
- Generate the code, then scan it with the camera on an iPhone and an Android phone.
- Look at what opens. The recipient, subject and message should all be filled in, and a long subject should not be cut off.
- Read the raw text in our scanner, which shows the address, subject or number before you open anything.
- Send a test email or text to yourself.
When a static code is the wrong tool
These codes are static: the address or number is printed into the pattern and can’t be changed. If you change your email address, you reprint. A static code can’t count scans either, and a mailto: code has no way to report that anyone opened it; if you want to know how many people used a poster, a link to a web page can be counted, as how to track QR code scans explains. For a card that carries your name, phone and email together, a contact code is better than three separate ones: see vCard QR code: put your contact details in a scan.
Ready to try it? Free, no sign-up, made in your browser.
Make this code now