Bencode Converter
Encode JSON to Bencode format or decode Bencode to JSON.
About Bencode Converter
The Bencode Converter encodes JSON data structures into Bencode format and decodes Bencode-encoded data back to readable JSON. Bencode is the serialization format invented by Bram Cohen for the BitTorrent protocol — it encodes integers as i<n>e, strings as <length>:<string>, lists as l<items>e, and dictionaries as d<key-value pairs>e. All .torrent files are Bencode-encoded, and Bencode is used for BitTorrent tracker announce/scrape HTTP responses. This tool makes torrent file inspection and modification straightforward.
How to Use
To decode a .torrent file, paste the raw Bencode string or hex-encoded bytes into the input field and click Decode — the tool displays the structured JSON including info_hash components, announce URLs, and file lists. To create Bencode, paste valid JSON and click Encode. Error messages identify malformed Bencode syntax with precise location information.
Common Use Cases
- Inspecting .torrent file contents by decoding the Bencode structure to JSON to see tracker URLs, file names, and piece hashes
- Modifying torrent metadata such as announce tracker URLs by decoding to JSON, editing values, then re-encoding to Bencode
- Debugging BitTorrent tracker HTTP announce and scrape responses to verify peer counts and torrent statistics
- Building and testing BitTorrent client implementations by generating valid Bencode test vectors from JSON input
- Analyzing the Bencode info dictionary structure for calculating the torrent info_hash during BitTorrent protocol research