Telegram Chat Downloader
A powerful command-line, GUI and web interface utility to download and analyze Telegram chat history in multiple formats.
Need to send or manage messages? This tool is download-only. To send
messages, create groups/topics, manage members and folders, see
popstas/telegram-assistant.
Need live monitoring instead of a one-off export? To watch chats, channels
and folders and forward matching messages in real time, see
popstas/telegram-resender.
Features
- Download complete chat history from any Telegram chat, group, supergroup, channel or Telegram export archive
- Download chats folder
- Extract sub-conversations from message threads
- Save messages in JSON format with full message metadata
- Generate human and LLM readable TXT exports with user-friendly display names
- Download media attachments (photos, videos, documents, audio, etc.)
- Transcribe voice messages with Telegram Premium speech-to-text (
--stt), cached so nothing is transcribed twice
- Use presets for common option sets via
--preset
- Cross-platform support (Windows, macOS, Linux)
- CLI-first, optional graphical user interface and web interface
Filtering
- Filter messages by date range
- Filter messages by specific users
- Filter saved messages by keywords
- Filter messages by sub-conversations from message threads
- Download only the unread messages of a chat (
--unread)
Usage
Login
Log in once before the first download. In a terminal, a download without a
session offers to log you in right there; everywhere else — the GUI, a cron job,
the console-less Windows build — it never prompts and tells you to run login
instead, so an unattended run fails with a message rather than waiting forever
for an answer nobody can type.
# Log in with a code from Telegram
telegram-download-chat login
# Log in by scanning a QR code with an app you are already logged into
telegram-download-chat login --qr
The login code is delivered by Telegram, and for third-party clients it usually
arrives in the Telegram app, in the chat named "Telegram" rather than by
SMS. If no code arrives at all, use login --qr: the code is confirmed from a
device where you are already logged in, so it does not depend on SMS. Add
--debug to see how Telegram chose to deliver the code.
Since September 2026 Telegram sometimes reports the code as sent to the app
(--debug shows SentCodeTypeApp with next_type=None) and then never
delivers it, on any device (#91).
The app cannot change how Telegram delivers codes, so QR login is the
way in for such accounts.
In the GUI, the same two options live on the Settings tab: fill in the phone and
code, or press "Log in with QR code". For accounts with two-step verification,
fill the Password field before scanning.
Basic Commands
# Download chat by username
telegram-download-chat username
# Download chat by numeric ID (negative for groups/channels)
telegram-download-chat -123456789
# Download chat by invite link
telegram-download-chat https://t.me/+invite_code
# Download chat by phone number (must be in your contacts)
telegram-download-chat +1234567890
# Download multiple chats at once
telegram-download-chat chat1,chat2,chat3
Advanced Usage
# Download with a limit on number of messages
telegram-download-chat username --limit 1000
# Download all chats from folder
telegram-download-chat folder:folder_name
# Download messages on or after a specific date (YYYY-MM-DD)
telegram-download-chat username --min-date 2025-05-01
# Download last N days of messages from a specific date
telegram-download-chat username --max-date 2025-06-05 --last-days 1
# Filter messages by specific user
telegram-download-chat group_username --user 123456
# Filter messages containing given keywords (comma-separated, case-insensitive)
telegram-download-chat username --keywords "hello,bye"
# Download only one thread/reply chain or forum topic (live download needs -o)
telegram-download-chat group_username --subchat 12345 -o thread.json
# Specify custom output file
telegram-download-chat username -o custom_output.json
# Enable debug logging
telegram-download-chat username --debug
# Download messages with media attachments (photos, videos, documents, etc.)
telegram-download-chat username --media
# Include media type indicators in TXT output (e.g. [photo], [file=report.pdf])
telegram-download-chat username --media-placeholders
# Download a channel together with the comments under each post
telegram-download-chat channel_username --comments
# Cap comments fetched per post (here: 50 per post)
telegram-download-chat channel_username --comments --comments-limit 50