A fully client-side, browser-based torrent creator. Magnetar takes one or more local files and produces a valid .torrent metainfo file and a corresponding magnet link, entirely within the browser. No server upload occurs at any point — all file data is processed locally using the Web Crypto API and Web Workers.
- Drag-and-drop support for individual files and entire directories
- Automatic and manual piece size selection (16 KiB to 32 MiB)
- Multi-tier tracker configuration
- Web seed support (HTTP/HTTPS URLs per BEP-0017/BEP-0019)
- Private torrent flag (disables DHT and PEX)
- Source, comment, and creator metadata fields
- Magnet link generation with inline copy
- One-click
.torrentfile download - Info hash display for cross-verification with BitTorrent clients
- Piece hashing offloaded to a Web Worker to keep the UI responsive
| Requirement | Notes |
|---|---|
| Modern browser | Chrome 80+, Firefox 114+, Edge 80+, Safari 15.4+ |
| Secure context | The page must be served over HTTPS or from localhost. crypto.subtle and Web Workers are unavailable in insecure contexts. |
| Local HTTP server | Required for ES module support. Opening index.html directly via file:// will not work. |
Any static HTTP server works. Examples:
# Python 3
python3 -m http.server 8080
# Node.js (npx)
npx serve .
# Node.js (http-server)
npx http-server -p 8080Then open http://localhost:8080 in your browser.
Use the Browse Files button to select individual files, Browse Folder to select an entire directory, or drag and drop either files or folders onto the drop zone. Files can be added incrementally; they are merged into a single set.
To reset the file list, click Clear all.
| Field | Description |
|---|---|
| Torrent Name | The name field in the info dictionary. Defaults to the filename (single file) or folder name (multi-file). |
| Piece Size | Size of each piece in bytes. Auto selects an appropriate size targeting approximately 1000–1500 pieces. |
| Private Torrent | Sets private = 1 in the info dictionary. Instructs clients to disable DHT and peer exchange for this torrent. |
| Comment | Optional free-text comment stored in the metainfo root. |
| Source | Placed inside the info dictionary. Used by private trackers to distinguish re-encoded releases. |
| Created By | Identifies the creating application. Defaults to Magnetar/1.0. |
| Trackers | One announce URL per line. Separate tiers with a blank line. The first non-empty line of the first tier becomes the announce key; all tiers populate announce-list. |
| Web Seeds | One HTTP/HTTPS URL per line. Stored as url-list in the metainfo root. |
Click Load defaults in the Trackers field to populate a curated list of public trackers organised into three tiers.
Click Create Torrent. A progress indicator shows the SHA-1 piece hashing progress. Hashing runs in a background Web Worker and does not block the browser tab.
When complete, the output section shows:
- The full 40-character hex info hash
- Torrent name, total size, piece size, piece count, and file count
- A copyable magnet link
- A Download .torrent button
- A Copy Info Hash button
Tiers are separated by blank lines in the tracker textarea:
udp://tracker.opentrackr.org:1337/announce
udp://open.tracker.cl:1337/announce
udp://tracker.torrent.eu.org:451/announce
https://tracker.gbitt.info/announce
This produces:
announce = udp://tracker.opentrackr.org:1337/announce
announce-list = [
[ "udp://tracker.opentrackr.org:1337/announce", "udp://open.tracker.cl:1337/announce" ],
[ "udp://tracker.torrent.eu.org:451/announce" ],
[ "https://tracker.gbitt.info/announce" ]
]
All file content is concatenated in sorted path order (lexicographic), then split into fixed-size pieces. Each piece is hashed with SHA-1 using the Web Crypto API. The resulting 20-byte digests are concatenated into the pieces binary string required by the BitTorrent v1 specification. Files are read in 4 MiB slices to avoid exhausting available memory on large inputs.
The info hash is computed by SHA-1 hashing the bencoded form of the info dictionary — the same dictionary embedded in the final .torrent file. This ensures the info hash produced by Magnetar matches what any conformant BitTorrent client would compute from the same .torrent file.
Magnetar implements a binary-safe bencode encoder. Dictionary keys are sorted lexicographically by raw UTF-8 byte comparison, as required by the specification. The pieces field is stored as a raw Uint8Array and length-prefixed correctly without UTF-8 re-encoding.
If exactly one file is added and its path has no directory components, the torrent is created in single-file mode: the info dictionary contains length directly. Otherwise, multi-file mode is used with a files list.
crypto.subtle: Requires a secure context (HTTPS or localhost). The application displays a warning and disables the Create button if unavailable.webkitGetAsEntry(): Used for directory drag-and-drop. Supported in all major browsers under this name despite the webkit prefix.webkitdirectory: The folder picker input attribute. Supported in Chrome, Firefox, Edge, and Safari.- Web Workers: Required for non-blocking piece hashing. Universally supported in modern browsers.
GPLv3. See LICENSE for the full text.