Design & CSS· 7 min read

Generating URI Scheme QR Codes: mailto:, smsto: & tel: Math

Understand how operating systems intercept QR payloads to open native apps, how URL encoding preserves special characters, and how SMS segments impact matrix density.

By EasyDesign Team Last updated: 2026-08-24

The mechanics of actionable QR payloads

A QR code is fundamentally a container for raw byte data. When a smartphone camera scans it, the operating system's native parser reads the string and looks for a URI (Uniform Resource Identifier) scheme prefix. If the string begins with `https://`, it opens a browser. If it begins with `mailto:`, `smsto:`, or `tel:`, the OS intercepts the payload and routes it directly to the device's default email, SMS, or dialer application.

This tool abstracts the syntax construction of these URI schemes. Instead of manually formatting a string like `mailto:support@example.com?body=Hello%20World`, you simply input the recipient and the message. The generator compiles the exact URI string required to trigger the native application event, ensuring the payload adheres to the strict formatting rules expected by iOS and Android operating systems.

By encoding these actionable URIs into a QR matrix, you bridge the gap between physical media and digital communication, allowing users to initiate contact with a single scan.

See it in action

Understanding the URI schemes

The tool supports three distinct modes, each mapped to a specific IETF standard or widely accepted telecom convention.

Understanding the URI schemes (Table)

| Mode | URI Scheme | Syntax Example | OS Action |

| --- | --- | --- | --- |

| Email | mailto: | mailto:user@domain.com?body=Hello | Opens default mail client |

| SMS | smsto: | smsto:+1234567890:Hello | Opens SMS app with pre-filled text |

| Phone | tel: | tel:+1234567890 | Prompts to dial the number |

How to generate your contact QR code

The tool processes the URI construction locally, compiling the scheme, address, and message into a scannable matrix.

Pick a mode: Email (mailto:), SMS (smsto:), or Phone (tel:).

Type the recipient email address or phone number. Ensure phone numbers include the country code (e.g., +1) for global compatibility.

For Email or SMS, optionally pre-fill a body message. Watch the live SMS character counter to ensure you stay within standard segment limits.

Download the high-resolution PNG QR code to share digitally or print on physical media.

URL encoding and byte preservation

URI schemes cannot contain raw spaces, line breaks, or special punctuation. If you try to pass a mailto body containing 'Hello & Welcome!', the ampersand and space will break the string parser. The tool solves this by running your text through the `encodeURIComponent()` function.

This function mathematically converts each non-alphanumeric character into a percent-encoded hexadecimal byte sequence. A space becomes `%20`, an ampersand becomes `%26`, and a line break becomes `%0D%0A`. When the smartphone's OS reads the QR code, it reverses this encoding, flawlessly restoring your intended formatting and punctuation inside the native app's text field.

This encoding step is critical. Without it, complex pre-filled messages would truncate the moment they hit a special character, resulting in incomplete emails or SMS drafts.

SMS segment limits and matrix density

While a QR code can technically encode thousands of bytes, practical scannability decreases as the matrix grows denser. SMS messages use the GSM 7-bit alphabet, which allows exactly 160 characters per standard segment. If your pre-filled message exceeds 160 characters, it splits into multiple segments, which can increase carrier costs for the user and bloat the URI string.

Tip: The tool provides a live character counter. Keep your SMS body under 160 characters to ensure single-segment delivery. A shorter message also means fewer bytes to encode, which lowers the QR Version (matrix size), making the code easier to scan from a distance or at an angle.

Cross-platform parsing: iOS vs. Android

Both iOS and Android natively recognize the `mailto:` and `tel:` schemes. However, SMS encoding has historically been fragmented. The official IETF standard is `sms:?body=`, but this syntax is inconsistently supported across older devices.

To guarantee maximum compatibility, this tool uses the `smsto:` scheme. The syntax is `smsto:number:message`. Both Apple's Camera app and Android's Google Lens natively parse `smsto:`, correctly extracting the phone number and dropping the message text into the SMS app's input field. This ensures that regardless of the user's device, the pre-filled text appears exactly as intended, ready for them to hit send.

Common failure modes: Syntax and delimiters

The most common failure mode in URI QR generation is improper delimiter usage. In a `mailto:` string, the first parameter after the email address must be preceded by a question mark (`?body=`). If you were manually constructing this and used an ampersand (`&body=`), the parser would fail.

Another pitfall involves phone number formatting. A `tel:` URI should not contain hyphens or parentheses. The tool sanitizes the input, stripping non-numeric characters (except the leading `+`) to ensure the dialer receives a pure E.164 formatted number. Failure to sanitize phone numbers can cause the dialer to attempt calling the literal hyphen character, resulting in a failed call.

Testing and verifying scannability

Before printing your QR code on physical materials like business cards or storefront signage, test it across multiple devices. Scan the code with an iPhone to verify it opens Apple Mail or Messages, and scan it with an Android device to verify Google Lens routing.

Check the pre-filled text carefully. Ensure that URL-encoded line breaks (`%0D%0A`) render as actual carriage returns in the text field, rather than literal text. If you are generating a highly complex mailto link with multiple recipients or CC fields, consider testing it with a dedicated QR Code Generator that allows raw text input, or simplify the payload.

Real-world deployment applications

Retail Customer Support: Place an SMS QR code on a receipt, pre-filled with the store location and the word 'Feedback', allowing customers to text their experience instantly.

Real Estate Signage: Use a `tel:` QR code on a 'For Sale' yard sign. House hunters can scan it to instantly dial the listing agent without typing the number.

Event Registration: Generate a `mailto:` QR code for a conference booth. Scanning it opens the visitor's email app, pre-addressed to your sales team with a subject line of 'Demo Request'.

Emergency Contact: Post a `smsto:` QR code in an Airbnb or rental property, pre-filled with the host's number and the message 'Lockout Assistance'. For sharing full contact profiles, transition to a vCard QR Code.

Frequently asked questions

Q: What's the difference between the three modes?

A: Email generates a `mailto:` link with an optional subject/body. SMS uses the `smsto:number:message` scheme supported by most phone cameras. Phone generates a `tel:` link that dials the number when scanned.


Q: Does the SMS QR work on iPhone and Android?

A: Yes. The `smsto:` scheme is recognized by iOS and Android camera apps and most third-party scanners. The body text is pre-filled in the user's SMS app for review before sending.


Q: Are special characters in the email body supported?

A: Yes. The body is URL-encoded with `encodeURIComponent`, so spaces, line breaks, and special characters are preserved when the email client opens.


Q: Is there a character limit for SMS?

A: Technically no, but a single SMS segment is 160 characters. The tool shows a live counter so you can stay under that limit if you want one-segment delivery.


Q: Will the QR code upload my address book?

A: No. The QR encodes only the address and message you typed. Nothing is sent over the network — the rendering happens entirely in your browser.


Q: Why did my QR code get larger when I added a message?

A: Adding a pre-filled message increases the byte count of the URI string. QR codes scale their matrix density (Version) based on the amount of data. To keep the code compact and easily scannable, keep your pre-filled text as concise as possible. If you need to embed a logo in the center, use a QR Code with Logo tool to ensure error correction levels are adjusted accordingly.

Next steps for actionable QR codes

Generating actionable QR codes requires a precise understanding of URI schemes and percent-encoding math. By leveraging `mailto:`, `smsto:`, and `tel:` protocols, you transform a static barcode into an instant communication trigger.

Ready to build your contact code? Head over to the Email / SMS / Phone QR tool page. To share network credentials, try our WiFi QR Code, or check our About page to learn more about EasyDesign's suite of client-side utilities.

Need help using this tool?

Read our complete Email / SMS / Phone QR tutorial for step-by-step guidance.

Ready to try the tool?

No accounts. No uploads. No limits. Start now.