不喜欢广告? 无广告 今天

Bencode 编码器 / 解码器

数据开发人员
广告 · 消除?

或者
广告 · 消除?

指导

Bencode Encoder / Decoder

Bencode 编码器 / 解码器

Encode JSON to Bencode format or decode Bencode back to JSON instantly. Bencode is the serialisation format used by BitTorrent for .torrent files and the DHT protocol. Paste Bencode input to decode it into readable JSON, or paste JSON to encode it into compact Bencode — all client-side with no data transmitted.

如何使用

Select your direction (Bencode → JSON or JSON → Bencode), paste your input, and the result appears instantly. Use the built-in example to see a real .torrent file structure decoded into JSON.

特征

  • 双向转换 – Bencode to JSON and JSON to Bencode
  • Full type support – integers, byte strings, lists, and dictionaries
  • 示例预设 – real .torrent file structure for reference
  • Real-time output – converts as you type
  • 仅客户端 – 您的数据绝不离开浏览器

广告 · 消除?

常问问题

  1. What is Bencode and why does BitTorrent use it?

    Bencode is a simple serialisation format designed for BitTorrent by Bram Cohen. It encodes four types: byte strings (4:spam), integers (i42e), lists (l...e), and dictionaries (d...e). BitTorrent uses it for .torrent metainfo files and DHT messages because it is unambiguous (no encoding ambiguity like JSON has for numbers), compact, and trivial to parse in any language without a library.

  2. How does Bencode encode different data types?

    Bencode encodes integers as ie (e.g., i42e), byte strings as : (e.g., 4:spam), lists as le, and dictionaries as de where keys must be byte strings in sorted order. Nesting is supported arbitrarily. There is no native boolean or float type — booleans are represented as integers (0/1) and floats are typically stored as strings.

  3. What information is inside a .torrent file?

    A .torrent file is a Bencoded dictionary containing: the announce URL of the tracker, an info dictionary with the torrent name, piece length, SHA-1 hashes of all pieces, and either a single file length or a list of files with paths and lengths. Optional fields include announce-list (backup trackers), creation date, comment, and created-by. Magnet links encode a subset of this as a URI.

  4. Can Bencode handle binary data?

    Yes. Bencode byte strings are raw binary sequences prefixed with their byte length. This is why .torrent files store SHA-1 piece hashes as raw 20-byte binary strings rather than hex. When converting Bencode to JSON, binary strings are typically represented as hex or Base64 since JSON has no native binary type.

想要享受无广告的体验吗? 立即无广告

安装我们的扩展

将 IO 工具添加到您最喜欢的浏览器,以便即时访问和更快地搜索

添加 Chrome 扩展程序 添加 边缘延伸 添加 Firefox 扩展 添加 Opera 扩展

记分板已到达!

记分板 是一种有趣的跟踪您游戏的方式,所有数据都存储在您的浏览器中。更多功能即将推出!

广告 · 消除?
广告 · 消除?
广告 · 消除?

新闻角 包含技术亮点

参与其中

帮助我们继续提供有价值的免费工具

给我买杯咖啡
广告 · 消除?