WhatsApp has become one of the most popular messaging apps, with over 2 billion users worldwide. One of the handy features it offers is the ability to embed HTML code in your messages, allowing you to spice up chats with formatted text, images, videos, and more.
While WhatsApp’s web and desktop versions have some formatting options, embedding custom HTML code unlocks even more creative possibilities. You can create colorful messages, add emoji, build tables and lists, embed media, and more.
If you know some basic HTML, embedding a code in WhatsApp is easy. This guide will walk you through the steps to do it on both mobile and desktop.
Embedding Code in WhatsApp Web/Desktop
WhatsApp Web, accessible through web browsers on your computer, provides an easy way to type and format longer messages. Here’s how to embed HTML code in your WhatsApp messages on the desktop client:
Step 1: Write your HTML code in a text editor
Open a plain text editor like Notepad or TextEdit. Write or copy-paste your desired HTML code here first. This allows you to easily edit and test the code before embedding it in WhatsApp.
For example, you can try a simple embed code like this:
<b>This text is bold!</b>
The tags will make the text bold when embedded. Test and tweak the code in the text editor until it’s ready.
Step 2: Copy the code
Once your HTML code is finalized in the text editor, select and copy it (Ctrl/Cmd + C on most computers).
Step 3: Paste into WhatsApp’s text box
Open the WhatsApp Web chat where you want to embed the code. Paste the copied code into the text box at the bottom (Ctrl/Cmd + V to paste).
The code will be embedded and rendered automatically when you send the message.
Step 4: Send the message
That’s it! Press enter or click the send arrow to send the message with your formatted HTML code.
Your recipients will see the rendered output of the code. For example, the bold text in our example above.
Embedding Code in WhatsApp Mobile
Embedding custom HTML in the WhatsApp mobile app works much the same way, you just need to paste the code into the text field before sending.
Here are the steps:
Step 1: Write and copy the HTML code from a text editor
As with the desktop client, first write and tweak your code in a plain text editor app. When it’s ready, copy it.
Step 2: Paste into WhatsApp’s text box
In the WhatsApp chat where you want to embed the code, tap the text field at the bottom to bring up the keyboard. Hold your finger on the field until the “Paste” option appears, then tap it to paste the copied code.
Step 3: Send the message
Your HTML code is now embedded in the message. Hit send or the arrow icon to send it off!
The recipients will see the output rendered automatically.
HTML Embedding Ideas
Now that you know how to embed HTML in WhatsApp, what kinds of code can you use to spice up your chats? Here are some formatting ideas:
Bold, italics, underline
Make text stand out with bold, italics, or underlines using the , , and tags:
<b>Bold text</b>
<i>Italicized text</i>
<u>Underlined text</u>
Headings and titles
Organize sections and topics with HTML heading tags like
for titles,
for subtitles:
<h1>Main heading</h1>
<h3>Subheading</h3>
Colors
Make text colorful with the tag:
<font color="blue">This text is blue!</font>
Sizes
Change font sizes with tags like for small text:
<font size="2">Small text</font>
<font size="4">Large text</font>
Images
Embed images with the tag:
<img src="https://i.imgur.com/image.jpg">
Videos
Embed YouTube videos with:
<iframe width="420" height="315" src="https://www.youtube.com/embed/VIDEO_ID">
</iframe>
Emoji
Add emoji icons with:
😀 😁 😂
Lists
Create lists with the
- and
- list tags:
<ul>
<li>First item</li>
<li>Second item</li>
</ul>
Tables
Build tables to organize data:
<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Row 1 Data 1</td>
<td>Row 1 Data 2</td>
</tr>
</table>
Those are just a few formatting ideas to try in your WhatsApp messages. Get creative and have fun making visually engaging chats!
Troubleshooting HTML Embedding
Code shows up instead of rendering
If your HTML code shows up in plain text rather than rendering, there may be typos or errors in the code. Double check that all tags are spelled correctly and properly formatted.
Media not embedding properly
For images, videos, and other media, make sure the source URLs point directly to the media file itself, not just a page hosting it. Direct links are required for embedding in WhatsApp.
Formatting looks different on recipients’ devices
HTML and CSS rendering can vary slightly across device platforms. Your formatting may look slightly different on recipients’ phones. Keep styling simple for maximum compatibility.
Code works on desktop but not mobile
There are some limitations in the mobile app. Avoid very long or complex code, and use simplified HTML and CSS selectors. Test your code and tweak it until it embeds properly on mobile.
Messages with code fail to send
Large blocks of code may fail to send on WhatsApp. Try limiting code to smaller embeds of just the essential tags and syntax needed. Complex styling CSS can often be removed without affecting the output too much.
Conclusion
Embedding HTML code unlocks tons of formatting possibilities for your WhatsApp messages. On both desktop and mobile, just copy-paste your code into the text box before sending. With some basic HTML knowledge, you can create stylized messages, embed media, build lists and tables, and more.
Be sure to test your code thoroughly and troubleshoot any embedding issues. Keep styling simple and concise for best results. With creative use of HTML, you can truly customize and enhance your chats on WhatsApp.