How to use Markdown in Telegram
Telegram supports Markdown-style formatting in two different places with two different rule sets: typing messages in the app, and sending messages through the Bot API. This guide covers both.
Formatting in the Telegram app
Regular chat messages support a small Markdown subset — type the markers and Telegram formats on send:
| Format | Type this | Shortcut (desktop) |
|---|---|---|
| Bold | **bold** | Ctrl/Cmd + B |
| Italic | __italic__ | Ctrl/Cmd + I |
| Monospace | `code` | Ctrl/Cmd + Shift + M |
| Strikethrough | ~~text~~ | Ctrl/Cmd + Shift + X |
| Spoiler | ||spoiler|| | Ctrl/Cmd + Shift + P |
On mobile, select text and use the formatting menu instead. Note the app's markers differ from the Bot API's: double asterisks in the app, single asterisks in MarkdownV2.
Formatting through the Bot API
Bots opt into formatting with the parse_mode parameter. Three modes exist:
| Mode | Status | Escaping burden |
|---|---|---|
Markdown | Legacy, frozen | Low, but no underline/spoiler/quotes |
MarkdownV2 | Current, full features | High — 18 reserved characters, see the escaping reference |
HTML | Current, full features | Low — only < > & |
Example: sendMessage with MarkdownV2
curl -s "https://api.telegram.org/bot<TOKEN>/sendMessage" \
-d chat_id=123456789 \
-d parse_mode=MarkdownV2 \
--data-urlencode 'text=*Deploy finished\!* Version `1\.2\.3` is live\.'Every dot and exclamation mark is escaped — miss one and the API returns 400: can't parse entities.
Example: Node.js
await fetch(`https://api.telegram.org/bot${TOKEN}/sendMessage`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
chat_id: chatId,
parse_mode: "MarkdownV2",
text: escapedText, // must be valid MarkdownV2
}),
});Which mode should you pick?
- Hand-written bot messages: HTML — least escaping, hardest to break.
- Forwarding existing Markdown (LLM output, READMEs, RSS content): MarkdownV2, converted automatically — use telegramify-markdown in code or the free md2tg converter from the browser, n8n, or any HTTP client.
- Legacy Markdown: avoid for new bots — frozen feature set, subtle parsing quirks.