← back to blog

How to export your Telegram chat history and get a complete archive

Why “export” isn’t the same as “backup”

Telegram already stores your chat history in the cloud, so people sometimes assume there’s nothing to back up. That’s true right up until you lose access to the account, get locked out during a device change, or just want a copy of a conversation that lives somewhere other than inside the app. Telegram’s cloud storage protects the data from being lost, but it doesn’t give you a file you can search offline, hand to a lawyer, or read five years from now if your account situation changes. That’s what an export is for.

The good news is Telegram ships an actual export tool, not a workaround. It’s not an API scrape, it’s not a browser extension pulling the DOM, and it’s not something you need to trust a third party with. It’s built into Telegram Desktop and it talks to Telegram’s own servers using your logged-in session, the same way the app does when you’re just reading messages.

Where the export tool actually lives

Open Telegram Desktop, go to Settings, then Advanced, and look for “Export Telegram data.” This isn’t available as a one-tap option in the mobile apps, so if you only use Telegram on your phone, you’ll need to install the desktop client at least once to run it, even if you never use it day to day afterward.

Once you’re in the export screen, you’ll see a set of checkboxes for what to include: your account information, contacts, and then chat types broken out separately, personal chats, private groups, private channels, public groups, and public channels. Below that are media categories, photos, videos, voice messages, video messages, stickers, GIFs, files, and music, each with its own toggle. You can also set a date range so you’re not pulling twelve years of history when you only need the last two, and a per-file size cap so a single giant video doesn’t blow up your export folder.

If you have two-factor authentication turned on, which you should, you’ll be asked for your password before the export starts. That’s expected. It’s the same check Telegram uses for other sensitive account actions.

What counts as a complete archive

“Complete” needs a caveat, so here it is upfront: the export pulls everything Telegram’s servers currently hold for the chats and media types you selected. That includes message text, timestamps, reply chains, forwarded message attribution, and any media that hasn’t expired or been deleted.

It does not include messages that were already deleted before you ran the export, on either side of the conversation. Telegram doesn’t keep a shadow copy of deleted messages for you to retrieve later, so if a chat partner deleted something and you didn’t save it, it’s gone from the archive too.

Secret chats are excluded entirely. They’re end to end encrypted and stored only on the specific device where the chat was created, never on Telegram’s servers, so there’s nothing on the cloud side for the export tool to pull. If you need a record of a secret chat, you have to capture it manually, on that same device, before the chat or the device disappears.

Anything with an auto-delete timer only shows up if it’s still alive when the export runs. A photo set to disappear after a day is either in your archive or it isn’t, depending on when you exported relative to when it was sent.

Choosing between JSON and HTML

The export tool gives you a format choice, and it matters more than it looks. JSON gives you the raw structured data, every field Telegram tracks per message, in a form you can parse with a script, load into a database, or search programmatically. It’s the right choice if you want the archive to actually be usable later rather than just sitting on a drive.

HTML gives you a browsable, human-readable version, styled to look roughly like the chat itself, split across multiple files if the conversation is long. It’s the better choice if the goal is simply to read the archive the way you’d read the original conversation, without touching a script or a JSON viewer.

You can run the export twice and generate both if you’re not sure which you’ll need. The underlying data pulled from Telegram’s servers is the same either way, only the output formatting changes.

Doing this on a hosted or proxied account

We run managed Telegram hosting and proxy infrastructure, so this part is where our perspective differs from a generic how-to. If the account you’re exporting normally connects through a specific proxy or a consistent network path, run the export through that same path rather than switching to a raw connection you don’t usually use. A full history export, especially one with years of media, pulls a large amount of data in a short window. Doing that from a network profile the account has never used before is exactly the kind of sudden change in connection pattern that gets weighed alongside other signals when an account’s activity gets reviewed. It’s not a guaranteed trigger, but it’s an unnecessary variable to introduce for something you can just as easily do from the account’s normal setup.

Practically, that means: if the account is provisioned behind a specific proxy for day to day use, keep it behind that proxy while you export. If you’re doing this from a hosted instance rather than your own machine, export locally on that instance and move the resulting files off afterward, rather than tunneling the whole desktop session through an unrelated connection partway through.

Large accounts take real time to export, sometimes well over an hour if there are years of photos and video attached. Keep the connection stable for the duration rather than exporting on a network you expect to drop.

Where the archive lives once it’s done

The export tool writes plain files to a folder on your device. That’s convenient, but it also means the archive is only as protected as that folder is. Telegram’s own encryption doesn’t follow the data once it’s sitting on disk as HTML or JSON. If the chats you’re archiving are sensitive, treat the export folder the same way you’d treat the account itself: encrypt the disk or the folder, don’t drop it into a general-purpose cloud sync folder without thinking about who else has access to that cloud account, and don’t leave it sitting on a shared or hosted machine longer than you need it there.

This matters more, not less, on hosted setups. If you’re exporting from a server rather than a personal laptop, move the archive off that server promptly once the export finishes, rather than leaving a full chat history parked on infrastructure that other processes or other people might touch.

How often to run it

The export tool takes a snapshot. It’s not a sync, and it won’t update itself. If you want the archive to stay current, you have to re-run it, and each run pulls the full selection again rather than just the delta since last time. For most people, running it after anything you’d genuinely regret losing, a big project conversation wrapping up, a group you’re about to leave, an account you’re about to hand off, is more realistic than trying to keep a rolling backup on a schedule.

If you manage more than one account, it’s worth exporting each one separately with its own date range and file size settings rather than trying to standardize a single export profile across accounts that have very different histories.

If you want help thinking through account setup, proxy configuration, or keeping a Telegram presence stable over time, that’s what we do. Take a look at what we offer at telegramvault.org.

Get new guides and videos first — join the Telegram channel.

need infra for this today?