{
  "id": "raid",
  "version": "b6e84fcfae15",
  "status": "published",
  "name": "RAID Calculator",
  "question": "What is my RAID capacity?",
  "summary": "Computes the usable capacity, storage efficiency, and number of disk failures survived for a RAID 0, 1, 5, 6, or 10 array of identical disks.",
  "category": "logic",
  "url": "https://www.acalculator.org/logic/raid-calculator",
  "markdown": "https://www.acalculator.org/logic/raid-calculator.md",
  "kind": "function",
  "method": "Usable = RAID 0: N × S; RAID 1: S; RAID 5: (N − 1) × S; RAID 6: (N − 2) × S; RAID 10: N ÷ 2 × S, for N disks of size S.",
  "assumptions": [
    "All disks are the same size. In a mixed array, each disk counts as the smallest one.",
    "RAID 10 uses two-way mirror pairs and needs an even number of disks. RAID 1 mirrors the same data on every disk.",
    "Capacities are before the file system, hot spares, and the controller’s own metadata take their share.",
    "Disk sizes use decimal units (1 TB = 10¹² bytes), as drive makers label them."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "level": {
        "title": "RAID level",
        "description": "How the array spreads and protects data: RAID 0, 1, 5, 6, or 10.",
        "type": "string",
        "enum": [
          "0",
          "1",
          "5",
          "6",
          "10"
        ]
      },
      "disks": {
        "title": "Number of disks",
        "description": "How many disks are in the array, all the same size.",
        "type": "integer",
        "minimum": 2,
        "maximum": 128
      },
      "size": {
        "title": "Size of each disk",
        "description": "The capacity of one disk, as printed on the label (1 TB = 1,000,000,000,000 bytes).",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "data-size",
        "exclusiveMinimum": 0,
        "maximum": 1000000000000000
      }
    }
  },
  "outputs": {
    "usable": {
      "label": "Usable capacity",
      "description": "The space left for your data after parity or mirror copies, in decimal terabytes.",
      "format": "quantity",
      "unit": "TB"
    },
    "usableTiB": {
      "label": "Usable capacity in TiB",
      "description": "The same usable space in tebibytes (2⁴⁰ bytes), the unit most operating systems show as “TB”.",
      "format": "quantity",
      "unit": "TiB"
    },
    "raw": {
      "label": "Total raw capacity",
      "description": "The size of all the disks added up.",
      "format": "quantity",
      "unit": "TB"
    },
    "protection": {
      "label": "Used for protection",
      "description": "Raw capacity that holds parity or mirror copies instead of data.",
      "format": "quantity",
      "unit": "TB"
    },
    "efficiency": {
      "label": "Storage efficiency",
      "description": "Usable capacity as a percent of the raw capacity.",
      "format": "percent"
    },
    "tolerance": {
      "label": "Disk failures survived",
      "description": "How many disks can fail at the same time, in any combination, without losing data.",
      "format": "integer"
    },
    "toleranceBest": {
      "label": "Most failures survived (RAID 10)",
      "description": "How many disks can fail without data loss when each failed disk is in a different mirror pair.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "level": "5",
      "disks": 4,
      "size": 4000000000000
    },
    "outputs": {
      "usable": 12000000000000,
      "usableTiB": 12000000000000,
      "raw": 16000000000000,
      "protection": 4000000000000,
      "efficiency": 75,
      "tolerance": 1
    },
    "text": "4 disks of 4 TB in RAID 5 give 12 TB of usable space. Disk failures survived: 1."
  },
  "examples": [
    {
      "given": {
        "level": "5",
        "disks": 4,
        "size": 4000000000000
      },
      "expect": {
        "usable": 12000000000000,
        "usableTiB": 12000000000000,
        "raw": 16000000000000,
        "protection": 4000000000000,
        "efficiency": 75,
        "tolerance": 1
      },
      "source": "hand calculation in content.mdx: (4 − 1) × 4 TB = 12 TB = 10.91 TiB (raw values in bytes); SNIA dictionary, RAID 5 (n data + 1 parity)"
    },
    {
      "given": {
        "level": "6",
        "disks": 8,
        "size": 10000000000000
      },
      "expect": {
        "usable": 60000000000000,
        "efficiency": 75,
        "tolerance": 2
      },
      "source": "hand calculation in content.mdx: (8 − 2) × 10 TB = 60 TB; SNIA dictionary, RAID 6 (survives any two failures)"
    },
    {
      "given": {
        "level": "10",
        "disks": 6,
        "size": 2000000000000
      },
      "expect": {
        "usable": 6000000000000,
        "efficiency": 50,
        "tolerance": 1,
        "toleranceBest": 3
      },
      "source": "hand calculation in content.mdx: 6 ÷ 2 × 2 TB = 6 TB; SNIA dictionary, RAID 10 (RAID 0 over RAID 1 pairs, one failure per pair)"
    },
    {
      "given": {
        "level": "1",
        "disks": 3,
        "size": 2000000000000
      },
      "expect": {
        "usable": 2000000000000,
        "efficiency": 33.333333333333336,
        "tolerance": 2
      },
      "source": "hand calculation in content.mdx: every disk holds the same data, so 2 TB usable and 3 − 1 = 2 failures"
    },
    {
      "given": {
        "level": "0",
        "disks": 3,
        "size": 500000000000
      },
      "expect": {
        "usable": 1500000000000,
        "efficiency": 100,
        "tolerance": 0
      },
      "source": "hand calculation in content.mdx: 3 × 500 GB = 1.5 TB; SNIA dictionary, RAID 0 (no redundancy)"
    }
  ],
  "sources": [
    "SNIA Online Dictionary, RAID 0. https://www.snia.org/education/online-dictionary/term/raid-0",
    "SNIA Online Dictionary, RAID 1. https://www.snia.org/education/online-dictionary/term/raid-1",
    "SNIA Online Dictionary, RAID 5. https://www.snia.org/education/online-dictionary/term/raid-5",
    "SNIA Online Dictionary, RAID 6. https://www.snia.org/education/online-dictionary/term/raid-6",
    "SNIA Online Dictionary, RAID 10. https://www.snia.org/education/online-dictionary/term/raid-10",
    "NIST SP 811 and IEC 80000-13: 1 TB = 10¹² bytes, 1 TiB = 2⁴⁰ bytes."
  ],
  "related": [
    "subnet"
  ],
  "changelog": []
}
