Skip to content
TBTelegramBuddy
Languageen
Main navigation
← All guides

How to Export Your Telegram Chat History

Export Telegram chat history to a readable HTML page or to JSON, keep the media linked right beside it, and save the text of only the messages you choose.

7 min read

To export your Telegram chat history you need something that reads the conversation as you and writes it onto your own disk. TelegramBuddy does that in three shapes: a readable HTML page you can open in any browser, a JSON file for anything that needs structured data, and a plain text file containing only the messages you picked out. It is a free desktop app for macOS and Windows, and runs from source on Linux. It is not a bot and not a website — you sign in to your own Telegram with a QR code or your phone number, and the export is written straight to a folder on your computer.

Which shape you want comes down to one question: is a person going to read this, or is a program?

HTML or JSON: which export is right for you

Both cover the same conversation. They differ in who the file is for.

HTML page JSON file
What you get One page, laid out in reading order One structured record per message
Open it with Any web browser Anything that reads JSON — a script, a spreadsheet importer, another app
Best for Reading, keeping, handing to someone else Searching in bulk, counting things, moving the data somewhere else
Media Linked to the files on your disk Referenced by file name and path
Pleasant to read Yes Not really

A rule of thumb: HTML is the copy you will actually open in three years. JSON is the copy you will be glad of when you want to do something nobody planned for — pull every link a group ever posted, count messages per month, feed a conversation into another tool. They are not either/or, and exporting both is the safer default.

How to export Telegram chat history, step by step

The order matters more than people expect, because the export links to media files rather than carrying them inside itself. Download first, export second, and every link in the finished page resolves.

  1. Sign in. Open the app and sign in to your own Telegram with a QR code or your phone number. On the very first run it asks for an api_id and api_hash, which you get free from Telegram at my.telegram.org under “API development tools”. It takes a couple of minutes, you do it once, and the values stay on your machine. There is a walkthrough in how to get a Telegram api_id and api_hash.
  2. Open the chat you want. Pick it from your chat list, or paste an @username, a numeric id, a t.me/+ invite link or a private t.me/c/<id>/<message> link to open something that is not in the list yet. Private groups and channels work as long as you are a member — see downloading from a private Telegram channel.
  3. Download the media. Use bulk download to fetch every matching file in the chat, scanning the whole history, or select messages by hand in the chat view. You can queue several chats at once and leave it running.
  4. Let it finish. A long history takes a while and Telegram will sometimes ask the app to wait; those pauses are handled for you. Large files continue from where they stopped rather than starting over, which matters on a flaky connection — that is covered in resuming interrupted Telegram downloads.
  5. Export the chat. Choose HTML, JSON, or both. The export is written next to your files.
  6. Check one thing. Open the HTML page and click a photo and a video. If they open, your archive is sound and you can put it somewhere safe.

Step 3 is optional in the strict sense — you can export the conversation on its own. But an export whose media never got downloaded is a transcript with dead links in it, which is rarely what anyone means by an archive.

The export does not stuff images inside a single enormous file. It points at the real files on your disk, which is why they stay usable on their own and why the page opens instantly.

Files are saved one folder per chat, and you can split each chat into Photos, Videos, Files, Music and Voice subfolders. Each file keeps the name Telegram gave it. Files that arrive with no name at all — which is most photos and many videos — are named after the message id they came from, so a photo from message 4182 lands as 4182.jpg. If two genuinely different files share a name, the later one gets the message id in brackets: report (4193).pdf. Nothing silently overwrites anything.

Two practical consequences:

  • Keep the folder and the export together. The export refers to files by their place in that folder. Move the whole chat folder anywhere you like; move the HTML page away from it on its own and the links break. When you back the archive up, back up the folder.
  • Dates line up. Each file’s timestamp is set to the date the message was posted, not the date you downloaded it. Sort a chat folder by date in Finder or Explorer and you get the order the conversation happened in, which makes the folder browsable even without the export open.

Saving the text of only the messages you need

A full export is the wrong tool for “there was an address in this thread somewhere”. For that, the chat view is faster.

The chat view shows the whole conversation oldest to newest — text and media together, with day separators and thumbnails, and older messages loading as you scroll up. Click a message to select it, shift-click to take a range, or use Select all, Files only or Texts only for whole sweeps. With your selection made, save the text to a .txt file and you get exactly those messages, in chat order, and nothing else.

This is what you want for pulling the decisions out of a 900-message planning group, keeping a recipe someone posted, or collecting every link from a reading channel. It takes seconds and produces a file small enough to paste into a note.

Keeping the archive current without starting over

Channels keep posting, so an export is a snapshot rather than a live mirror. Refreshing one is cheap: run the same chat again and files that already finished are skipped, so only what is new gets fetched. Then export again over the top.

That makes a monthly or quarterly refresh a perfectly reasonable habit for a channel you care about, and it is the reason the first run is the slow one.

What an export is, and what it is not

Worth being straight about the edges:

  • It sees exactly what your account sees. Chats you are a member of, nothing more. There is no back door to a channel you were never in.
  • It is a snapshot from the moment you ran it. Nothing is synced afterwards until you run it again.
  • Nothing passes through anyone else’s server. There is no TelegramBuddy account and no upload step — the app talks to Telegram directly and writes to your disk. Your login session is a file on your own machine. This is an independent project and not affiliated with Telegram.
  • Being able to save something is not the same as being entitled to keep or share it. Paid courses, licensed films and other people’s work are still theirs. Archive what is yours to archive.

Where to go next

If you are setting this up for the first time, the api_id step is the only part that involves leaving the app, so start there. If you are weighing up whether the app covers what you need, the features page lists the chat view, gallery view, bulk download and export behaviour in one place, and the FAQ answers the short questions — where files land, what happens on a dropped connection, which of the eight interface languages are available.