Torrent file

application/x-bittorrent

Safe

Magic Bytes

Offset: 0
64 38 3A 61 6E 6E 6F 75 6E 63 65

A Torrent file is a metadata container defined by the BitTorrent protocol, maintained by BitTorrent, Inc., and originally developed for peer-to-peer distribution. These files store tracker URLs and cryptographic hashes of data segments to coordinate decentralized transfers across compatible clients. While the format itself is inherently safe, it has been largely superseded by magnet links in modern environments to reduce dependency on centralized tracker infrastructure and improve network resilience.

Extension

.torrent

MIME Type

application/x-bittorrent

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .torrent files in Python

Python
def is_torrent(file_path: str) -> bool:
    """Check if file is a valid TORRENT by magic bytes."""
    signature = bytes([0x64, 0x38, 0x3A, 0x61, 0x6E, 0x6E, 0x6F, 0x75, 0x6E, 0x63, 0x65])
    with open(file_path, "rb") as f:
        return f.read(11) == signature

How to validate .torrent files in Node.js

Node.js
function isTORRENT(buffer: Buffer): boolean {
  const signature = Buffer.from([0x64, 0x38, 0x3A, 0x61, 0x6E, 0x6E, 0x6F, 0x75, 0x6E, 0x63, 0x65]);
  return buffer.subarray(0, 11).equals(signature);
}
Go
func IsTORRENT(data []byte) bool {
    signature := []byte{0x64, 0x38, 0x3A, 0x61, 0x6E, 0x6E, 0x6F, 0x75, 0x6E, 0x63, 0x65}
    if len(data) < 11 {
        return false
    }
    return bytes.Equal(data[:11], signature)
}

API Endpoint

GET /api/v1/torrent
curl https://filesignature.org/api/v1/torrent

Related Formats