Overview / Blog / Session to tdata converter
Sessions  ·  13 Oct 2026  ·  10 min read

Telegram session to tdata and back: what a tdata converter actually rewrites

A telegram session to tdata conversion does not sign anything in. It lifts the authorization key out of a Telethon or Pyrogram session file and re-encrypts it into the folder Telegram Desktop reads at startup. A telegram tdata converter is that rewrite, run in either direction, and what the key cannot carry, the api_id, the device name and the two-step password, rides along in a JSON file nobody standardised.

Two kinds of software hold a Telegram login. The desktop app keeps it in a folder, and libraries keep it in a single file. People cross between them for ordinary reasons. An account a script has been driving needs a person to read its chats, or needs the chat export that only Telegram Desktop offers. An account opened in Desktop has a chore ahead that nobody wants to click through, such as walking out of every group in one pass. In both cases the useful question is what exactly gets moved.

What is inside a tdata folder and a session file?

A single key, wrapped four different ways.

When a client signs in, it and Telegram agree on an authorization key, and from then on that key is the login. On disk a session is the key plus the number of the data centre that issued it. Library documentation uses Telegram and session as a fixed pairing for that reason: the account, and one stored login to it. Everything else in the file is bookkeeping.

That is all telegram tdata is at its core, too. The desktop app writes a folder named tdata into its working directory, and inside it a key file encrypted with a local key. The local key is random. It is wrapped in turn by a key made from the app's local passcode, which is empty unless somebody set one. The same folder is covered from the user's side in how a portable build keeps tdata beside the exe. A library file is plainer. Telethon's session is an SQLite database, and Pyrogram's is another with different columns.

ContainerRead byHolds besides the keyHas no place forLocked by
tdata folderTelegram DesktopUser ID, data centre, local settings, cacheapi_id and device strings; the app supplies its ownLocal passcode, if one was set
Telethon .sessionTools built on TelethonData centre number, server address, port, entity cacheUser ID, api_idNothing
Pyrogram .sessionTools built on PyrogramData centre number, api_id, user ID, a bot flagServer addressNothing
String sessionThe library that produced itThe same values as that library's file, as one line of textCachesNothing
JSON beside a sessionTools that share the conventionapi_id and hash, device, app version, language, phone, two-step passwordThe key itselfNothing

The two library rows come from each project's storage source and the tdata row from Telegram Desktop's, all read in October 2026. The JSON row is a convention, as explained further down.

Bots are the exception. A bot signs in with a token from BotFather and Telegram Desktop cannot open one, so a library session that belongs to a bot has no tdata to become. It is one more way to tell whether a product runs on a bot or on a signed-in account. The files in this article belong to user accounts, the kind that really sends what gets sold as a DM bot, while a true bot stays on the invite-link side of bringing members in.

Telegram session to tdata: the key moves, the login stays

Nothing new is created on Telegram's side.

A converter opens the session file, reads the data centre number and the key, and writes both into a fresh tdata folder with an empty passcode. One value is missing. tdata records the account's numeric user ID next to the key, and a Telethon session has no column for it. opentele, the open-source library most converters are built on, connects once and asks Telegram whose session it is when the ID is absent. A Pyrogram file already has it, and so does a JSON that lists it. Only then can the whole job run offline.

Two different operations go by the name telegram session to tdata, and a telegram tdata converter rarely says which one it runs. opentele calls them UseCurrentSession and CreateNewSession. The first is the copy described above. In the second, the existing session approves a brand-new login through Telegram's QR flow, so the account ends up with a second authorization that has its own key. A new login needs the network and the old session alive, and it adds an entry to the account's list of devices.

One session in two files, and the error that ends both

After a copy, the original session file and the tdata made from it are the same session.

By default Telegram allows one live connection per key. Its error documentation describes AUTH_KEY_DUPLICATED as what a data centre returns when it detects "an authorized session is sending requests in parallel from two separate TCP connections", and adds that by then "the session was already invalidated by the server". The account must sign in again from nothing. So a converted copy is not a backup that can run beside the original. Stop the script before Telegram Desktop opens the folder, and close Desktop before the script starts again.

The network changes with the client as well. A proxy line in a JSON is a note for the tool that reads it, and Desktop ignores it. Once the folder is open there, the account connects through whatever Desktop's own SOCKS5 or MTProto proxy screen says.

Does telegram tdata to session work the same way in reverse?

Mostly, with a lock in the way.

Going from tdata, the converter has to decrypt the key file first, and that needs the local passcode whenever one was set. With no passcode the folder opens for anyone who holds it. With one, a telegram tdata to-session run stops at a decryption error until the right passcode is typed. People mix this up with the two-step verification password, which lives on Telegram's servers and plays no part in reading a folder.

A folder can also hold more than one login. Desktop keeps every account added to an install in the same tdata, which is covered under how many accounts one app can stay signed in to, so a single folder may come out as several session files.

Then there is the choice of output. A telegram session converter in the narrow sense turns a Telethon file into a Pyrogram one or back, and it is the same small rewrite. Telethon to Pyrogram needs an api_id and the user ID supplied from outside. Pyrogram to Telethon needs the server address filled in for the data centre. A telegram session format converter that lists six formats is doing this with string sessions and JSON pairs added, and it is still moving a single key.

What is a telegram session json file for?

It carries what the key cannot.

Every connection a client opens starts by describing itself. The initConnection method takes an api_id, a device_model, a system_version, an app_version and three language fields. None of them has a column in a Telethon session, so a tool must find them elsewhere each time it connects. The telegram session json is where tools write them down: the app credentials, the device, the app version and the language, next to the phone number, the user ID and the two-step password. No Telegram page defines the file, and field names vary.

The api_id in it matters most. The API terms say "You must obtain your own api_id for your application", covered in why an api_id is tied to one developer number. The page that issues one says accounts logging in through unofficial clients "are automatically put under observation". How Telegram reacts when a session later shows a different api_id or device from the one it signed in with is not written down. Converter authors advise against it, and that is their observation, not policy.

What a telegram session json to tdata run drops

Most of the JSON.

Desktop announces itself with its own built-in identity, and tdata has no slot for another app's credentials or device name. A telegram session json to tdata conversion therefore keeps two things from the file. One is the user ID, which the folder needs. The other is the two-step password, which belongs in a password manager, because Desktop will ask for it before sensitive actions such as handing a channel to a new owner. The phone field is only a label. It signs nothing in, and it has no bearing on who can look the account up by its number. Going back, a JSON has to be written fresh.

Where is the tdata folder on Windows, Linux and macOS?

In the app's working directory, on every system.

The path is built in Telegram Desktop's source as the working directory plus "tdata/", and a -workdir switch on the command line points the app at a different directory. The defaults below are where the folder usually turns up. The rule is documented in code, and no official list of paths exists.

SystemUsual locationWorth knowing
Windows, installed%APPDATA%\Telegram Desktop\tdataPer Windows user
Windows, portabletdata beside Telegram.exeMoves with the folder
Linux~/.local/share/TelegramDesktop/tdataSnap and Flatpak builds keep it inside their own sandbox directory
macOS, Telegram Desktop~/Library/Application Support/Telegram Desktop/tdataThe native Telegram app from the App Store is a different program with no tdata

Searches for telegram tdata linux usually come from someone holding a folder made on Windows. It opens. The desktop client is one codebase on all three systems, and the tdata it writes is the same format, so a folder produced by a converter on a Windows PC can be handed to a Linux build with -workdir. The reverse works too.

Is there a telegram session link that signs an account in?

Not one that can be kept.

The nearest thing is the QR login token. The QR login page in Telegram's documentation describes a token "embedded in a tg://login?token=" address, with an expiry it gives as usually 30 seconds, that an app already signed in has to accept. It starts a new login and carries no existing one. The other candidate is a string session, a line of text that some tools label a telegram session link. That one is the key itself, and Telethon's documentation warns that anyone holding the string can log in as the account.

Either file is the account

Whoever copies a tdata folder or a session file can act as that login with no code and no password until it is terminated. A converter that wants files uploaded to a website is asking for the accounts. The remedy sits in the official apps: under Privacy and Security, the Active sessions list ends any login, and one button ends all the others. A fresh login has a waiting period here. The reset method refuses with FRESH_RESET_AUTHORISATION_FORBIDDEN when "less than 24 hours have passed", so a session produced by the new-login kind of conversion cannot cut off the old one on its first day.

Session → TDATA in the panel: a batch of files in, folders out

The module is the copy operation, run over a list.

Accounts sit in the suite as Session + JSON pairs or as TDATA, in one table. The module takes the pairs you select and writes a tdata folder for each on the PC it runs on. Nothing is uploaded. The walkthrough below shows the converter on screen, in both directions.

Watch the full walkthrough on YouTube: Telegram TDATA Converter: TDATA Telegram to Session & Session to TDATA in Bulk [2026]

The reason to run it is usually a person. Some work is easier with eyes on the official app: reading replies, saving somebody as a contact by hand, or clearing out an address book one careful name at a time. Software work stays on the session side, whether that is posting to groups on a schedule or removing what an account has posted.

Telegram session converter software comes in three shapes. A script built on an open-source library is free, handles one account per run and is yours to maintain. A hosted converter needs the files uploaded, which hands over the accounts. Local software does the same rewrite as the script with a batch, a report and a table around it. Underneath, the bytes that move are identical.

What the converter will not do

It will not bring back a session Telegram has terminated, and it cannot read a tdata folder locked with a passcode nobody has. The single-connection rule still holds for its output, so a converted folder and its source file take turns. It changes nothing about how Telegram treats the account. On file formats Telegram's Terms of Service are silent, and they do forbid using the service to "send spam or scam users", whichever container the login sits in. We supply no accounts, sessions, tdata or proxies. A folder that came from somebody else may still exist on their disk, and a converter cannot change that either.

Questions

Session files, tdata folders and converters: short answers

How do I convert a telegram session to tdata?
With a converter that reads the session file and writes a folder, since Telegram ships no tool for it. A telegram session to tdata conversion takes the authorization key and data centre number from a Telethon or Pyrogram file and stores them, encrypted, in the tdata layout Telegram Desktop reads. The open-source route is a short Python script on the opentele library. A desktop telegram tdata converter does the same for a list of accounts and reports which ones failed. Either way the folder also needs the account's user ID, which a Pyrogram file or a JSON beside the session can supply. Afterwards, point Telegram Desktop at the new folder and it opens the account without a login code. Keep the original file switched off while Desktop is running on that copy.
Is telegram tdata to session a new login or the same one?
It depends on the mode, and tools seldom say. In the plain telegram tdata to session conversion the key is copied out of the folder into a session file, so both files are one login and Telegram sees a single session. Some converters offer a second mode in which the existing session approves a new one through QR login, and the account then shows an extra authorization with its own key. Spelling makes no difference: a telegram tdata to-session tool and a tdata-to-session tool are the same thing. What matters is the copy rule. Two clients connecting at once on one copied key trigger AUTH_KEY_DUPLICATED, and Telegram's documentation says the session has already been invalidated by then. Run one file or the other, never both together.
What is a telegram session json, and can I convert without it?
It is a small text file that travels beside a session and records what the session cannot hold: the api_id and api_hash, device model, app version, language, phone number, user ID and often the two-step password. A telegram session json is a convention among tools. Telegram does not define it, so two tools may name the same field differently. A telegram session json to tdata conversion uses little of it, mainly the user ID, because Telegram Desktop presents its own built-in identity and tdata has nowhere to store another app's. Without the JSON a converter can still work, though it may have to connect once to ask Telegram which account the key belongs to. Copy the two-step password out of the file before archiving it.
Does a telegram tdata converter work with Linux folders?
Yes. Telegram Desktop is one codebase on Windows, Linux and macOS, and the folder it writes is the same format on each, so telegram tdata linux folders convert the way Windows ones do. On Linux the folder usually sits at ~/.local/share/TelegramDesktop/tdata, with Snap and Flatpak builds keeping theirs inside a sandbox directory. A tdata folder produced on a Windows PC opens in a Linux build started with the -workdir switch pointing at its parent directory, and the same holds in the other direction. Two cautions apply everywhere. A folder protected by a local passcode cannot be read without it. And the native Telegram app from the Mac App Store is a separate program that keeps no tdata at all, so there is nothing in it to convert.
Is there a telegram session link I can send to another device?
No lasting one. What people call a telegram session link is usually one of two things. The first is a QR login token, an address starting tg://login?token= that Telegram's documentation says normally expires in about 30 seconds and must be accepted by an app that is already signed in. It creates a new login and cannot be saved for later. The second is a string session, the whole key written as one line of text for a library to read. Sending that string is sending the account, since anybody who has it can sign in with no code. Between your own machines, move the file or folder directly, and never paste a string session into a chat, a form or a support ticket.
Is free telegram session converter software safe to use?
Only when it runs on your machine and you can see what it does. Telegram session converter software, free or paid, has to read the authorization key, and whoever has the key has the account. An open-source script can be read line by line before it runs. A website that asks for an uploaded tdata telegram folder or a session file receives a working login, whatever it returns. The same caution covers any telegram session converter or telegram session format converter shared as an unsigned download in a chat. Afterwards, open Active sessions in an official app and check that the list shows only devices you recognise. Remember what conversion does not change: telegram and session files answer to the same Terms of Service as the app.

Session → TDATA is one of the account modules in Telegram Solutions

Telegram Solutions is a Windows desktop suite for running many Telegram accounts from one panel, at $120/month. The converter writes its folders on your own machine and shares one account table with the other modules. Support runs through Telegram.