Guide
Telegram share links, user links and MarkdownV2 escaping
Telegram has three small tasks that people repeat often. They want a button that lets visitors share a page to Telegram, a link to a channel or a bot, and a way to put arbitrary text into a bot message without breaking its formatting. Each task depends on details of encoding that are easy to get wrong. This tool handles all three from one form.
Share links
Choose “A share link for a web page”, type the page address and an optional text, and the tool builds https://t.me/share/url?url=...&text=.... Both values are percent-encoded, so characters such as colons, slashes, percent signs and spaces travel safely. Visitors who open the link pick a chat and see the message ready to send, and it works on phones and computers.
Links to users, channels and bots
Choose “A link to a user, channel or bot” and enter the username without the @. The tool gives you the web link, https://t.me/strideshop for the username strideshop, and the app link tg://resolve?domain=strideshop. The first is for pages, bios and emails; the second suits places that open the app directly. A username must be the public one, not a display name.
MarkdownV2 escaping
The Telegram Bot API supports a formatting mode called MarkdownV2. In it, these characters have meaning and must be escaped with a backslash when they appear as plain text: the underscore, asterisk, square brackets, parentheses, tilde, backtick, greater-than sign, hash, plus, minus, equals sign, vertical bar, curly braces, full stop, exclamation mark and the backslash itself. The escape mode adds the backslashes for you and reports how many it added.
Using the escaped text
Paste the escaped text into the message body in your bot code, and apply formatting on top by wrapping parts in the format marks that you want to keep. Escape the text first and add your own marks after, otherwise they would be escaped too. Test with a bot message to yourself, because a single missed character makes the API refuse the whole message.
Worked examples
The share example is the page https://example.com/trail-shoes with the text “New trail shoes: 20% off this week (ends Sunday)!”. The result is https://t.me/share/url?url=https%3A%2F%2Fexample.com%2Ftrail-shoes&text=New%20trail%20shoes%3A%2020%25%20off%20this%20week%20(ends%20Sunday)!. The escape example turns the same text into New trail shoes: 20% off this week \(ends Sunday\)\!, adding 3 characters. The user example with strideshop gives https://t.me/strideshop.
Limits
The tool builds text and never talks to Telegram, so it cannot check that a username exists or that a bot is allowed to post. It does not support the older Markdown or HTML parse modes, which have different rules. Telegram can change link formats and limits, and message length limits apply to what you send.
Practical advice
For a share button on a website, build the link once with the address of the page, then put the same pattern into your template so that each page shares itself. For bot messages, escape user-supplied text every time, since names and titles from outside can contain any of the reserved characters. Log the API’s error text when a message is refused, because it names the position of the problem.
Choosing between formats
If you only need bold and italic in a simple bot, plain text or the HTML parse mode may be easier than MarkdownV2, whose escaping rules are strict. Use MarkdownV2 when you want its features and are willing to escape text in a small helper function that you reuse everywhere.
Related tools
- WhatsApp Link & QR Generator builds equivalent links for WhatsApp.
- Discord Text Formatter formats text for Discord’s own syntax.
- QR Code Generator turns a Telegram link into a code for print.
- Mailto Link Generator builds links that open an email.
Checked against the current version of the Telegram Link & Escape Tool on .

