What is a torrent info hash?

The info hash is the ID of a torrent. It's a hash of the torrent's file list and pieces, and it's what a magnet link points to and what clients look up in the DHT to find peers. The same hash turns up in different forms, which is where the confusion starts.

A v1 torrent has a SHA-1 info hash: 20 bytes, written as 40 hex characters, or as 32 Base32 characters in older magnet links. A v2 torrent (BitTorrent v2, BEP 52) has a SHA-256 info hash: 32 bytes, 64 hex characters. In a magnet link it sits behind urn:btmh: as a multihash, with 1220 in front (SHA-256, 32 bytes). Hybrid torrents carry both.

Tool description

Paste an info hash in any of these forms, or a magnet link, and the tool tells you whether it's a v1 or a v2 hash and gives you:

  • the v1 hash in lowercase hex and in Base32
  • the v2 hash in lowercase hex
  • a short magnet link with only the hash and the name from a pasted magnet link

The short magnet link drops the trackers, web seeds and everything else. Clients with DHT turned on find peers with the hash alone. A v1 hash can't be turned into a v2 hash or back: they come from different hash functions, so only a hybrid magnet link gives you both.

Examples

A 32 character Base32 hash comes back as the same v1 hash in 40 hex characters, with a magnet link in this form:

magnet:?xt=urn:btih:<40 hex characters>

A 64 character hex hash is a v2 hash, and its magnet link adds the multihash prefix:

magnet:?xt=urn:btmh:1220<64 hex characters>

Features

  • Reads hex, Base32 and multihash info hashes and magnet links
  • Tells v1, v2 and hybrid torrents apart
  • Makes a short magnet link that keeps the name