The SMSTO format
An instruction phone cameras understand: text this number, with this message. For +1 555 010 0199 and the keyword JOIN, our generator writes:
SMSTO:+15550100199:JOIN
SMSTO: marks it as a text message. The number follows with its spaces and dashes removed and the + kept, then a colon, then the message.
We use SMSTO rather than the sms: link style because it's the format Apple documents for carrying the message. Apple's iOS 11 QR code talk says the format "allows you to prepopulate the text message content," and the iPhone Camera opens it in Messages. Android cameras and Google Lens read it as well. The person always taps send themselves; a phone never sends a text from a scan alone.
The code is static: it holds the number, not a link to us, so it needs mobile signal but no data connection, and works for as long as the number does.
Keyword sign-ups and short codes
The classic use is "Scan to text JOIN" on a poster or receipt, feeding an alerts list or a waiting list. The generator accepts short codes (numbers of three digits or more, like 72404), and a short-code-plus-keyword code is about as small as a QR code gets:
SMSTO:72404:STOP
That makes a 21-square grid, the smallest QR code there is, so it stays scannable even on a narrow receipt. If texts go into a system that reads keywords, use the exact keyword in capitals and nothing else; "Join please" won't match a rule that looks for JOIN.
Print the instruction next to the code as well, like "Scan, or text JOIN to 72404", so people whose camera won't read it can still take part.
Writing the message for a person
When a person reads the texts, put what they need in the message. "Hi, I'm interested in the bike for sale on Oak Street" tells you which of three listings they mean; "Hi" doesn't. A restaurant can put a code on each table that texts "Table 7 needs a server" to the floor phone, one code per table.
Longer messages make bigger codes. That bike message is 72 characters with the number and makes a 37-square grid, against 25 for JOIN. Both print fine on a sign, but a paragraph would not.
SMS or WhatsApp
Use SMS when it has to work on every phone with only a mobile signal, or when texts feed a keyword system. Use a WhatsApp QR code where your customers already chat on WhatsApp and you want photos and replies in the same thread. If people should talk to you instead, a phone number QR code starts a call.