1const e=`--- 2title: "Get Telegram's result.json: Export to JSON and Analyze with jq, pandas" 3slug: "export-telegram-to-json" 4date: "2026-09-06T05:32:14.123Z" 5excerpt: "Get Telegram's result. json: Export to JSON and Analyze with jq, pandas !" 6meta_description: "Create Telegram's result.json with the Desktop export, then query it with jq or load into pandas. Includes schema notes, troubleshooting, and a..." 7hero_image: "/blog-media/9d0f5909b6217e90.jpg" 8author: "Elias Mahdavi" 9platform: telegram 10type: howto 11keywords: ["telegram json export", "export chat messages json", "export chats to json", "save telegram chat as json", "telegram data extraction", "how to save telegram conversation", "export messages from telegram", "convert telegram messages to json", "export telegram to json"] 12source: babylovegrowth 13--- 14 15 16 17The fastest way to export Telegram to JSON is Telegram Desktop's built-in tool: go to **Settings â Advanced â Export Telegram data**, choose JSON as the format, and click **Export**. The output lands in a folder on your computer as \`result.json\`, alongside a \`chats/\` directory holding any media you included. No account access, no third-party app, no waiting for Telegram to email you a link. 18 19*** 20 21> **TL;DR:** 22> 23> - Exporting full Telegram data as JSON includes personal info, chat lists, and messages, but private messages in public channels are limited to your own contributions. 24> - Media files are stored separately in folders, with JSON referencing relative paths; message IDs can exceed safe integer limits in JavaScript if not handled properly. 25> - Automation using MTProto-based tools like Telethon enables incremental, scalable exports across many chats, but requires coding knowledge and API setup. 26> - Offline analysis tools such as jq and pandas simplify extraction and transformation of exported data into readable formats like CSV or Excel, suitable for detailed examination. 27> - Full account exports can take from minutes to over an hour depending on media volume, and partial exports or single chats are faster and smaller, ideal for targeted backups. 28 29*** 30 31## Table of Contents 32 33- [How to Export Telegram Data From Telegram Desktop (Full Account)](#how-to-export-telegram-data-from-telegram-desktop-full-account) 34- [Exporting a Single Chat or Channel Instead of Your Whole Account](#exporting-a-single-chat-or-channel-instead-of-your-whole-account) 35- [What's Actually Inside result.json?](#whats-actually-inside-resultjson) 36- [How Do You Analyze the Exported JSON File?](#how-do-you-analyze-the-exported-json-file) 37- [What Are the Export Limits and Privacy Risks?](#what-are-the-export-limits-and-privacy-risks) 38- [How Do You Fix Common Telegram Export Errors?](#how-do-you-fix-common-telegram-export-errors) 39- [Can You Use Telegram's Bot API or CLI Tools to Export JSON?](#can-you-use-telegrams-bot-api-or-cli-tools-to-export-json) 40- [Converting Telegram JSON to CSV or Excel for Analysis](#converting-telegram-json-to-csv-or-excel-for-analysis) 41- [Automating Exports Across Multiple Chats or Large Datasets](#automating-exports-across-multiple-chats-or-large-datasets) 42- [Desktop Export vs. Browser-First Tools: A Practitioner's View](#desktop-export-vs-browser-first-tools-a-practitioners-view) 43- [A Faster Way to Pull Just What You Need](#a-faster-way-to-pull-just-what-you-need) 44- [Official Docs and Advanced Tools Worth Bookmarking](#official-docs-and-advanced-tools-worth-bookmarking) 45- [Sources](#sources) 46- [FAQ](#faq) 47 48## How to Export Telegram Data From Telegram Desktop (Full Account) 49 50If you want everything, this is the route. It pulls your personal information, contact list, and chat history into one structured archive, following the layout Telegram documents in its [Chat Export Tool announcement](https://telegram.org/blog/export-and-more). 51 52Here's the process, start to finish: 53 541. **Install or update Telegram Desktop.** The export feature only lives in the [official Desktop client](https://desktop.telegram.org/), not the mobile apps or Telegram Web. If you already have Desktop installed, check for updates first. Older builds sometimes hide or break the export menu entirely. 552. **Sign in** with the account whose data you want to pull.
563. Open **Settings â Advanced**, and scroll down to **Export Telegram data**. 574. **Pick your categories.** You'll see checkboxes for personal chats, group chats, channels, contacts, and account info. Uncheck anything you don't need to keep the archive smaller. 585. **Set the format to JSON.** Telegram defaults to a human-readable HTML export, so this step matters. If you're planning to run any analysis, JSON is the format that will actually cooperate with scripts later. 596. **Choose a date range and media options.** You can limit the export by time period and decide whether to include photos, videos, voice notes, and documents, or skip media to save space. 607. **Pick your export folder.** Choose a local drive, not a network share or a synced cloud folder mid-sync, since Telegram writes many small files rapidly during export and network latency can corrupt or stall the process. 618. **Click Export and wait.** Small accounts (a few thousand messages, no media) finish in under a minute. Full accounts with years of media across dozens of chats can take anywhere from several minutes to over an hour. 62 63Telegram names the output folder something like \`Telegram Desktop/DataExport_01_02_2026\`, and inside it you'll find \`result.json\` at the top level, with a \`chats/\` subfolder underneath. 64 65If the export interrupts or your disk runs low on space, just re-run it. Telegram doesn't merge partial exports, so you'll want to clear out the incomplete folder first. 66 67**Pro Tip:** *Run the export overnight if you're pulling years of media. A multi-gigabyte archive with thousands of photos and voice notes can tie up your disk for a while, and there's no reason to babysit it.* 68 69## Exporting a Single Chat or Channel Instead of Your Whole Account 70 71Sometimes a full export is overkill. If you just need one conversation, whether it's a work group, a channel you admin, or a chat you want backed up before deleting it, Telegram lets you export it directly from the conversation itself. 72 73- Open the chat, tap the **â¯** menu in the top right, and select **Export chat history**. 74- Choose your format. HTML is the default for quick reading, but you can select **JSON** (or both) if you plan to process the data later. 75- Set the same options as the full export: date range, media types, and whether to include service messages like pinned notices or member changes. 76- Telegram saves the result as \`result.json\` inside its own folder, separate from any full-account export you've run. 77 78Single-chat exports finish faster and produce a smaller file, which makes them the better call when you're archiving one community before it goes quiet, or pulling a specific conversation for a report instead of your entire message history. 79 80## What's Actually Inside result.json? 81 82The [official Telegram Data Export Schema](https://core.telegram.org/import-export) lays out exactly how the archive is structured, and it's worth understanding before you start writing scripts against it. 83 84At the top level, \`result.json\` contains: 85 86- **\`personal_information\`**: your account's name, phone number, and username, present only in full-account exports. 87- **\`chats.list[]\`**: an array of chat objects, each with an \`id\`, \`name\`, and \`type\` (\`personal_chat\`, \`private_group\`, \`private_supergroup\`, \`public_channel\`, and so on). 88- **\`messages[]\`**: nested inside each chat, this is the core of the archive, with \`id\`, \`date\` (ISO 8601 format), \`from\`, \`from_id\`, \`text\`, and, where relevant, a \`photo\` or \`file\` field pointing to a relative media path. 89 90Media never gets embedded as base64 or binary data inside the JSON. Instead, every photo, video, or voice note is saved as an actual file inside \`chats/chat_name/photos\` or a similar subfolder, and the JSON just stores the relative path string. 91 92One detail that trips up developers building importers: Telegram's \`id\` fields for messages and users can exceed the safe integer range in JavaScript (anything past 2^53). Parse them as strings or use a 64-bit-safe numeric type in whatever language you're working in, or you'll get silent roun
92ding errors on large accounts. Dates follow the ISO 8601 standard, which makes them straightforward to parse into any timezone-aware date library. 93 94## How Do You Analyze the Exported JSON File? 95 96Once you have \`result.json\`, the real question becomes what to do with it. Two tools cover almost every use case: \`jq\` for quick command-line filtering, and Python's \`pandas\` for anything resembling actual analysis. 97 98For fast, no-setup queries, \`jq\` handles the basics in one line each: 99 1001. **Count total messages** in a chat: pipe \`result.json\` through \`jq '.messages | length'\`. 1012. **Filter by sender**: use \`jq '.messages[] | select(.from == "Name")'\` to pull every message from one person. 1023. **Extract just text and dates**: \`jq '.messages[] | {date, text}'\` strips out everything else for a lightweight readable log. 103 104For anything beyond quick lookups, load the file into \`pandas\`. The general workflow: read \`result.json\` with Python's built-in \`json\` module, then run \`pd.json_normalize()\` on the \`messages\` array to flatten it into a data frame. From there, convert the \`date\` column to a proper datetime type, and you can group by sender, plot message frequency over time, or filter by keyword just like any other tabular dataset. A [walkthrough using this exact approach](https://julieducasse.github.io/2020/01/04/Telegram.html) shows how quickly a raw export turns into a usable chart. 105 106If you're dealing with hundreds of thousands of messages, consider converting to **JSONL** instead of working with Telegram's pretty-printed JSON directly. Each line becomes one self-contained message object, which lets streaming tools and log processors read the file incrementally instead of loading the whole structure into memory. Our guide on converting exports to JSONL walks through the conversion step by step. Tools built on Telegram's MTProto layer, like Telethon-based scripts or the community project [telegramFetcher](https://github.com/vicnaum/telegramFetcher), output JSONL natively and support incremental syncing, so you only pull new messages on each run instead of the full history every time. 107 108**Pro Tip:** *If you're only after message counts or a quick sender breakdown, skip pandas entirely. A one-line jq command does the job in seconds without spinning up a Python environment.* 109 110## What Are the Export Limits and Privacy Risks? 111 112Telegram's export tool is generous, but it has real boundaries you should know before you rely on it for anything important. 113 114- **Public channels and groups only export messages sent by your own account.** If you're archiving a channel you don't own, Desktop export won't hand you the full message history from other members, only your contributions to it, according to the official schema documentation. Private one-on-one chats and groups you're fully part of export in full. 115- **Media paths are relative, not absolute.** If you move the export folder or rename it, the JSON references still work, but only if the folder structure underneath stays intact. 116- **Very large files can hit size ceilings** depending on your Telegram plan and local storage, so multi-gigabyte video archives may need to be split across multiple export runs by date range. 117- **Deleted messages generally don't reappear in a fresh export.** If a message was removed before you ran the export, it won't be in \`result.json\`. Export regularly if message history matters to you. 118 119Because the archive holds phone numbers, private conversations, and possibly sensitive documents, treat it like any other personal data backup: store it on an encrypted drive, avoid syncing it to a shared cloud folder by default, and delete old exports once you've pulled what you need. 120 121## How Do You Fix Common Telegram Export Errors? 122 123Most export failures trace back to one of a handful of causes, and they're usually quick to fix. 124 1251. **Export option missing from Settings entirely?** Update Telegram Desktop to the latest version. Older builds occasionally hide this feature behind a version gate. 1262. **Export stalls or fails partway through?** Check your disk space first, then confirm you picked a local folder rather than a
126network drive or a cloud-sync folder that's actively uploading. Both scenarios cause write conflicts mid-export. 1273. **Some media files missing from the folder?** Re-run the export. Telegram sometimes skips files that were temporarily unavailable on its servers during the first pass. 1284. **History too large to export in one go?** Narrow the date range and run it in chunks, or switch to a single-chat export instead of pulling your whole account at once. 129 130For persistent issues, our [step-by-step troubleshooting guide](https://mastros.online/blog/telegram-export-not-working) covers fixes for the errors that don't resolve with a simple retry. 131 132## Can You Use Telegram's Bot API or CLI Tools to Export JSON? 133 134Telegram's Bot API isn't built for exporting your own chat history. Bots can only see messages sent directly to them or in groups where they're a member, so a bot can't pull your full private message archive the way Desktop's export tool can. If your goal is exporting personal or group chat history, the Desktop export or the MTProto-based tools below are the right path, not the Bot API. 135 136What actually works for programmatic export is Telegram's **MTProto takeout API**. This is the same protocol layer Desktop itself uses under the hood, and it's documented in the official takeout API reference. The flow looks like this: 137 1381. Call **\`account.initTakeoutSession\`** to open a takeout session tied to your account, specifying which data categories you want (messages, media, contacts). 1392. The server processes your request and makes the data available through standard message-fetching calls, now flagged as part of a takeout session. 1403. Media files are pulled separately using **\`upload.getFile\`**, since the takeout session gives you access but doesn't bundle media inline. 1414. Call **\`account.finishTakeoutSession\`** once you've retrieved everything, closing out the session cleanly. 142 143This isn't something you type into a terminal casually. It requires registering an app with Telegram's API, handling authentication tokens, and writing code against the MTProto library in Python (Telethon is the most common choice) or another supported language. Community tools built on this layer, like the tg-export project, transform raw takeout output into cleaner, ingestion-ready JSON. This route makes sense for developers building automated pipelines, not for someone who just wants a backup of their own chats. 144 145## Converting Telegram JSON to CSV or Excel for Analysis 146 147Telegram's JSON export is great for scripts, but plenty of people just want a spreadsheet. Getting there takes a few extra steps, and the right tool depends on how much data you're moving. 148 149For a one-time conversion, Python's \`pandas\` library is the simplest bridge. Load \`result.json\`, flatten the \`messages\` array with \`pd.json_normalize()\`, and export straight to CSV with \`.to_csv()\` or to Excel with \`.to_excel()\`. That single conversion step turns a nested JSON structure into rows and columns any spreadsheet program can open. 150 151If you'd rather skip scripting entirely, \`jq\` can output CSV directly with its \`@csv\` filter, piping selected fields like date, sender, and message text into a flat file in one command. This works well for smaller chats where you only need a handful of columns and don't want to install a Python environment. 152 153For non-technical use, some online JSON-to-CSV converters accept a file upload and return a spreadsheet in seconds, though you should be cautious uploading anything containing phone numbers or private messages to a third-party web tool you don't control. Anything with sensitive personal data is better handled locally. 154 155One thing to watch for regardless of method: Telegram's message text field sometimes contains nested formatting entities (bold, links, mentions) as separate array structures rather than plain strings. A naive conversion can leave you with \`[object Object]\` in a cell instead of readable text, so flatten those entity arrays into plain text before exporting if readability matters more than preserving formatting metadata. 156 157## Automating Exports Across Multiple Chats or Large Datasets 158 159Manually re-running Desktop's export tool for a dozen channels gets old fast, and it's not built for scale. If you're managing exports across many chats regularly, automation is worth setting up. 160 161The most common approach uses **Telethon**, a Python library built on Telegram's MTProto layer, to script exports programmatically. A basic pattern loops through a list of chat IDs, calls the message-fetching functions for each, and writes results to individual JSON or JSONL files, letting you schedule the whole batch to run overnight or on a cron job. This is the same underlying protocol the takeout API uses, just wrapped in a friendlier scripting interface. 162 163Command-line tools like \`telegramFetcher\` build on this pattern natively, supporting incremental sync so each run only pulls new messages since the last export instead of redownloading full history every time. That distinction matters a lot once you're tracking dozens of channels:
163incremental sync turns a process that takes hours into one that takes seconds after the first run. 164 165For teams that need reproducible, byte-stable archives without repeated logins, offline transform pipelines like \`tdl\` feeding into [tg-export](https://bigmovealgo.com/post/tradingview-alerts-to-telegram) produce consistent JSON output from a single authenticated pull, which is useful when you need the same export to look identical every time you regenerate it. 166 167If your batch needs are narrower, say, pulling member lists and recent messages from a handful of groups without writing any code, a browser-based export extension handles that without the setup overhead of a scripting environment. 168 169## Desktop Export vs. Browser-First Tools: A Practitioner's View 170 171Desktop's export tool is the right call when you want a complete, official archive: every message, every contact, every media file, structured exactly the way Telegram's own schema defines it. But for selective work, pulling one channel's members, a date range of messages, or just the media from a single conversation, a browser-first tool that runs locally and never uploads your data gets you there faster, with less cleanup afterward. 172 173> *â Elias Mahdavi* 174 175## A Faster Way to Pull Just What You Need 176 177Desktop's export tool is thorough, but it exports categories, not selections. If you manage a Telegram community and just need the member list, recent contacts, or a bulk download of shared media from one specific chat, Mastros gets you there without touching a JSON schema at all. 178 179The Telegram extension runs entirely inside your browser, reading what your own signed-in session already shows, and saves group members, chat messages, recent contacts, and mutual groups straight to CSV, JSON, or JSONL. It also bulk-downloads photos, videos, documents, and voice notes from any chat you can open, with no uploads, no API keys, and no second login. Users such as growth teams, researchers, and community managers use it for fast, selective pulls instead of full-account dumps. Try the available plans to see export limits firsthand, and check the [Telegram media downloader](https://mastros.online/telegram-video-downloader) page for the full feature breakdown. 180 181## Official Docs and Advanced Tools Worth Bookmarking 182 183For deeper reference: Telegram's export announcement, the import-export schema, the takeout API, and our own guide to [how Desktop export works](https://mastros.online/blog/how-telegram-desktop-chat-export-works). 184 185## Sources 186 187- [Chat Export Tool, Better Notifications and More](https://telegram.org/blog/export-and-more) 188- [Telegram Data Export Schema](https://core.telegram.org/import-export) 189- [vicnaum/telegramFetcher](https://github.com/vicnaum/telegramFetcher) 190 191## FAQ 192 193### How Do I Export Data From Telegram? 194 195Use Telegram Desktop's **Settings â Advanced â Export Telegram data** menu, choose JSON as the format, and select which chats, media, and date ranges to include. 196 197### Can Deleted Telegram Chat History Be Recovered? 198 199Not through the standard export tool. If a message was deleted before you ran the export, it generally won't appear in \`result.json\`, so exporting regularly is the best safeguard. 200 201### How Can I Request My Data From Telegram? 202 203Telegram doesn't require a formal data request process like some platforms. Instead, you export your own data directly through Desktop's built-in export feature, which produces the archive locally on your device. 204 205### Can I Export a Telegram Chat as a PDF? 206 207Telegram's native export offers HTML and JSON, not PDF directly. Export as HTML first, then use your browser's built-in "Print to PDF" function to convert the resulting file. 208 209### What's the Difference Between JSON and JSONL for Telegram Exports? 210 211Telegram's native export produces one pretty-printed JSON file with a nested structure, while JSONL stores each message as its own line, which streaming tools and large pipelines handle more efficiently. 212 213## Recommended 214 215- [Telegram JSONL Export: jq, JSONL CLI Tools, or a No Code Privacy Extension](https://mastros.online/blog/telegram-jsonl-export) 216- [How to Export Telegram Messages: 5 Methods Compared](https://mastros.online/blog/how-to-export-telegram-messages) 217- [Telegram Group Analysis: Metrics, Tools, and a Fast Workflow](https://mastros.online/blog/telegram-group-analysis) 218- [The Complete Telegram CSV Export Guide (2026)](https://mastros.online/blog/telegram-csv-export-guide-2026) 219`;export{e as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.