Keep Telegram Data Local: Export Chats Without a Bot, Token, or Upload

September 7, 2026·
Keep Telegram Data Local: Export Chats Without a Bot, Token, or Upload

The official Telegram Desktop export covers most needs on its own. Go to Settings > Advanced > Export Telegram data for a full account backup, or use a single chat's ... menu > Export chat history for one conversation. Power users who need automation or bulk media pulls can run local scripts that log in as their own account, or use a privacy-first browser extension. No bot, no token, no third-party server required.


TL;DR:

  • Telegram's built-in export tool allows backup of entire accounts or individual chats without needing a bot or third-party service, requiring only the app itself.
  • Export formats include HTML for easy reading and JSON for structured data, with media size limits affecting how much content is saved in each run.
  • Full account exports can reach tens of gigabytes and exclude secret chats, which are device-only and inaccessible to export tools.
  • For automation and filtering, local scripts that authenticate as the user offer features like incremental syncing and bulk media download, but require technical setup.
  • Privacy considerations emphasize processing data locally and avoiding uploading archives to unknown servers, as exported files contain sensitive personal information.

Table of Contents

How Do You Export Telegram Without a Bot?

Telegram's own export tool has been sitting in Desktop settings since 2018, and most people never open it. That's the gap this article closes: you don't need a bot, an API key, or a third-party service to pull your chats, media, and contact data out of Telegram. You need the export feature Telegram already built, plus (if you're technical) a script that logs in as you rather than as an automated account.

The distinction matters more than it sounds. A bot is a separate Telegram account with its own token, and it can only see what you explicitly hand it. Bot-free methods, by contrast, authenticate with your own credentials or your own signed-in browser session, which is why they can see your entire chat history without you building anything or granting a third party access to your account.

Three routes get you there, and each fits a different kind of user:

  • Telegram Desktop's built-in export handles single chats or your whole account, produces HTML or JSON files, and requires zero setup beyond opening the app.
  • Local CLI scripts authenticate through Telegram's own MTProto protocol, using your api_id and api_hash from my.telegram.org or an existing Desktop session file, and give you filtering, incremental syncing, and JSONL output.
  • Privacy-first browser extensions run inside your existing Telegram Web session, so there's no separate login and nothing leaves your machine.

The rest of this guide walks through all three, starting with the one built directly into the app you already have.

Official Method: Export With Telegram Desktop

Telegram's own blog post introducing the export tool describes it as the built-in, bot-free way to pull chats and media into HTML or JSON. It has lived in the same place since launch: Settings > Advanced > Export Telegram data. That path exports your entire account, or a selection of chats and data categories you check off before running it.

For a single conversation, skip the full export and use the chat itself. Open the conversation, tap the three-dot ... menu, and select Export chat history. This is faster when you only need one group or one direct message, not your whole account.

You'll be asked to choose a format, and the choice matters more than it looks:

  • HTML produces a browsable archive, essentially a mini website you can open in any browser, with messages rendered chronologically and media linked inline. Good for casual reading or handing off to someone non-technical.
  • JSON produces structured data with every message as its own object, complete with timestamps, sender IDs, and message types. Good for anyone who wants to parse, search, or import the archive into another tool.

Before you confirm, Telegram shows a size limit slider for media and lets you set a date range. Leave the slider at its default and you'll likely miss large videos or voice files, a known gap in the export tool that's easy to overlook.

Once the export finishes, Telegram Desktop saves the files to a folder you choose during setup. Single-chat exports typically produce a file named messages.html, while full exports generate a result.json alongside a folder of media, matching the file layout documented in Telegram's own import/export schema.

Step-by-Step: Export One Chat From Telegram Desktop

Exporting a single chat takes about two minutes of clicking and anywhere from a few seconds to several minutes of processing, depending on how much media the conversation holds.

  1. Open Telegram Desktop and go to the chat you want to export.
  2. Click the ... menu in the top right corner of the conversation window.
  3. Select Export chat history from the dropdown.
  4. Choose which data types to include: text messages, photos, videos, voice messages, files, stickers, or GIFs.
  5. Set a date range if you only need part of the history, or leave it open for everything.
  6. Drag the size limit slider up if the chat contains large media. The default setting frequently skips big video files.
  7. Pick your format: HTML for something you can open and read like a webpage, or JSON for structured data you plan to process later.
  8. Choose a save location on your computer, ideally a folder you'll remember, not your Downloads folder buried under a hundred other files.
  9. Click Export and let it run.

For a text-only chat with a moderate message count, expect the export to finish quickly and produce a relatively small file. A media-heavy group chat with extensive photos and videos can take longer and generate a large folder of media files.

Pro Tip: Run a test export with a short date range first if you're unsure how big the full archive will be. It takes thirty seconds and tells you whether you need to clear disk space before running the full version.

Exporting Your Entire Telegram Account at Once

A full account export starts in the same place: Settings > Advanced > Export Telegram data. Instead of one chat, you'll see checkboxes for categories: personal chats, group chats, channels, contacts, profile photos, and more. Uncheck anything you don't need to keep the archive manageable.

Multiple chats and their media get packaged together rather than dumped into one folder. A full export typically generates a result.json file containing arrays for each chat, alongside export_results.html as a readable summary, following the structure Telegram's import/export documentation lays out. One detail worth knowing before you import this into a database or spreadsheet: some message and chat identifiers in that schema need 64-bit or double-precision number types, since standard 32-bit integers can silently truncate them.

If your account has years of history across dozens of groups, the export can balloon into tens of gigabytes. A few practical moves keep that manageable:

  • Split the job by date range instead of exporting everything in one pass, so you end up with several smaller archives instead of one massive one.
  • Point the save location at external storage or a secondary drive rather than your main disk, especially if media-heavy channels are involved.
  • Export channels and large groups separately from personal chats so a failure partway through doesn't force you to restart everything.

One limitation applies across every version of this tool: Secret Chats aren't included. Telegram's own support documentation confirms that cloud chats persist across devices while Secret Chats stay device-local and disappear on logout, which means there's nothing for the export tool to reach into.

Programmatic, Bot-Free Options for Power Users

If you need filtering, automation, or repeated exports on a schedule, the Desktop tool starts to feel limiting. This is where local scripts come in, and the key thing to understand is that they authenticate as you, not as a bot.

Telegram's MTProto protocol supports user-level authentication through two paths. You can register an app at my.telegram.org to get an api_id and api_hash, then use a library like Telethon (Python) or GramJS (Node.js) to log in with your phone number, exactly as if you were opening Telegram Desktop for the first time. Alternatively, some tools can reuse an existing Telegram Desktop session file, which skips re-authentication entirely on future runs and enables unattended incremental syncing.

Once authenticated, these scripts do things the Desktop export can't:

  • Filter by date range or specific message ID ranges, so you only pull what changed since your last export.
  • Export to JSONL or plain text formats, which are easier to feed into other tools than a single large JSON blob.
  • Download media in bulk across multiple chats in one run instead of exporting chat by chat.
  • Sync incrementally, avoiding a full re-download of unchanged history every time you run the tool.

Getting set up requires basic command-line comfort. You'll need Python or Node.js installed, and you'll typically install the required packages through pip before running your first script. Telegram also enforces rate limits, commonly surfacing as a FloodWait error that tells you exactly how many seconds to pause before retrying. Well-built scripts handle this automatically; badly built ones will crash mid-export if you ignore it.

Pro Tip: If a script throws repeated FloodWait errors, don't just retry immediately. Let it sleep for the full duration Telegram specifies. Hammering the API during a wait period tends to extend the penalty, not shorten it.

Keep every one of these scripts running locally. Sending your Telegram archive to a third-party server to "process" it defeats the purpose of avoiding a bot in the first place.

Working With Export Formats and Converting to PDF

The four formats you'll run into all serve different jobs, and picking the wrong one just means extra conversion work later.

  • HTML is the one to open and read. It's a self-contained archive that renders like a webpage, ideal for casual browsing or sharing a chat log with someone who has no interest in the underlying data.
  • JSON is the one to build with. Every message is a structured object, which makes it the right pick for anyone importing data into another application.
  • JSONL (JSON Lines) puts one message per line instead of nesting everything into a single large object, which makes it dramatically easier to stream or process with tools that read line by line.
  • TXT strips almost everything down to plain text, useful for feeding a conversation into a language model or a simple keyword search.

Converting the HTML export to a PDF is a two-minute job with no software installation. Open messages.html in your browser, hit Print, and choose Save as PDF as the destination. That's a fully local operation, and it beats uploading your chat archive to an online HTML-to-PDF converter, which hands your private conversations to a server you have no relationship with.

For JSON and JSONL, the fastest path to a spreadsheet is the command-line tool jq, which can flatten nested message objects into rows a spreadsheet program will accept on import. A short Python script using the built-in json and csv modules does the same job with more control over which fields you keep.

Skip online JSON-to-CSV converters entirely. There's no upside to routing your export through a stranger's server when a local tool does the same conversion in seconds.

Privacy, Security, and Best Practices for Exported Data

Telegram keeps cloud chats synced across every device you're signed into, which is convenient but also means an export sitting on your laptop is a copy of data that already lives elsewhere. Secret Chats are the one exception: they're encrypted device-to-device and never touch Telegram's servers, which is exactly why the export tool can't reach them.

Once you have an export file, treat it like any other sensitive personal archive. Uploading it to an unfamiliar "chat viewer" website or an online converter hands your private conversations, contact names, and media to a server with no accountability to you.

Local-only processing is the safeguard that actually matters here, whether you're using Desktop's built-in tool or a browser extension. Mastros builds its Telegram exporter around that same principle: everything runs inside your browser against your already-signed-in Telegram Web session, with no upload to a Mastros server and no second login required.

A short checklist before you consider any export tool trustworthy:

  • Confirm the tool processes data locally rather than routing it through a remote server.
  • Check what permissions it requests. A Telegram export tool has no legitimate reason to ask for anything beyond reading your open session.
  • Store the finished export somewhere encrypted or access-controlled, not a shared drive.

Pro Tip: If a Chrome extension asks for permissions unrelated to reading Telegram Web, like broad access to every website you visit, that's worth questioning before you install it.

If your export touches contact data alongside messages, it's worth understanding your data protection obligations under GDPR before storing or sharing that archive, particularly if you're exporting a group chat that includes other people's information.

Troubleshooting Common Telegram Export Problems

Most export problems trace back to one of four causes, and all four are fixable without starting over.

  1. Missing photos or videos. This almost always means the size limit slider was left at its default. Rerun the export with the slider pushed higher, and confirm the date range covers the media you're looking for.
  2. Secret Chats not appearing. This isn't a bug. Secret Chats are excluded from every export method because they're device-local by design. Your only workaround is a manual screenshot or a written note taken while the chat is still open on that device.
  3. CLI script stalls or throws errors. Check the script's log output first. A FloodWait error means Telegram is rate-limiting you. Respect the wait time it specifies, and use incremental sync so a restart doesn't force a full re-download.
  4. Export looks incomplete. Before assuming data is missing, verify it. Pull a small sample of message timestamps from the export and compare them against the live chat, then check that the date range and expected media folders match what you configured.

Running that verification step before you delete anything from the original chat is worth the two minutes it takes.

When a Privacy-First Browser Extension Beats a Manual Export

Desktop's export tool is built for one-time backups. It starts to feel clunky the moment you need the same kind of export repeatedly, say, pulling fresh media from an active community channel every week, or exporting structured message data from several groups for research.

Community managers, recruiters sourcing candidates through group chats, and researchers tracking channel activity tend to run into this pattern fastest. They're not exporting once and walking away. They're doing it on a recurring basis, and clicking through Desktop's menu each time, then converting the output into something a spreadsheet can read, adds up to real repeated effort.

A local browser extension removes most of that repetition. It reads what your Telegram Web session already displays and writes it straight to a structured file, without the manual JSON parsing step Desktop exports require. That's the practical case for choosing one over a manual export or a custom script: less setup than a CLI tool, more structure than a raw HTML archive.

— Elias Mahdavi

Export Telegram Data Locally With Mastros

If you're already choosing between Desktop's manual export and writing your own script, Mastros gives you a third option that skips both sets of friction. The Mastros Telegram extension runs inside your browser against your existing Telegram Web session, exporting group members, chat messages, recent contacts, and mutual groups directly to CSV, JSON, or JSONL, no bot token, no second login, nothing uploaded to a server.

It also bulk-downloads photos, videos, documents, and voice notes from any chat or channel you can already open, with each item tagged by type and date so you can narrow a run to exactly the media and time window you need. That's the gap between this and Desktop's export: Mastros gives structured, filterable output without the manual conversion step, and repeated exports take the same two clicks every time.

It fits best if you're pulling data from the same channels or groups regularly, or need output your team can drop straight into a spreadsheet. Try the free plan to see how it handles your first export, then move to a paid tier if your export volume grows past the free quota.

Sources

For anyone who wants to go deeper than this guide, three official references are worth bookmarking:

For deeper technical reading on Desktop export mechanics, Mastros's own guide on how Telegram Desktop chat export works breaks down the HTML and JSON output in more detail.

FAQ

Can You Export an Entire Telegram Chat?

Yes. Open the chat, click the ... menu, and select Export chat history. You can include all message types and media, or narrow it with a date range and the size limit slider.

How Do I Export Files From Telegram?

Files exported alongside a chat get saved into the same folder as your export, separate from the messages.html or result.json file, provided you selected that file type before running the export and set the size limit high enough to include them.

How Do I Download Telegram Files Without Using Telegram Itself?

You can't bypass Telegram entirely since it controls access to your account data, but you can avoid third-party bots by using the official Desktop export or a local, privacy-first browser extension like Mastros that reads your already-logged-in session.

How Do I Make a PDF of a Telegram Chat?

Export the chat as HTML, open the resulting messages.html file in your browser, then use Print > Save as PDF. Doing this locally avoids uploading your conversation to an online converter.

Can I Export Secret Chats?

No. Secret Chats are device-local and encrypted end-to-end, so Telegram's export tool and any script authenticating through the standard API cannot reach them; your only option is a manual screenshot taken on the device where the chat is open.

Recommended