Free tool · no signup · runs in your browser

Telegram Text Formatter

Format a bot message the way you would in Telegram, then copy it as MarkdownV2, HTML or ready-to-run code. Paste MarkdownV2 to find the exact character behind "can't parse entities", or escape plain text in one step.

Select text, then a button or shortcut: Ctrl+B, I, U, Ctrl+Shift+X strike, Ctrl+Shift+P spoiler, Ctrl+Shift+M code, Ctrl+K link.

MarkdownV2, HTML or Markdown

The Bot API reads formatting from your message text when you set parse_mode. HTML is the easiest to generate from code: escape <, > and & and wrap text in a short list of tags. MarkdownV2 is nicer to write by hand and supports exactly the same formatting, but it treats eighteen characters as markup, so ordinary prices, dates and URLs must be escaped. Markdown, the legacy mode, only knows bold, italic, code and links, and cannot nest them. This tool writes all three from one message, and tells you what legacy mode would lose.

Why Telegram says can't parse entities

The error is Telegram refusing markup it cannot read, and in MarkdownV2 it is almost always one of three things:

  • An unescaped reserved character. A full stop in "v2.1", a hyphen in a date, brackets around a note, an exclamation mark. Each must be written \., \-, \(, \!.
  • An entity that never closes. One * without its partner, often from user-supplied text such as a name with an asterisk.
  • Italic touching underline. __ is read greedily as underline, so ___text___ means something other than you expect. The output here inserts the empty-entity separator the documentation recommends.

The rule that saves the most time: never interpolate user text into MarkdownV2 unescaped. Escape it, or send that message as HTML. The full error reference, with the byte-offset variants, is on the can't parse entities page.

Formatting that reads well in a chat

Bold the one thing people must not miss - an order number, a deadline - and leave the rest plain. Put codes and commands in inline code so they copy cleanly with a tap. Use a spoiler for anything you want read on purpose, such as an answer or a discount, and an expandable quote for long terms or details most readers can skip. If messages also carry buttons, the inline keyboard builder writes the reply_markup, and the Telegram limits page lists how fast a bot can send them. A hosted Telegram chatbot handles all of this formatting for you.

Frequently asked questions

How do I fix "can't parse entities" in a Telegram bot?

That error means the text you sent with parse_mode MarkdownV2 or HTML is not valid markup. In MarkdownV2 the usual cause is an unescaped reserved character such as a full stop, hyphen, bracket or exclamation mark. Paste the text into Check MarkdownV2 above: it reports the same message and byte offset the API does, and the Escape tab fixes plain text in one step.

Which characters must be escaped in Telegram MarkdownV2?

Outside formatting, every one of _ * [ ] ( ) ~ ` > # + - = | { } . ! needs a backslash in front of it, and a backslash itself is written as two. Inside inline code and code blocks only the backtick and the backslash are escaped. Inside a link's URL in brackets, only the closing bracket and the backslash.

Should I use MarkdownV2 or HTML for parse_mode?

HTML is usually easier from code: you only escape <, > and &, and most languages have a function for that. MarkdownV2 reads better when people write messages by hand but needs eighteen characters escaped, which is where most parsing errors come from. Both support the same formatting, including spoilers, quotes and code blocks. Legacy Markdown is kept only for old bots.

How long can a formatted Telegram message be?

A sendMessage text can be 1 to 4096 characters after entities are parsed, so the markup itself does not count - only the text people see. A caption on a photo or document has a lower limit of 1024. The counter under the preview shows the visible length as you edit, which is the number Telegram checks.

How do I send a spoiler or expandable quote with a bot?

A spoiler is ||text|| in MarkdownV2 or <tg-spoiler>text</tg-spoiler> in HTML, and shows as a blurred block until tapped. An expandable quote starts its first line with **> and ends its last line with ||, or uses <blockquote expandable>. Select text above and use the spoiler or expandable quote buttons to get the exact markup.

Does this formatter send my text anywhere?

No. Formatting, checking, escaping and the preview all run in your browser, and the curl and code snippets only contain what you type. Nothing is sent to Conferbot or to Telegram. Paste your bot token into the snippet yourself when you run it.

Related

Rather not hand-format every reply?

A Conferbot Telegram bot formats its answers for you and replies around the clock. Free plan, no card.