SMS sign-in code templates

Put the code first, name your app, say when it expires and tell people not to share it. Keep it to one SMS, so the code arrives whole and shows in the notification.

Copy a template and replace the {variables}. Each length is counted with the example's made-up values, so check your longest version in the SMS counter.

Sign-in code

{code} is your {app} sign-in code. It expires in {minutes} minutes. Never share it, not even with us.

Example: 482913 is your Acme sign-in code. It expires in 10 minutes. Never share it, not even with us.

93 characters with these values · 1 SMS segment · GSM-7 · 67 left

With browser autofill

Your {app} code is {code}. @{domain} #{code}

Example: Your Acme code is 482913. @example.com #482913

47 characters with these values · 1 SMS segment · GSM-7 · 113 left

The last line is the domain-bound format: browsers that support it (Safari, and Chrome on Android through the WebOTP API) offer the code only on your site. Keep it as the last line, with your real domain.

Password reset

{code} is your {app} password reset code. If you didn't ask for it, ignore this text and your password stays the same.

Example: 482913 is your Acme password reset code. If you didn't ask for it, ignore this text and your password stays the same.

117 characters with these values · 1 SMS segment · GSM-7 · 43 left

New device

{app}: a new device is signing in. If it's you, enter {code}. If it isn't, don't share this code and change your password.

Example: Acme: a new device is signing in. If it's you, enter 482913. If it isn't, don't share this code and change your password.

121 characters with these values · 1 SMS segment · GSM-7 · 39 left

Confirm a phone number

{code} confirms this phone number for your {app} account. It expires in {minutes} minutes.

Example: 482913 confirms this phone number for your Acme account. It expires in 10 minutes.

82 characters with these values · 1 SMS segment · GSM-7 · 78 left

Confirm a change

{code} confirms the change to your {app} {setting}. If this wasn't you, don't enter it and contact us right away.

Example: 482913 confirms the change to your Acme email address. If this wasn't you, don't enter it and contact us right away.

116 characters with these values · 1 SMS segment · GSM-7 · 44 left

Writing and sending codes

  • Make codes expire within minutes, limit the tries, and limit how many a number can request, so a form on your site cannot be used to text strangers.
  • Never put a sign-in link or a request for a password in the same text: that is what phishing texts look like.
  • SMS is a common second step, but a code can be intercepted, for example after a SIM swap. For accounts that matter, also offer an authenticator app or a passkey.
  • With SMSTunnel, send codes through POST /api/v1/sms/send-2fa: they need a code of 4 to 10 digits, and they have their own daily allowance. Sign-in codes aren't end-to-end encrypted, even when you use the optional encryption for your other texts.

Send these only to people who expect them. Texting rules differ by country, and many require consent.

More SMS templates

Send them from your own number

SMSTunnel, by NARBOWEB SRL, lets your own website, app or script send texts through your Android phone. There is a free plan, and no credit card to start.

  • From your own number
  • App on Google Play
  • Optional end-to-end encryption