Convert JSON to Bencode
Convert a JSON data structure to Bencode encoding. Runs entirely in your browser, so your data never leaves your device.
0 chars · 0 lines
Output
The result appears here as you type.
How to use Convert JSON to Bencode
- 1. Paste your JSON. Paste the JSON object or array you want encoded to Bencode, the format BitTorrent .torrent files use to describe strings, integers, lists and dictionaries.
- 2. Review how Bencode encodes each type. There are no settings here: strings are written as their byte length followed by a colon and the text, integers as i followed by digits and e, and objects and arrays as d or l blocks ending in e.
- 3. Copy the Bencode output. Copy the resulting Bencode text and use it to test a torrent parser, build a piece of BitTorrent tooling, or study how the format represents structured data.
When to use Convert JSON to Bencode
Convert JSON to Bencode encodes JSON data into Bencode, the compact text-based serialization BitTorrent uses inside .torrent files and its peer protocol. It is for anyone building or testing BitTorrent-adjacent tooling who wants known Bencode output from familiar JSON input.
- Testing a Bencode parser you are writing. You are implementing a Bencode decoder for a torrent client or library and need known-correct Bencode output generated from a specific JSON input to test against.
- Studying how BitTorrent's metadata format encodes data. You want to understand exactly how Bencode represents strings, integers and nested structures by comparing familiar JSON to the equivalent Bencode text.
- Building a sample .torrent-adjacent metadata block. You are experimenting with the info dictionary structure that .torrent files use and want to convert a JSON draft of the metadata into valid Bencode.
- Debugging a BitTorrent client's tracker communication. You are reverse-engineering or debugging tracker request and response handling and want to construct Bencode test data from JSON you already understand.
Examples
Encode an object
Input
{"name": "Ada", "age": 36}Output
d3:agei36e4:name3:Adae
About the Convert JSON to Bencode tool
Convert JSON to Bencode is a free online tool that works entirely inside your web browser. Convert a JSON data structure to Bencode encoding. Because the processing happens on your own device, nothing you enter is uploaded, logged or stored anywhere.
This page is one of 90 JSON utilities on EditSafely. Each one does a single job well, and all of them follow the same rule: your input stays on your machine.
There is nothing to configure. Provide the input and the result appears on its own. A worked example further down the page shows exactly what the tool produces for a real input.
Because nothing leaves your device, the tool is suitable for sensitive content such as internal documents, credentials or customer data. It also responds instantly, since every keystroke is handled on your own machine rather than by a remote API.
Frequently asked questions
Does Convert JSON to Bencode cost anything?
Yes, it is completely free. All 2,658 tools on EditSafely work without an account, a subscription or usage limits.
Is it safe to paste sensitive or confidential data?
No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.
How much text can I process at once?
There is no fixed limit. Because the work happens on your own device rather than on a shared server, the practical ceiling is your machine's memory, which comfortably handles inputs far larger than typical online tools allow.
Do I need to sign up or install anything?
Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.
How do I use the result?
The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.