Torrent safety

Magnet links explained

A magnet link is a short text link that identifies a torrent by its info-hash, a fingerprint of the file's details. Your torrent client uses it to find peers and fetch the rest of the torrent's information from them. It's convenient, but it doesn't tell you who published the file.

Updated November 13, 2026 4 min read 8 sources

What is a magnet link?

A magnet link is a link that starts with magnet:? instead of https://. Clicking one opens your torrent client, which uses the link to find and download a torrent. Unlike a .torrent file, a magnet link doesn't contain the list of files or the hashes of each piece. It contains just enough to find people who have them. The format for BitTorrent is set out in BEP 9, one of the BitTorrent Enhancement Proposals published at bittorrent.org.

Magnet link vs .torrent file

A .torrent file, defined in BEP 3, is a small file holding a tracker address and an "info" section: the file names, their sizes, the piece size and a SHA-1 hash for every piece. The info-hash is a hash of that info section. It identifies the torrent to trackers and peers.

Magnet link vs .torrent file
Feature.torrent fileMagnet link
What it isA small file you downloadA line of text
Contains piece hashesYesNo, fetched from peers
Contains the info-hashCan be calculated from itYes, it's the required part
Needs peers before showing file listNoYes
Typical useLinux and archive downloadsSharing links on web pages and in messages

The parts of a magnet link

A BitTorrent magnet link looks like this, with a placeholder hash:

magnet:?xt=urn:btih:INFOHASH&dn=ubuntu-26.04-desktop-amd64.iso&tr=TRACKER-URL

  • xt (exact topic): the only required part. urn:btih: is followed by the info-hash, written as 40 hexadecimal characters or, in older links, 32 base32 characters.
  • btmh: newer BitTorrent v2 torrents use urn:btmh: with a SHA-256-based hash. A hybrid torrent's link can include both btih and btmh.
  • dn (display name): an optional name your client shows while it waits for the details. It's just a label, and anyone can type anything there.
  • tr (tracker): optional tracker addresses. A link can list several.
  • x.pe (peer address): an optional address of a peer to contact directly.

How your client turns a magnet link into a download

  1. Find peers The client asks any trackers in the link for peers sharing that info-hash. If there are none, BEP 9 says it should look the hash up in the DHT, a distributed table spread across many BitTorrent users.
  2. Ask for the metadata Using an extension called ut_metadata, the client asks peers for the torrent's info section in 16 KiB blocks.
  3. Check it against the hash Once it has all the blocks, the client hashes them and compares the result with the info-hash in the link. If they don't match, it discards them.
  4. Download as normal With the file list and piece hashes in hand, the client downloads and checks each piece as it would with a .torrent file.

Are magnet links safe?

The link itself is text and can't run code. The hash check means you'll receive exactly the file the link describes. The risks are elsewhere:

  • The hash doesn't say who made the file. A magnet link to malware is a perfectly valid magnet link. Bitdefender documented fake film torrents in 2025 carrying the Agent Tesla trojan and the Lumma password stealer. Take links only from the publisher's own site. See torrent malware.
  • The display name can lie. dn is free text. A link labeled as a Linux image can point at anything.
  • Your IP address is visible. To fetch metadata and pieces, your client connects to peers, who can see your IP address. If a link has an x.pe address, that's someone's IP address too.
  • Copyright still applies. A magnet link to a copyrighted film shared without permission is the same legal problem as a .torrent file. See is torrenting illegal?

How to check a magnet link is genuine

For software and disk images, compare against something the publisher signs. Arch Linux, for example, posts its magnet link, the SHA256 and BLAKE2b checksums and a PGP signature on the same official page. After downloading, check the file's checksum and signature as shown in our safe torrenting guide.

Why many sites switched to magnet links

Magnet links are cheaper to serve because the site doesn't store or deliver files. In 2012, The Pirate Bay announced it would stop offering .torrent files and use magnet links only, saying it would be cheaper. Legal sites use both: Arch Linux offers a magnet link and a torrent file; the Internet Archive explains that if you have only a magnet link, you can save it in a text file named with .torrent and upload that to an item.

Questions people ask

What is a magnet link?

A text link starting with magnet:? that identifies a torrent by its info-hash. Your torrent client uses it to find peers and fetch the torrent's details from them.

Are magnet links illegal?

No. They're just links. Legal projects such as Arch Linux publish them. Downloading copyrighted material without permission through one is illegal, as with any torrent.

Can a magnet link contain a virus?

The link itself can't run code. It can point to a file that contains malware, so take links only from the publisher's official site and verify downloads.

Why is my magnet link stuck on downloading metadata?

Your client hasn't found any peers that have the torrent's details. The link may have no trackers, the swarm may be empty, or DHT may be turned off in your client.

What does btih mean in a magnet link?

BitTorrent info-hash. It's followed by the 40-character hex (or 32-character base32) hash that identifies the torrent.

Sources

  1. BEP 9: Extension for Peers to Send Metadata Files (magnet links) (bittorrent.org) · read November 13, 2026
  2. BEP 3: The BitTorrent Protocol Specification (bittorrent.org) · read November 13, 2026
  3. BEP 52: The BitTorrent Protocol Specification v2 (bittorrent.org) · read November 13, 2026
  4. Arch Linux downloads (magnet link, checksums, signature) (archlinux.org) · read November 13, 2026
  5. Archive BitTorrents (Internet Archive Help Center) (help.archive.org) · read November 13, 2026
  6. The Pirate Bay (Wikipedia, 2012 magnet-only switch) (en.wikipedia.org) · read November 13, 2026
  7. Fake Leonardo DiCaprio movie torrent drops Agent Tesla (Bitdefender Labs, December 2025) (bitdefender.com) · read November 13, 2026
  8. Fake Mission: Impossible torrent spreads Lumma Stealer (Bitdefender, May 2025) (bitdefender.com) · read November 13, 2026