Skip to main content

Bencode Decoder / Encoder

Decode bencode to JSON, open a .torrent file to see its files, size, trackers, info hash and magnet link, or encode JSON to bencode.

Input

Stays in your browser

Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)

Next steps

Done here? Use the Send to… menu on the result to carry it on to Hash Generator.

Free Online Bencode Decoder / Encoder

Bencode is the format of .torrent files. Read it as JSON, or open a torrent to see what is inside without a torrent client. It gives developers a quick browser-based way to solve a focused bencode decoder / encoder task before moving the result into a project.

How to use Bencode Decoder / Encoder

Choose Decode, Torrent details or Encode. Paste bencode text, hex or Base64, or open a .torrent file. The tool never contacts a tracker.

Common mistakes

  • Pasting a magnet link: it is not bencode. Use a .torrent file.
  • Editing JSON with decimals: bencode only has whole numbers.

Frequently asked questions

What is the info hash?
The SHA-1 of the bencoded "info" dictionary. It identifies the torrent in the network and in magnet links.
Does it contact trackers?
No. The file is read in your browser and nothing is sent anywhere.
Why do some values show as hex:…?
Bencode strings can hold any bytes. When they are not readable text, they are shown as hex with a "hex:" prefix (the piece hashes, for example).
Is my data uploaded?
No. Compression runs in your browser and nothing you paste or open is sent to a server.
How do I use this bencode decoder / encoder tool?
Use the interactive controls above; processing stays in your browser and the result is intended as a practical starting point for development work.

More Code & Conversion

View all Code & Conversion tools →