Magnet Link Validator
Validate magnet link format (magnet:?xt=urn:btih:...) and extract params: hash, torrent name, trackers, size.
Magnet links: how BitTorrent removed the .torrent file
A magnet link is a URI that fully identifies a piece of content by its cryptographic hash, allowing a BitTorrent client to start downloading without a .torrent file. It was popularized by The Pirate Bay in 2012 when the site replaced every .torrent download with a magnet link, drastically reducing hosting costs and legal exposure. There is no formal RFC for magnets โ it is a de facto standard rooted in the magnet: URI scheme proposed in 2002.
A valid magnet link is a query string after the magnet:? prefix. The only mandatory parameter is xt (exact topic), which carries the content hash. Trackers, peers and metadata can all be discovered dynamically over the DHT (Distributed Hash Table), making a single magnet self-sufficient.
Anatomy of a magnet link
magnet:?xt=urn:btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88a
&dn=ubuntu-24.04-desktop-amd64.iso
&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce
&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451
- xt โ exact topic.
urn:btih:is BitTorrent v1 infohash (SHA-1, 40 hex).urn:btmh:is BitTorrent v2 (multihash SHA-256). - dn โ display name. Suggested filename, purely cosmetic.
- tr โ tracker URL (can repeat). UDP or HTTP/HTTPS.
- xs โ exact source. A direct HTTP/FTP mirror of the file or torrent.
- as โ acceptable source. Alternate URL the client may try.
- xl โ exact length, in bytes.
- kt โ keyword topic. Free-form search keywords, mostly historical.
- ws โ web seed (BEP-19). HTTP fallback when peers are scarce.
Hashes: BTIHv1 (SHA-1) and BTIHv2 (SHA-256)
The original infohash is the SHA-1 digest of the info dictionary of a .torrent file โ 20 bytes, 40 hex characters, or 32 Base32 characters. In 2020, BitTorrent v2 was finalized (BEP-52) and replaced SHA-1 with SHA-256, producing 32-byte hashes encoded with multihash (urn:btmh:). Hybrid torrents carry both, so a single magnet link can target both v1 and v2 swarms simultaneously.
A robust validator must accept both:
urn:btih:+ 40 hex chars (SHA-1 hex)urn:btih:+ 32 Base32 chars (SHA-1 Base32)urn:btmh:1220+ 64 hex chars (SHA-256 multihash)
DHT: how magnets find peers without trackers
The DHT (Distributed Hash Table) is a peer-to-peer overlay that stores (infohash โ peer list) entries distributed across every BitTorrent client. The two dominant implementations are Mainline DHT (used by uTorrent, qBittorrent, Transmission) and Vuze KAD (older, less common today). Combined with PEX (Peer Exchange) and the metadata exchange of BEP-9, a magnet link can bootstrap a full download with zero trackers. Tracker URLs in the tr parameter are now an optimization, not a requirement.
Magnet vs .torrent file
- Size: a magnet link is a few hundred bytes; a
.torrentfile can be megabytes for large multi-file payloads. - Hosting: magnets can be shared as plain text on forums, chat, even SMS.
- Bootstrap: magnets pull metadata from peers via BEP-9;
.torrentfiles already contain it. - Speed: a
.torrentstarts downloading immediately; a magnet has to fetch metadata first, which adds a few seconds.
Legality and Brazilian context
BitTorrent is a neutral file-distribution protocol used by Ubuntu, Debian, Internet Archive, Blizzard's game updates and Facebook's container deployments. Magnets themselves are legal. What makes a magnet illegal is the content it points to: copyrighted material distributed without permission violates the Brazilian Lei 9.610/1998 (copyright law) and the U.S. DMCA. Anatel in Brazil does not enforce blanket P2P blocking, and major ISPs do not throttle BitTorrent traffic, but rights holders can pursue infringers civilly. Always check the legality of the content before using a magnet link.
Recommended clients and streaming
- qBittorrent: open source, ad-free, the de facto recommendation since uTorrent added bundled software.
- Transmission: lightweight, default on macOS and many Linux distros, with a great web UI.
- Deluge: extensible via plugins; good for seedbox setups.
- WebTorrent: BitTorrent in the browser using WebRTC. Powers streaming sites and the WebTorrent Desktop client.
- Peerflix: stream a torrent to a video player while it downloads, popular in the era before Netflix-style services.
FAQ
Does a magnet need a tracker? No. With the DHT and PEX, a magnet can locate peers without any tr URL. Trackers speed up bootstrap, especially in small swarms.
Is the difference between .torrent and magnet just convenience? Largely yes โ both point to the same swarm. Magnets are smaller and self-discovering; .torrent files start faster because metadata is already embedded.
Are magnet links legal in Brazil? Magnets themselves are neutral URIs. Legality depends on what the hash points to: distributing copyrighted material without permission violates Lei 9.610/1998, while downloading a Linux ISO is perfectly legal.
What is BTIHv2? BitTorrent v2 (BEP-52), finalized in 2020, replaces SHA-1 with SHA-256 and encodes the hash as a multihash (urn:btmh:). Hybrid torrents carry both v1 and v2 hashes in the same magnet.
Does this tool send the magnet to a server? No. Parsing and validation run entirely in the browser; nothing is uploaded or logged.
Related Tools
CPF Validator
Validate Brazilian CPF numbers instantly using the official algorithm. Useful for testing document validation in applications. No data sent to servers.
Batch CPF Validator
Validate a list of CPFs (one per line) and see which are valid and which are not. No data sent to servers.
Batch CNPJ Validator
Validate a list of CNPJs (one per line) with a summary of valid, invalid and total. No data sent to servers.