WhatsApp Text Formatter — bold, italic and lists that render
Write your message here and see exactly how WhatsApp will render it - bold, italic, strikethrough, monospace and the line breaks your lists depend on - then copy the marked-up text straight into your API call. WhatsApp uses its own lightweight markup rather than Markdown or HTML, and the differences catch people out constantly: the characters that make text bold are not the ones most editors insert, a stray asterisk in a product name turns half a sentence bold, and a monospace block needs a specific fence that is easy to get wrong. Getting this right matters more for automated messages than for typed ones, because a template string assembled in code has no preview. A price list where the item names came out italic because one of them contained an underscore is the kind of bug that ships to a thousand people at once. Paste your composed message here first, check it renders the way you intended, and only then wire it into the send call. The tool also shows the escaped form, so you can see which characters need protecting.
Preview
What you copy is the marked-up text — the string that goes into a message body — not the preview.
| You type | They see | Rule |
|---|---|---|
| *bold* | bold | one asterisk each side |
| _italic_ | italic | one underscore each side |
| ~strike~ | strikethrough | one tilde each side |
| ```mono``` | monospace | three backticks each side; markers inside are shown literally |
How it works
The whole vocabulary fits in a sentence. A single asterisk on each side makes text bold, a single underscore on each side makes it italic, a tilde on each side strikes it through, and three backticks on each side render it in a monospace font. The markers have to be paired on the same line, they have to sit directly against the text with no space inside them, and a marker that finds no partner is shown as a literal character. That last rule is what makes the preview worth having: it is the difference between a bold word and an asterisk that appears in the middle of a sentence because the closing one landed on the next line. Nesting works in the obvious way, so bold inside italic is fine, but a code fence swallows everything inside it and shows the markers as text, which is exactly what you want for an order id or a command.
The preview on this page uses the same rules the API applies to a message body, so what you see is what a recipient sees on a phone, on the desktop app and in WhatsApp Web. It also escapes anything that looks like HTML before it renders, which means you can paste a message containing angle brackets and see them as angle brackets rather than as a broken tag. That is not a WhatsApp behaviour so much as a reminder: WhatsApp does not render HTML either, so a message body that contains a tag arrives with the tag visible, and the fix is to write the markup above rather than the markup you know from the web.
Where this bites in production is interpolation. A template that puts a product name, a customer name or a file path into a message body will one day meet a value that contains an asterisk, an underscore or a tilde, and the whole rest of the message will change weight or slant in a way nobody tested. Treat user-supplied and database-supplied values the way you would treat them before putting them into HTML: escape the markup characters, or wrap the value in a code fence where a literal rendering is acceptable. The copy button on this page hands you the plain text with the markup intact, which is precisely the string that goes into the body field of the send endpoint linked below; the preview is for your eyes, the plain text is for the API.
Do it with the API
This tool is the browser-side version of one API call.
Frequently asked questions
Does WhatsApp support Markdown?
No. It has its own small set of formatting characters that happen to look similar, which is exactly why people get caught out. Headings, links with display text and tables do not exist at all, so a message generated from Markdown will arrive with the raw syntax visible unless you convert it first.
Why did my message come out partly bold?
Almost certainly an unpaired formatting character somewhere in interpolated content - a product name with an asterisk in it, or a file path with underscores. Escape user-supplied values before you interpolate them into a message body, the same way you would escape them before putting them into HTML.
Does formatting work in group messages and channel posts?
Yes, the same markup applies everywhere a message body does, including groups, Channel posts and status captions. It renders in the mobile apps and in WhatsApp Web, so what you see in this preview is what your recipients will see on any of them.
Related
Try it on your own number
Create a channel, link a WhatsApp number by QR or pairing code, and call the API in a couple of minutes. The Sandbox plan is free and needs no card.