Bencode Converter

What is a Bencode Converter?

Decode BitTorrent Bencode binary structure data (used in `.torrent` files and DHT network protocols) into readable JSON, and encode JSON back into Bencode format.

Why Use This Tool?

  • Torrent File Inspection: Inspect `.torrent` metadata (announce URLs, file lists, piece hashes, piece length) in human-readable JSON.
  • BitTorrent Client Development: Debug Bencode serialized data structures for torrent clients or DHT nodes.
  • File Hash Verification: Verify piece length and file tree arrays in Bencoded structures.

How to Use

  1. Paste Bencode string (e.g. `d4:spam4:eggse`) or upload a `.torrent` file.
  2. Click Decode to view formatted JSON tree structure.
  3. Modify JSON and click Encode to convert back to Bencode format.

Real Working Example

Input:

Bencode Input: d4:spam4:eggs4:wiki7:bencodee

Output Result:

JSON Result:
{
  "spam": "eggs",
  "wiki": "bencode"
}

Important Technical Details & Specifications

  • BitTorrent Bencode Specs: Supports Bencode strings (`length:string`), integers (`i123e`), lists (`l...e`), and dictionaries (`d...e`).
  • Dictionary Key Ordering: Enforces lexicographical key sorting per Bencode specification.
  • Local Memory Execution: Zero network overhead.

Related Data & Format Tools

Frequently Asked Questions

What is Bencode format?

Bencode is the encoding format used by BitTorrent to store and transmit metadata in .torrent files and DHT trackers.

How are strings represented in Bencode?

Strings are length-prefixed followed by a colon and string content (e.g. 4:spam).

Can I upload a .torrent file to inspect its metadata?

Yes, upload any .torrent file to view its announce trackers and file layout in JSON.

Is it free?

Yes, 100% free.

Are my uploaded torrent files sent to a server?

No, all Bencode parsing happens 100% locally in your web browser.

Why must dictionary keys be sorted in Bencode?

Bencode requires lexicographical key sorting to ensure a unique deterministic binary representation for info hash calculations.