{
  "slug": "bencode-decoder",
  "name": "gizza-ai/bencode-decoder",
  "version": "0.1.0",
  "title": "Bencode Decoder — bencode ⇄ JSON converter — gizza.ai",
  "description": "Decode bencode (the BitTorrent / .torrent serialization format) into readable JSON, and re-encode JSON back into canonical bencode — in your browser. Nothing is uploaded.",
  "tags": [
    "bencode",
    "bencode decoder",
    "bencode to json",
    "torrent",
    "torrent decoder",
    "bencode encoder",
    "bittorrent"
  ],
  "category": "data",
  "urls": {
    "page": "https://gizza.ai/tools/bencode-decoder/",
    "markdown": "https://gizza.ai/tools/bencode-decoder/index.md",
    "descriptor": "https://gizza.ai/tools/bencode-decoder/tool.json",
    "deep_link_example": "https://gizza.ai/tools/bencode-decoder/?input=d3%3Acow3%3Amoo4%3Aspam4%3Aeggse&mode=decode&pretty=true"
  },
  "cli": "gizza tool bencode-decoder \"d3:cow3:moo4:spam4:eggse\"",
  "tool": {
    "description": "Convert between bencode — the BitTorrent serialization format used by .torrent files and the tracker/DHT protocols — and JSON, in both directions. mode=decode (default) parses bencode text (integers i…e, byte strings <len>:…, lists l…e, dictionaries d…e) into readable JSON; mode=encode serializes JSON back into canonical bencode (dictionary keys are sorted by byte value). pretty indents the decode-mode JSON (default true). Non-UTF-8 byte strings (e.g. a torrent's binary `pieces` field) are carried losslessly as {\"_bencode_bytes_hex\":\"…\"} so decode then encode reproduces the exact bytes. Note: bencode has no boolean or null type. Runs locally — the data never leaves the device.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "input": {
          "description": "The data to convert: bencode text in decode mode, or JSON text in encode mode.",
          "type": "string"
        },
        "mode": {
          "default": "decode",
          "description": "decode (default) parses bencode into JSON; encode serializes JSON into bencode.",
          "enum": [
            "decode",
            "encode"
          ],
          "type": "string"
        },
        "pretty": {
          "default": true,
          "description": "Indent the JSON output in decode mode. Default true.",
          "type": "boolean"
        }
      },
      "required": [
        "input"
      ],
      "type": "object"
    }
  }
}