SMS link generator for text messages
Make a link that opens a new text message to your number when someone taps it on a phone, with the start of the message filled in if you like. The generator writes the link the way the sms: standard asks, counts how many texts the message takes, and tells you honestly where phones differ. Copy it as HTML, a button or a WordPress Buttons block.
- RFC 5724 sms: links
- Message length counter
- HTML, button and WordPress block
Free, no sign-up. Everything stays in your browser.
Nothing you enter leaves your browser.
This tool runs in your browser and needs JavaScript. Turn JavaScript on and reload the page.
Mailto link generator
Preview and code
The link
HTML link
Button HTML for pages and emails
Inline styles only, so it works in an email signature or newsletter as well as on a page.
WordPress Buttons block
Paste it into the block editor, or into the Code editor (Options, then Code editor). The block keeps the address readable in the page’s HTML; use the shortcode to hide it.
WordPress shortcode with antispambot()
Paste it into your child theme's functions.php or a code snippets plugin, then put the shortcode in any post, page or Shortcode block.
Markdown link
Spam protection, honestly
An email address on a public page will be found by spam bots sooner or later. These options make it harder for the simplest ones, and none of them stops all harvesters.
HTML character references
Each character of the link is written as a code, such as @ for @. Browsers turn the codes back into the address, so the link works as normal. Bots that read the page's raw HTML see only codes, but many harvesters decode them, so this helps a little at best.
WordPress antispambot()
WordPress's own antispambot() function swaps random characters of the address for codes each time the page is made, so the address looks different on every visit. The shortcode above uses it. It beats simple pattern matching, not a bot that reads the page the way a browser does.
WordPress developer reference: antispambot() (opens in a new tab)
A contact form instead
A contact form keeps your address off the page completely, and works for visitors who have no email app set up. With a form plugin, add spam protection such as a CAPTCHA or a honeypot field. Many sites offer both: a form, and a mailto link for people who prefer their own email.
This generator does not write JavaScript that puts the address together in the browser. Such snippets are usually inline scripts, which a strict Content Security Policy blocks, and bots that run JavaScript read the finished address anyway.
How a mailto link is written
The rules are in RFC 6068. The addresses come straight after mailto:, separated by commas. The other fields follow a ?, joined with &. Characters that have a meaning in a link are written as a % and two hex digits.
| You type | In the link | Why |
|---|---|---|
| A space | %20 | Never a +, which some apps would keep as a plus sign. |
| A line break in the message | %0D%0A | The line break email uses, as RFC 6068 requires. |
+ | %2B | So no app reads it as a space, in name+tag@example.com too. |
& ? # = ; | %26 %3F %23 %3D %3B | They separate the parts of a link. |
% | %25 | It starts every code. |
| é, ü, 漢字 and emoji | %C3%A9 and so on | UTF-8 bytes, each written as a code. |
| An international domain | xn-- form | The form every email app understands. |
Email apps decide for themselves what to do with a link. RFC 6068 only expects them to understand the subject and the message, so test Cc and Bcc in the apps your visitors use. Very long links can be cut off, and an app may add a line break at the end of the message. Sources: RFC 6068, The 'mailto' URI Scheme (opens in a new tab).
Preview and code
The link
HTML link
Button HTML for pages and emails
Inline styles only, so it works in an email signature as well as on a page.
WordPress Buttons block
Paste it into the block editor, or into the Code editor (Options, then Code editor).
How a phone link works
A tel: link opens the phone app on a phone, ready to call. On a computer it opens an app that can make calls, if one is set up, or does nothing. The rules are in RFC 3966: the number in full international form, a + then the country code and the number without its leading 0, written with digits only, and ;ext= for an extension.
| Number at home | Link |
|---|---|
| UK: 020 7946 0000 | tel:+442079460000 |
| Australia: (02) 9876 5432 | tel:+61298765432 |
| US: (201) 555-0123, ext. 45 | tel:+12015550123;ext=45 |
| Italy: 06 1234 5678 | tel:+390612345678 (Italian numbers keep the 0) |
An international number has at most 15 digits, country code included (ITU-T E.164). Show the number in the link text too, so people on a computer can read it and dial it themselves. Source: RFC 3966, The tel URI for Telephone Numbers (opens in a new tab).
Preview and code
The link
HTML link
Button HTML for pages and emails
Inline styles only, so it works in an email as well as on a page.
WordPress Buttons block
Paste it into the block editor, or into the Code editor (Options, then Code editor).
Will the message be filled in?
An sms: link opens the messages app with the number filled in. The standard, RFC 5724, writes the message after ?body=, with several numbers separated by commas, and that is what this generator writes. Whether the message appears is up to the phone:
- Apple's reference for
sms:links describes only the number, and says the link must not include message text. It is in Apple's documentation archive, which is no longer updated, and Apple publishes nothing newer about these links. - Google does not document
sms:links from web pages for Android. - So test the link on an iPhone and an Android phone. Apple documents links with just the number, so that is the part to rely on.
You may see links written sms:number&body= or sms:number;body= for older iPhones. No standard defines those forms, so this generator does not write them. On a computer, an sms: link only does something if an app there handles text messages. Sources: RFC 5724, The sms URI scheme (opens in a new tab) and Apple URL Scheme Reference: SMS links (opens in a new tab).
The length counter follows the GSM rules phones use: 160 characters fit one text, or 70 when the message has an emoji or a character outside the GSM alphabet, and longer messages are sent in parts. The phone that sends it has the final say.
What you get
-
Numbers in full international form, or short codes as they are
-
An optional message, encoded for the link
-
A counter for characters and the number of texts
-
An honest note on what iPhone and Android do with the message
-
HTML link and a button with inline styles, in your colours
-
A WordPress Buttons block to paste into the editor
How to make a text message link
-
Enter the number
Choose the country and type the mobile number as you would dial it at home, or in full starting with +. For a text service, tick short codes and type the code.
-
Add a message if you like
Type the text the message should start with. The counter shows how many characters it uses and how many texts it will be sent as.
-
Test it on your phones
Tap Open in my messages app on an iPhone and an Android phone, then copy the HTML, the button or the WordPress block into your site.
What an SMS link does
An sms: link opens the messages app on a phone with a new text to your number, so people can reach you without typing it. RFC 5724, the sms: standard, also lets the link carry the start of the message after ?body=, and several numbers separated by commas.
Phones differ on the message
Apple's reference for these links describes only the number, and Google does not document them for Android web pages, so whether the message is filled in depends on the phone and its messages app. Apple documents the number part, so that is the part to rely on. Test the link on the phones your visitors use, and do not rely on the message being there.
How long a text can be
One text holds 160 characters from the standard GSM alphabet, or 70 when the message has an emoji or a character outside it. Longer messages are sent in parts that the phone joins back together, 153 or 67 characters each. The counter under the message follows these rules.
Frequently asked questions
What is an SMS link?
A link that opens a new text message instead of a page. It starts with sms: and the number, such as sms:+61412345678, and can include the start of the message.
Can I fill in the message?
The standard way is ?body= after the number, and the generator writes it that way. Many phones fill the message in, but Apple and Google do not document it for web links, so some phones may open an empty message. The number is the part Apple documents, so rely on that.
Can one link send a text to several people?
The standard allows several numbers separated by commas, and the generator accepts up to 10. Some messaging apps only use the first number, and a text to several people may be sent as a group message, which can cost more.
How long can the message be?
One text holds 160 standard characters, or 70 if the message has an emoji or a character outside the GSM alphabet. Longer messages are split into several texts. Keep link messages short: the person can add more before sending.
Do SMS links work on computers?
Only where the computer has an app set up to send text messages. On most computers nothing happens, so show the number itself as well.
What is a short code?
A short number, usually 3 to 8 digits, that businesses use for text services such as Text JOIN to 12345. Short codes only work inside their own country, so the link uses the code exactly as typed, with no country code.
Is anything I type sent anywhere?
No. The links and code are made in your browser, and nothing you type is sent to this site or anywhere else. To count how the tool is used, this site is told only that a link was made or copied, never what it contains.
Related tools
-
Email signature generator
New (added recently)Make an HTML email signature that works in Outlook, Gmail and Apple Mail, with a desktop, mobile and dark mode preview.
-
Email DNS
New (added recently)Build and test MX, SPF, DKIM, DMARC, MTA-STS and BIMI records, with the exact values for Google Workspace, Microsoft 365 and over 25 email services.
-
Social share preview
New (added recently)See how a link to your page will look on Facebook, X, LinkedIn, Slack, Discord, WhatsApp and Messages, check each tag and image, and generate the tags.
-
Colour contrast checker
New (added recently)Check the contrast of text and background colours against WCAG 2.2 AA and AAA, with suggested passing colours and a palette checker.