Telegram chat_id format explained (with examples)
The chat_id in the Telegram Bot API has a consistent format. Understanding it helps when building integrations.
Private chat
- Format: Positive integer
- Value: Equals the user’s Telegram user ID
- Example:
123456789
In a private chat, chat_id is the same as the user’s ID. Get yours: open @print_id_bot, tap Start, and copy the User ID.
Group and supergroup
- Format: Negative integer
- Example:
-1001234567890
Group and supergroup IDs are typically negative. Add @print_id_bot to the group and send /id to get the chat_id. See why chat_id can be negative.
Channel
- Format: Negative integer
- Example:
-1009876543210
Channel IDs are also negative. Forward a channel post to @print_id_bot to get the channel ID. See get Telegram channel ID.
Summary table
| Chat type | Sign | Example |
|---|---|---|
| Private | Positive | 123456789 |
| Group | Negative | -1001234567890 |
| Supergroup | Negative | -1001234567890 |
| Channel | Negative | -1009876543210 |
Use in API calls
Pass the chat_id as-is. Do not modify the sign. For example:
sendMessage?chat_id=-1001234567890&text=Hello
Migration note
When a group becomes a supergroup, the chat_id can change. Always use the current value from @print_id_bot or your updates. See group vs supergroup chat_id.
Related pages
- Why Telegram chat_id can be negative
- Telegram Bot API: how to get chat_id
- How to get Telegram chat_id for a group
FAQ
Can chat_id be zero?
No. Valid chat_ids are non-zero integers. Private chats are positive; groups and channels are negative.
Why is my group ID so long?
Supergroup and channel IDs often have many digits. This is normal. Use the full value.
Is the format same for all Bot API methods?
Yes. sendMessage, sendPhoto, and other methods use the same chat_id format.
Can I have the same chat_id for different chats?
No. Each chat has a unique chat_id.
Where do I see the format in an update?
Use @print_id_bot’s /dump in private chat. The output shows message.chat.id or channel_post.chat.id. The raw JSON has the exact value.
Get chat_id examples with @print_id_bot.
Related pages
- Add a bot to a group to get chat_id (10 seconds)
- Aiogram: get chat_id and user ID (examples)
- Bot not responding in a Telegram group: checklist
- C# Telegram bot: get chat_id
- Forwarded messages in Telegram: why IDs can be hidden
- Forwarded sender ID hidden in Telegram: reasons and limits
- Get Telegram channel ID for Bot API (what's possible and what isn't)
- Get Telegram user ID (safe methods)