# Escape Telegram's MarkdownV2 | Goodbye to can't parse entities

> Escape online and for free the 18 reserved characters of MarkdownV2 for Telegram's Bot API. Two modes, links and protected code, warning for unclosed entities, and code ready for cURL, aiogram, or grammY.

- **Source (source):** https://aitoolsforapps.com/aitelegram-stickers-emojis-and-branding-for-telegram-215/f/escape-markdownv2-telegram-bot-api
- **Platform (platform):** AiToolsForApps
- **Language (language):** en

## In summary

- Escape MarkdownV2 in Telegram without breaking the message
- Paste your text and receive the escaped version ready for parse_mode: MarkdownV2, with the 18 reserved characters resolved and the added backslashes highlighted. Free, in your browser and without an account.
- The 18 reserved characters, exactly as stated in the specification
- Two modes of truth, not one
- Escaped by context, not by brute force

## Escape MarkdownV2 in Telegram without breaking the message

The MarkdownV2 escaper from Telegram takes the text you are going to send with the Bot API and returns the same text prepared for `parse_mode: "MarkdownV2"`. It escapes the eighteen characters that Telegram declares reserved —_ * [ ] ( ) ~ ` > # + - = | { } . !— and shows you the result with each backslash it has added in a different color, so you can see exactly what it has touched and why.

It has two modes, because escaping does not always mean the same thing. In Literal mode, all your text is text: no asterisk or underscore is interpreted as formatting, so what you write is what is read. In Formatted mode, the marks you have intentionally put —bold, italic, underline, strikethrough, spoiler, and block quotes at the beginning of a line— are respected, and everything else is escaped. An opened mark that is not closed does not sneak in: it becomes a literal character and alerts you.

What differentiates this escaper from a replace with a regular expression is that it understands the context. Inside `inline code` and the ``` blocks, only the backtick and the backslash are escaped, as the specification requires. In a link `[text](url)`, the visible text is escaped and the destination is not, except for the closing parenthesis and the backslash: this way your URLs arrive intact instead of being filled with backslashes and stop working. It also recognizes custom emojis `![x](tg://emoji?id=…)` and lets them pass intact.

And before the message goes out, it checks. It detects open and unclosed entities and tells you which one it is —bold, italic, code, block, bracket— with a button to close or escape it in one click. It alerts if a link does not start with https:// or tg://, if the destination has non-ASCII characters that you should encode, if the text already came with backslashes and you were going to escape it twice, and if you exceed 4096 characters that Telegram cuts off. Below you have the preview in a real Telegram bubble, built by reading the escaped text, and the code snippet already set up for cURL, raw Bot API, python-telegram-bot, aiogram, telegraf, or grammY.

## What's included

- **The 18 reserved characters, exactly as stated in the specification** — _ * [ ] ( ) ~ ` > # + - = | { } . ! — not forgetting the dot and the exclamation mark, which are the ones that break the most messages.
- **Two modes of truth, not one** — Literal for your text to be text, and Formatted to preserve bold, italic, underline, strikethrough, spoiler, and quote, escaping everything else.
- **Escaped by context, not by brute force** — inline code and blocks ``` receive only the escape required by the specification, and in links, the visible text is escaped but not the URL, so your links keep working.
- **See what has changed** — each added backslash is highlighted over the original text, and segments treated as links or code are marked separately. No more blindly trusting a black box.
- **Warns before the Bot API returns 400** — unclosed entities with their name, orphaned brackets, loose backticks, links without https://, URLs with non-ASCII characters, already escaped text, and messages longer than 4096 characters.
- **One-click fixes** — each warning comes with its button —close the entity, escape the character, or remove the backslashes already in the text— and escaping is recalculated instantly on the result.
- **Real Telegram bubble preview** — the escaped text is reinterpreted and displayed as your user will see it, in light and dark theme, before sending anything.
- **And the code already set up** — copy the ready cURL snippet, raw Bot API, python-telegram-bot, aiogram, telegraf, or grammY, with token placeholders instead of real credentials. We never ask for your bot's token.

## Frequently Asked Questions

### Why do I get the error can't parse entities when sending a message with MarkdownV2?

Because the text contains one of the 18 characters that MarkdownV2 considers reserved without its backslash in front: _ * [ ] ( ) ~ ` > # + - = | { } . ! Telegram tries to interpret them as formatting marks, does not find the closure it expects, and rejects the message with a 400 error "can't parse entities". The most common culprits are the period at the end of a sentence, the dash of a list, and parentheses, precisely because no one associates them with formatting. The MarkdownV2 escaper from Telegram scans your text and adds the backslash where needed, highlighting each one so you can see what has been modified, and also alerts you if what breaks the message is an open and unclosed entity instead of a loose character.

### Which characters need to be escaped in Telegram's MarkdownV2?

There are eighteen: the underscore (_), the asterisk (*), the brackets ([ and ]), the parentheses (( and )), the tilde (~), the backtick (`), the greater than sign (>), the hash (#), the plus sign (+), the dash (-), the equal sign (=), the vertical bar (|), the braces ({ and }), the period (.) and the exclamation mark (!). Within a code block or an inline code segment, the rule changes: there only the backtick and backslash are escaped. And in a link [text](url), the visible text needs to be escaped, but in the destination, only the closing parenthesis and the backslash: if you escape the entire URL, it stops working. Telegram applies each of these three rules in their respective segments.

### Can I escape the text without losing the bold and italic formatting I intentionally added?

Yes, that's what the Formatting mode is for. In that mode, the escaper distinguishes between the marks you intentionally added —*bold*, _italic_, __underline__, ~strikethrough~, ||spoiler||, and the quote > at the beginning of the line— and the rest of the text, which it escapes. An opening mark that doesn't have its closing counterpart later doesn't remain half-open: it becomes a literal character and you receive a notification with the name of the affected entity and a button to close it. If you want the opposite, where absolutely nothing is interpreted as formatting, use the Literal mode: there all 18 reserved characters are escaped and what you write is exactly what is read.

### Do I need to register or provide my bot's token to use the escaper?

No to both. The escaping, detection of unclosed entities, previewing, and code snippet are calculated entirely in your browser: you can use it without creating an account, with no limit on usage, and at no cost. And the app never asks for your bot's token or sends anything to the Bot API on your behalf: the code snippets you copy contain placeholders like <YOUR_TOKEN> and <CHAT_ID> that you fill in your own environment. The only thing that requires a free account is saving a message with its text and buttons for reuse another day.

### Does the escaper break the links or the code in my message?

No, because it is not a blind character replacement: it tokenizes the text by contexts before escaping. It recognizes links [text](https://…), inline code between backticks, code blocks ``` with their language tag, and custom emojis ![x](tg://emoji?id=…), and applies the corresponding rule to each segment. In practice, this means your URL comes through intact, your code snippet doesn't get filled with backslashes, and the language tag of the block is preserved. Additionally, if a link does not start with https:// or tg://, or if the destination contains non-ASCII characters that should be encoded, it informs you instead of letting you discover it in production.

- [Telegram — Stickers, emojis, and branding for Telegram channels with AI](https://aitoolsforapps.com/aitelegram-stickers-emojis-and-branding-for-telegram-215)

## About the platform

**Telegram — Stickers, emojis, and branding for Telegram channels with AI** — an app by AiToolsForApps. Available at: https://aitoolsforapps.com/aitelegram-stickers-emojis-and-branding-for-telegram-215/f/escape-markdownv2-telegram-bot-api

### Other languages

- `es`: https://aitoolsforapps.com/es/aitelegram-stickers-emojis-y-branding-para-telegram-215/f/escapar-markdownv2-telegram-bot-api
- `fr`: https://aitoolsforapps.com/fr/aitelegram-stickers-emojis-et-branding-pour-telegram-215/f/escape-markdownv2-telegram-bot-api
- `it`: https://aitoolsforapps.com/it/aitelegram-stickers-emojis-e-branding-per-telegram-215/f/escape-markdownv2-telegram-bot-api
- `pt`: https://aitoolsforapps.com/pt/aitelegram-stickers-emojis-e-branding-para-telegram-215/f/escape-markdownv2-telegram-bot-api
- `de`: https://aitoolsforapps.com/de/aitelegram-stickers-emojis-und-branding-fuer-telegram-215/f/escape-markdownv2-telegram-bot-api
- `bg`: https://aitoolsforapps.com/bg/telegram-sazdavayte-stikeri-i-emodzhita-koito-stickers-priema-215/f/ekranirane-na-markdownv2-telegram-bot-api
- `ja`: https://aitoolsforapps.com/ja/telegram-sticker-emoji-sakusei-215/f/telegram-markdownv2-escape-bot-api
- `nl`: https://aitoolsforapps.com/nl/telegram-maak-telegram-stickers-en-emoji-s-die-stickers-accepteert-215/f/markdownv2-escapen-telegram-bot-api
- `ko`: https://aitoolsforapps.com/ko/telegram-sticker-emoji-channel-branding-215/f/telegram-markdownv2-escape-bot-api
- `sv`: https://aitoolsforapps.com/sv/telegram-skapa-telegram-stickers-och-emojis-som-stickers-godkanner-215/f/skydda-markdownv2-telegram-bot-api
- `da`: https://aitoolsforapps.com/da/telegram-lav-telegram-stickers-og-emojis-som-stickers-accepterer-215/f/escape-markdownv2-telegram-bot-api
- `id`: https://aitoolsforapps.com/id/telegram-buat-stiker-dan-emoji-telegram-yang-diterima-stickers-215/f/escape-markdownv2-telegram-bot-api
- `cs`: https://aitoolsforapps.com/cs/telegram-stickery-a-emoji-pro-telegram-ktere-stickers-prijme-215/f/osetreni-markdownv2-telegram-bot-api
- `fi`: https://aitoolsforapps.com/fi/telegram-tee-telegram-tarroja-ja-emojeja-jotka-stickers-hyvaksyy-215/f/escapeta-markdownv2-telegram-bot-api
- `zh`: https://aitoolsforapps.com/zh/telegram-stickers-emojis-branding-215/f/tiaotuo-markdownv2-telegram-bot-api
- `pl`: https://aitoolsforapps.com/pl/telegram-tworz-stickery-i-emoji-ktore-przyjmie-stickers-215/f/escapowanie-markdownv2-telegram-bot-api
- `no`: https://aitoolsforapps.com/no/telegram-lag-telegram-stickers-og-emojier-stickers-godtar-215/f/escape-markdownv2-telegram-bot-api
- `ar`: https://aitoolsforapps.com/ar/telegram-anshi-mlsqat-wiimuji-telegram-yqblha-stickers-215/f/escape-markdownv2-telegram-bot-api
- `he`: https://aitoolsforapps.com/he/telegram-yotsrim-stikrim-vaimog-ym-sh-stickers-mkbl-215/f/escape-markdownv2-telegram-bot-api
