{
  "id": "download-time",
  "version": "89819a8368f4",
  "status": "published",
  "name": "Download Time Calculator",
  "question": "What is the download time?",
  "summary": "Computes how long a file takes to download (or upload) from its size and the connection speed in Mbps, or the speed needed to finish in a given time, or the size that fits in a time.",
  "category": "logic",
  "subcategory": "networks",
  "url": "https://www.acalculator.org/logic/download-time-calculator",
  "markdown": "https://www.acalculator.org/logic/download-time-calculator.md",
  "kind": "formulas",
  "method": "time = size in bytes × 8 ÷ (speed in Mbps × 1,000,000); size = time × speed × 1,000,000 ÷ 8; speed = size × 8 ÷ (time × 1,000,000).",
  "assumptions": [
    "The whole connection speed goes to this one file. Real downloads are often slower: protocol overhead, Wi-Fi, a busy server or other devices on the line all take a share.",
    "Speeds are in megabits per second (Mbps): 1 Mbps is 1,000,000 bits per second, and 1 byte is 8 bits.",
    "File sizes use SI prefixes (1 GB = 10⁹ bytes) or binary prefixes (1 GiB = 2³⁰ bytes), whichever unit you pick.",
    "Every step is exact on the numbers as typed; values are rounded only for display."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "size": {
        "title": "File size",
        "description": "The size of the file or data to transfer.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "data-size",
        "exclusiveMinimum": 0,
        "maximum": 1000000000000000000
      },
      "mbps": {
        "title": "Speed (Mbps)",
        "description": "The connection speed in megabits per second (Mbps), as internet plans and speed tests show it.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 100000
      },
      "time": {
        "title": "Download time",
        "description": "How long the transfer takes at the full speed.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "time",
        "exclusiveMinimum": 0,
        "maximum": 1000000000
      }
    }
  },
  "solve": {
    "fillAny": 2,
    "variables": [
      "size",
      "mbps",
      "time"
    ],
    "inputsOnly": []
  },
  "outputs": {
    "size": {
      "label": "File size",
      "description": "The size of the file or data to transfer.",
      "format": "quantity"
    },
    "speed": {
      "label": "Speed (Mbps)",
      "description": "The connection speed in megabits per second (Mbps), as internet plans and speed tests show it.",
      "format": "number"
    },
    "time": {
      "label": "Download time",
      "description": "How long the transfer takes at the full speed.",
      "format": "quantity"
    },
    "clock": {
      "label": "In hours and minutes",
      "description": "The download time in days, hours, minutes and seconds, rounded half up to the whole second.",
      "format": "text"
    },
    "megabytes": {
      "label": "Speed in MB/s",
      "description": "The same speed in megabytes per second (Mbps ÷ 8), as download managers show it.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "size": "5 GB",
      "mbps": 100
    },
    "outputs": {
      "time": 400,
      "clock": "6 minutes, 40 seconds",
      "megabytes": 12.5
    },
    "text": "Downloading 5 GB at 100 Mbps takes 6.667 min (6 minutes, 40 seconds)."
  },
  "examples": [
    {
      "given": {
        "size": 5000000000,
        "mbps": 100
      },
      "expect": {
        "time": 400,
        "clock": "6 minutes, 40 seconds",
        "megabytes": 12.5
      },
      "source": "hand calculation in content.mdx: 5 × 10⁹ bytes × 8 = 4 × 10¹⁰ bits ÷ 10⁸ bits per second = 400 s; SI prefixes giga = 10⁹, mega = 10⁶ (NIST, https://www.nist.gov/pml/owm/metric-si-prefixes)"
    },
    {
      "given": {
        "size": 734003200,
        "mbps": 8
      },
      "expect": {
        "time": 734.0032,
        "clock": "12 minutes, 14 seconds",
        "megabytes": 1
      },
      "source": "hand calculation in content.mdx: 700 × 1,048,576 bytes × 8 ÷ 8,000,000 bits per second = 734.0032 s; binary prefix mebi = 2²⁰ (NIST, https://physics.nist.gov/cuu/Units/binary.html)"
    },
    {
      "given": {
        "size": 50000000000,
        "time": 3600
      },
      "expect": {
        "mbps": 111.11111111111111,
        "clock": "1 hour"
      },
      "source": "hand calculation in content.mdx: 50 × 10⁹ × 8 ÷ 3,600 ÷ 10⁶ = 111.1 Mbps (SI prefixes, NIST https://www.nist.gov/pml/owm/metric-si-prefixes)"
    },
    {
      "given": {
        "mbps": 1000,
        "time": 60
      },
      "expect": {
        "size": 7500000000
      },
      "source": "hand calculation in content.mdx: 60 s × 1,000 × 10⁶ bits per second ÷ 8 = 7.5 × 10⁹ bytes = 7.5 GB (SI prefixes, NIST https://www.nist.gov/pml/owm/metric-si-prefixes)"
    }
  ],
  "sources": [
    "NIST, Metric (SI) prefixes: kilo 10³, mega 10⁶, giga 10⁹, tera 10¹². https://www.nist.gov/pml/owm/metric-si-prefixes",
    "NIST, Prefixes for binary multiples (IEC 60027-2): kibi 2¹⁰, mebi 2²⁰, gibi 2³⁰. https://physics.nist.gov/cuu/Units/binary.html"
  ],
  "related": [
    "raid",
    "subnet",
    "xor"
  ],
  "changelog": []
}
