"Invalid torrent file": a .torrent that your client rejects

Last reviewed 2026-09-19

A .torrent file is a small structured text-and-binary file (bencode). It breaks when a download is cut off, when a web page was saved instead of the file, or when extra bytes are added. Clients then refuse it, even though the important part usually survives.

Messages you might see

  • “Invalid torrent file”
  • “Unable to parse torrent / bencode error”
  • “Torrent is invalid or corrupt”

Why it happens

  • The site returned an HTML error page that was saved as .torrent.
  • The download was cut off, or junk was added before or after the data.
  • The file was opened and saved in a text editor, which changes its bytes.

Try this first (free, no tool needed)

  1. Open the file in a text editor. If it starts with <html or <!DOCTYPE it is a web page, not a torrent: download it again.
  2. Download the .torrent again, or use the magnet link from the same page instead.
  3. Do not edit a .torrent in a text editor.

If that didn't work

These tools run in your browser. Your file is read and repaired on your own device and is never uploaded.

Broken .torrent Metadata Repair

Reads the file leniently and writes a clean one: removes junk before and after, closes unfinished lists and dictionaries and normalises numbers and key order. The info dictionary is copied byte for byte when intact, so the info-hash does not change, and it shows the info-hash and a magnet link. Piece hashes that were cut off cannot be recreated.

Open Broken .torrent Metadata Repair

Common questions

Will the repaired torrent still connect to the same swarm?

Yes when the info dictionary was intact, because the info-hash stays the same. If that dictionary had to be repaired, the hash changes and the repaired torrent no longer matches the original swarm; the tool tells you when that happens.

Is my file uploaded anywhere?

No. The tool runs as a program inside your own browser, so the file is read and repaired on your device and never sent to a server.

Related guides