Telegram bot buttons: inline keyboard builder
Put buttons together row by row and see them under a message the way Telegram lays them out: buttons under the message (an inline keyboard) or buttons in place of the phone keyboard (a reply keyboard). Every button is checked against the Bot API's rules — a link that is not http, https or tg://, callback data over 64 bytes, text to copy over 256 characters — and the keyboard comes out as the reply_markup JSON for any library and as aiogram 3 code.
Telegram has two kinds of bot buttons. Buttons under a message — an inline keyboard — open a link, send data to the bot or copy a text, and the message stays as it is. Buttons in place of the phone keyboard — a reply keyboard — send their text into the chat for the person, like quick answers. This tool builds either kind row by row, shows how it will look, checks it against the Bot API and gives you what to paste into your bot.
Two kinds of keyboard
| Under the message (inline) | Instead of the keyboard (reply) | |
|---|---|---|
| Where it appears | Right under one message | In place of the phone keyboard |
| What a tap does | Opens a link, sends data to the bot, copies text, opens a Mini App | Sends the button’s text, or shares the phone number or location |
| Channels | Yes | Not supported |
| In the Bot API | InlineKeyboardMarkup | ReplyKeyboardMarkup |
Both go into the reply_markup field of sendMessage and the other methods that send a message. Each is a list of rows, and each row is a list of buttons, left to right.
What a button can do
A button under a message has its text and exactly one action. The tool offers the four that need nothing else from the bot’s setup:
- url — opens an
http://,https://ortg://link; - callback_data — sends 1–64 bytes of data back to the bot, which answers in its own code;
- copy_text — copies up to 256 characters to the clipboard, handy for a promo code;
- web_app — opens a Mini App by its
https://address; it works only in a private chat with the bot.
The Bot API has a few more — logging in to a website, switching to inline mode, paying for an invoice, starting a game, a disabled button — that depend on how the bot is set up.
A reply keyboard button sends its own text by default. It can instead share the person’s phone number or location, or open a Mini App — those three work in private chats only. A reply keyboard also has options: fit its height to the buttons, hide it after one tap, keep it shown when the phone keyboard is hidden, and a hint of up to 64 characters in the message field.
Telegram’s rules for buttons
These come from the Bot API (version 10.5, November 2026):
| Part | Rule |
|---|---|
| Button | text and exactly one action (inline); at most one action (reply) |
| url | an http://, https:// or tg:// link |
| callback_data | 1–64 bytes |
| copy_text | 1–256 characters |
| web_app | an https:// address; private chats only |
| style | primary (blue), success (green) or danger (red), or none |
| Hint in the message field | 1–64 characters (reply keyboard) |
| Reply keyboard | not supported in channels |
A button that breaks one of these is marked with what is wrong, and the code appears once every button passes. The Bot API documents no limit on the number of buttons or rows, or on the length of a button’s text, so the tool sets none. Callback data is counted in bytes, as the Bot API says: any letter beyond plain a–z — é, ж, ع — takes two or more.
Colours
Since Telegram added style, a button can be blue, green or red. Leave it out and each Telegram app decides how the button looks. The preview above shows the colours roughly; the exact shade is up to the app. Colour means something on a keyboard — red reads as a warning, green as confirmation — so one coloured button among plain ones works better than a rainbow.
A button can also carry a custom emoji next to its text (icon_custom_emoji_id), but only some bots may use it: ones with additional usernames bought on Fragment, or — in private chats, groups and supergroups — bots whose owner has Telegram Premium. The tool leaves it out.
Buttons under your channel posts
A channel post gets buttons only through a bot — Telegram’s own composer cannot attach them — and only buttons under the message. In AdminHub’s post editor you add link and Mini App buttons under a post, arrange them in rows, make them blue, green or red, and publish the post to your channel now or on schedule, without code. The details are in how to add buttons to a Telegram post. Buttons that send data to the bot or copy text are not in the editor; for those, the bot has to be your own.
For developers
The JSON tab is the reply_markup object. Put it in the body of sendMessage, or pass it to any library — it is the same structure everywhere. The aiogram tab builds the same keyboard with aiogram 3; the last line shows how to send it. We checked that the code builds exactly the JSON shown, with aiogram 3.34.
A callback_data button does nothing until your bot answers it: the bot gets a callback query with that data and should reply with answerCallbackQuery — until it does, Telegram shows a progress bar on the button. To try a keyboard on a real chat you need a bot token and the chat’s ID — the bot token and chat ID tool checks the first and finds the second, and sending a message with the Bot API walks through the request.
What this tool does not do
It does not send anything, store the keyboard or answer button taps — everything happens in your browser. It leaves out the button types that depend on a bot’s setup (login, inline mode, payments, games) and custom emoji icons.
Sources, checked November 2026: Telegram Bot API — InlineKeyboardMarkup, InlineKeyboardButton, CopyTextButton, ReplyKeyboardMarkup, KeyboardButton, answerCallbackQuery; Bot features: keyboards.
What people usually ask
- How do I add buttons to a Telegram bot message?
- Send the message with a reply_markup. For buttons under the message it is an inline keyboard: inline_keyboard, a list of rows, each row a list of buttons. Every button has its text and exactly one action — a url to open, callback_data to send to the bot, text to copy, a Mini App to open and a few more. Build the keyboard above and copy the JSON or the aiogram code.
- What is the difference between an inline keyboard and a reply keyboard?
- An inline keyboard sits right under one message, and its buttons open links, send data to the bot or copy text without sending anything to the chat. A reply keyboard replaces the phone keyboard: tapping a button sends its text as a message, or shares the phone number or location. A reply keyboard is not supported in channels.
- Can Telegram buttons have colours?
- Yes. A button's style can be primary (blue), success (green) or danger (red); without a style the app chooses the look. The Bot API also has a custom emoji icon for a button, but only some bots can use it: those that bought additional usernames on Fragment, or — in private chats, groups and supergroups — bots whose owner has Telegram Premium.
- How long can callback_data be?
- 1 to 64 bytes. Plain Latin letters (a–z) and digits take one byte each; accented letters such as é or ñ, Cyrillic and Arabic letters take two, Hindi (Devanagari) letters three, and emoji four, so 64 bytes can be as few as 16 emoji. Keep it to a short code, such as like or item_42, and look up the rest in your bot.
- How many buttons can a Telegram keyboard have?
- The Bot API documents no limit on the number of buttons or rows, and none on the length of a button's text. A keyboard has to be read and tapped on a phone, though: two or three buttons in a row and a few rows are what fit comfortably.
- Can I add buttons to a channel post?
- Yes, but only through a bot, and only buttons under the message: a reply keyboard is not supported in channels. The bot has to be an admin of the channel that can post. AdminHub's post editor does this for your channel's posts: link and Mini App buttons, in rows and colours, with no code.
- Is what I type sent anywhere?
- No. The keyboard is built and checked in your browser, and nothing is stored or sent. The tool needs no account and no bot token.