Bencode Encoder / Decoder

Read bencode — the compact byte-oriented format inside .torrent metainfo files — as JSON, or write canonical bencode back from JSON.

Paste one complete bencoded value. Byte-string lengths count bytes, not characters, and the whole input is read as UTF-8.

Choose Decode to JSON to read the sample metainfo value.

Bencode (BitTorrent BEP 3) has four types: i…e integers, length:bytes byte strings, l…e lists and d…e dictionaries whose byte-string keys are sorted bytewise. Decoding refuses unsorted or duplicate keys, leading zeros, truncation and trailing data, and reports the byte offset. Byte strings that are not valid UTF-8 are shown as 0x… hex. All processing stays in your browser.