Why a WhatsApp chat button is worth adding
Most visitors will not fill out a contact form. They will not wait for an email reply either. But they will tap a green button that opens a chat they already know how to use. A WhatsApp chat button on your website turns a passive page into a direct line to your phone, and the good news is that you do not need a plugin, a paid service, or a developer to make one work. WhatsApp gives you the plumbing for free through its click to chat links.
In this guide you will learn exactly how to build a working WhatsApp button, how the link format underneath it actually functions, where people get the phone number wrong, and how to prefill a message so the conversation starts with useful context. Everything here works on a normal WhatsApp account and on WhatsApp Business, across Android, iPhone, and WhatsApp Web.
The link that powers every WhatsApp button
A WhatsApp chat button is, at its core, just a normal hyperlink pointing at a special address. WhatsApp supports two interchangeable formats. The short one looks like this:
https://wa.me/15551234567
The longer official one does the same job and is easier to read when you add parameters:
https://api.whatsapp.com/send?phone=15551234567&text=Hello
When someone taps either link, WhatsApp opens a fresh chat with the number you specified. On a phone the app opens directly. On a desktop it opens WhatsApp Web or the desktop app if the person is signed in. You are not sending anything automatically. You are only opening the conversation window, and the visitor still presses send themselves.
How to write the phone number correctly
This is the single most common failure point, so it is worth being precise. The number after wa.me/ must be in full international format with the country code, and it must contain only digits. That means no plus sign, no spaces, no dashes, no brackets, and no leading zeros. A UK mobile written locally as 07911 123456 becomes 447911123456. A US number like (555) 123-4567 becomes 15551234567, where 1 is the country code. Strip everything that is not a number, keep the country code, and drop any national trunk zero at the start.
Adding a prefilled message
You can seed the chat with text so the visitor does not start from a blank box. Append a text parameter and URL encode the spaces:
https://wa.me/15551234567?text=Hi%2C%20I%20saw%20your%20website%20and%20have%20a%20question
Spaces become %20 and a comma becomes %2C. When the chat opens, that sentence is already typed in the message field, ready to send. This is genuinely useful because it tells you which page or campaign the person came from before they say a word.
Step by step: building the button
Step 1: Confirm your number is on WhatsApp
Whatever number you point the button at must be an active WhatsApp or WhatsApp Business account on a phone. The click to chat link does not create an account, it only opens a chat with one that already exists. Test this by typing your wa.me link into a browser on your phone before you publish anything.
Step 2: Build the link
Take your international number, drop the plus and spaces, and stitch it onto https://wa.me/. Add a prefilled message if you want one. If you would rather not hand assemble the URL and encode the text yourself, a WhatsApp Button Generator will let you type the number and message in plain form and hand you the finished link.
Step 3: Turn the link into a button
On a website, the simplest button is a styled anchor tag:
<a href="https://wa.me/15551234567" target="_blank" rel="noopener">Chat on WhatsApp</a>
Add some CSS to give it the familiar green fill, rounded corners, and a bit of padding, and you have a real button. If you want a ready made snippet with the styling already done, a Button Code Generator produces copy and paste HTML you can drop straight into your page or your site builder’s custom HTML block.
Step 4: Consider a floating chat widget
A single inline button is good on a contact page. A floating widget that sits in the bottom corner of every page and follows the visitor as they scroll tends to get more taps because it is always in reach. A WhatsApp Chat Widget generates that floating bubble, including the pop up greeting and the agent name, without you writing the positioning code by hand.
Step 5: Test on real devices
Open your published page on an Android phone, an iPhone, and a desktop browser. On each one, tap the button and confirm the correct number appears and the prefilled message is intact. Different platforms handle the redirect slightly differently, so testing all three saves you from a silent failure that only affects some visitors.
Real use cases
A small shop can put a button next to each product so buyers ask about sizing or stock in one tap. A service business can prefill the message with the service name so the enquiry arrives already sorted. A restaurant can point the button at a reservations line. A freelancer can add it to an email signature or a link in bio page. Because the link is just a URL, it also works inside a QR code on a flyer or shop window, where the encoded data is simply your wa.me address. Someone scans it with their camera and the chat opens.
Formatting the prefilled message
WhatsApp lets you style text with plain markers, and these work inside a prefilled message too. Wrap a word in asterisks for *bold*, underscores for _italic_, tildes for ~strikethrough~, and three backticks for ```monospace```. Keep this light. A single bold word to highlight an offer reads well, but a wall of formatting looks like spam and can make the visitor delete the message before sending.
Common mistakes and how to avoid them
The mistakes cluster around a few predictable spots. Leaving the plus sign or spaces in the number is the classic one, and it produces a link that opens WhatsApp with an invalid contact. Keeping the leading zero from a local number is a close second, because WhatsApp then reads the wrong national number. Forgetting to URL encode the prefilled text means everything after the first space can get dropped. Pointing the button at a landline or a number that has no WhatsApp account is another dead end, since there is nothing on the other side to open a chat with.
One more worth naming: do not promise instant replies you cannot deliver. A chat button sets an expectation of a fast, personal answer. If nobody is watching that phone during business hours, the button quietly damages trust rather than building it.
Troubleshooting
If tapping the button shows an error like “the phone number shared via url is invalid,” the number formatting is almost always the cause. Re-check that it is digits only, includes the country code, and has no leading zero. If the chat opens but the prefilled message is missing or cut off, your text is not encoded properly, so replace spaces and punctuation with their percent encoded equivalents or let a generator do it. If the link works on your phone but not on a colleague’s desktop, they are probably not signed in to WhatsApp Web or the desktop app, which is expected behavior rather than a broken link. And if nothing opens at all, confirm the destination number genuinely has a live WhatsApp account by messaging it from another phone first.
Conclusion
A WhatsApp chat button is one of the few website additions that is both simple to build and genuinely useful to visitors. Get the international number format right, decide whether you want a single inline button or a floating widget, and test the result on Android, iPhone, and desktop before you call it done. Once it is live, keep the promise it makes by actually answering the chats it brings in. That combination, an easy tap and a real person replying, is what turns a green button into conversations and, often, into customers.
Frequently Asked Questions
Do I need the WhatsApp Business app to add a chat button to my website?
No. The click to chat link works with a regular WhatsApp account as well as WhatsApp Business. The button simply opens a chat with whatever number you point it at, so any active WhatsApp account will do. WhatsApp Business adds extras like a catalog and greeting messages, but they are not required for the button itself to work.
What is the correct phone number format for a wa.me link?
Use full international format with the country code and digits only. Remove the plus sign, spaces, dashes, brackets, and any leading zero from the local number. For example, a US number (555) 123-4567 becomes 15551234567, and a UK number 07911 123456 becomes 447911123456.
Can I prefill a message in the WhatsApp button?
Yes. Add a text parameter to the link, for example https://wa.me/15551234567?text=Hello. Encode spaces as %20 and other punctuation with their percent encoded values. When the chat opens, that message is already typed in the box, and the visitor just presses send. You can even style it with WhatsApp markers like asterisks for bold.
Why does my WhatsApp button say the phone number is invalid?
This almost always means the number is formatted wrong. Check that it contains only digits, includes the country code, and has no plus sign, spaces, or leading zero. Also confirm the destination number is an active WhatsApp account, because the link cannot open a chat with a number that is not on WhatsApp.
Will a WhatsApp chat button work on both mobile and desktop?
Yes, with one condition on desktop. On a phone the link opens the WhatsApp app directly. On a computer it opens WhatsApp Web or the desktop app, but only if the person is signed in there. If a desktop visitor is not logged in to WhatsApp Web, the chat will not open, which is normal behavior rather than a broken button.