What is the MAGNET file format?
A .magnet file is a plain-text file containing a single magnet: URI - a content identifier used by BitTorrent clients to locate and download files without requiring a separate .torrent descriptor file.
The magnet URI is a query string beginning with magnet:? followed by parameters: xt (exact topic - the infohash URN, the core identifier), dn (display name, optional), tr (tracker URL, optional and repeatable), and xl (exact length, optional). The xt value carries the content's cryptographic fingerprint: urn:btih: followed by a 40-character SHA-1 hex infohash for BitTorrent v1, or urn:btmh: with a 68-character SHA-256 hex hash in BitTorrent v2 (introduced 2020). Hybrid torrents include both xt parameters.
In practice, magnet links are almost always activated as clickable hyperlinks in a browser, which hands the magnet: URI directly to the registered torrent client via the OS URI handler - no file is saved to disk. A .magnet file appears when a web server forces a file download instead of triggering the handler, or when a user manually saves a link. The client then uses DHT (Distributed Hash Table) and peer exchange to retrieve torrent metadata, making a centralized tracker optional.
The scheme was proposed by Gordon Mohr and Bitzi in 2002 and gained broad adoption around 2009 when The Pirate Bay switched to magnet-only links. Compatible clients include qBittorrent, uTorrent, Transmission, and LibreTorrent.
Security & safety
RISK: MEDIUMA .magnet file itself is plain text containing only a URI - it cannot harm your system when opened in a text editor, and a torrent client can't install malware by reading the URI. The risk lies in what you download with it: torrented content may be malware-laden, mislabelled, or copyrighted material. As with .torrent files, your IP address is visible to other peers. Use a reputable open-source client (qBittorrent, Transmission), avoid ad-laden or bundleware clients, and scan downloaded executables.
Format details
in a nutshellPrograms that open MAGNET files
Technical details
deep spec| Content | Single `magnet:` URI (query-string format beginning with `magnet:?`) |
| Encoding | ASCII/UTF-8; non-ASCII characters are percent-encoded |
| Container | Plain text - no binary structure |
| v1 infohash | SHA-1, 40-character hex or 32-character Base32 - carried in `xt=urn:btih:` parameter |
| v2 infohash | SHA-256, 68-character hex - carried in `xt=urn:btmh:` parameter (BitTorrent v2, 2020) |
| Optional parameters | `dn` (display name), `tr` (tracker URL, repeatable), `xl` (exact length), `as` (acceptable source) |
| Tracker requirement | Optional - client resolves peers via DHT and peer exchange without a tracker URL |
| Data integrity | Infohash is the cryptographic fingerprint of content; client verifies all downloaded pieces against it |
| Typical file size | 100 bytes - 2 KB (a magnet URI is typically 100-500 characters) |
| MIME type | `application/x-magnet` |
| Practical use | Usually handled as a browser hyperlink via OS URI handler; `.magnet` files appear only when a server forces download of the URI |
| Released | 2002 (Gordon Mohr / Bitzi; BitTorrent adoption ~2008) |
| Latest version | BitTorrent v2 magnet (btmh: prefix with SHA-256, 2020) |
| Open standard | Yes · royalty-free |
| Specification | www.bittorrent.org |
MAGNET conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about MAGNET files.