{
  "id": "minecraft-stack",
  "version": "1bfdce0ce3a4",
  "status": "published",
  "name": "Minecraft Stack Calculator",
  "question": "How many stacks of items is that?",
  "summary": "Turns an item count into Minecraft stacks of 64 or 16 with the items left over, and the inventory slots, chests, double chests and shulker boxes they fill.",
  "category": "game",
  "subcategory": "video-games",
  "url": "https://www.acalculator.org/game/minecraft-stack-calculator",
  "markdown": "https://www.acalculator.org/game/minecraft-stack-calculator.md",
  "kind": "function",
  "method": "stacks = ⌊items ÷ size⌋; left over = items − stacks × size; slots = ⌈items ÷ size⌉; shulker boxes = ⌈slots ÷ 27⌉; double chests = ⌈slots ÷ 54⌉.",
  "assumptions": [
    "Every slot is filled to the full stack size before the next is used.",
    "A chest and a shulker box hold 27 slots; a double chest 54."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "n": {
        "title": "Items",
        "description": "How many items you have or need.",
        "type": "integer",
        "minimum": 0,
        "maximum": 1000000000000
      },
      "s": {
        "title": "Stack size",
        "description": "How many of the item fit in one slot: 64 for most blocks, 16 for items such as ender pearls.",
        "type": "string",
        "enum": [
          "64",
          "16",
          "1"
        ]
      }
    }
  },
  "outputs": {
    "summary": {
      "label": "Stacks",
      "description": "Whole stacks plus the items left over, for example 15 stacks + 40.",
      "format": "text"
    },
    "stacks": {
      "label": "Whole stacks",
      "description": "⌊items ÷ stack size⌋.",
      "format": "integer"
    },
    "rest": {
      "label": "Items left over",
      "description": "Items − whole stacks × stack size.",
      "format": "integer"
    },
    "slots": {
      "label": "Slots needed",
      "description": "⌈items ÷ stack size⌉.",
      "format": "integer"
    },
    "decimal": {
      "label": "Stacks as a decimal",
      "description": "Items ÷ stack size.",
      "format": "number"
    },
    "shulkers": {
      "label": "Shulker boxes or chests",
      "description": "⌈slots ÷ 27⌉: a shulker box or a single chest holds 27 slots.",
      "format": "integer"
    },
    "doubles": {
      "label": "Double chests",
      "description": "⌈slots ÷ 54⌉: a large chest holds 54 slots.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "n": 1000,
      "s": "64"
    },
    "outputs": {
      "summary": "15 stacks + 40",
      "stacks": 15,
      "rest": 40,
      "slots": 16,
      "decimal": 15.625,
      "shulkers": 1,
      "doubles": 1
    },
    "text": "1,000 items is 15 stacks + 40."
  },
  "examples": [
    {
      "given": {
        "n": 1000,
        "s": "64"
      },
      "expect": {
        "summary": "15 stacks + 40",
        "stacks": 15,
        "rest": 40,
        "slots": 16,
        "decimal": 15.625,
        "shulkers": 1,
        "doubles": 1
      },
      "source": "hand calculation in content.mdx: 15 × 64 = 960, 1,000 − 960 = 40; Minecraft Wiki, Item: most items stack to 64, some (ender pearls, snowballs, eggs, signs, buckets of snow) to 16, and tools, armor and potions do not stack, https://minecraft.wiki/w/Item (retrieved 2026-10-05); Minecraft Wiki, Chest (27 slots; a large chest 54) and Shulker Box (27 slots), https://minecraft.wiki/w/Chest and https://minecraft.wiki/w/Shulker_Box (retrieved 2026-10-05)"
    },
    {
      "given": {
        "n": 1728,
        "s": "64"
      },
      "expect": {
        "summary": "27 stacks",
        "stacks": 27,
        "rest": 0,
        "slots": 27,
        "shulkers": 1,
        "doubles": 1
      },
      "source": "hand calculation in content.mdx: 27 × 64 = 1,728; Minecraft Wiki, Chest (27 slots; a large chest 54) and Shulker Box (27 slots), https://minecraft.wiki/w/Chest and https://minecraft.wiki/w/Shulker_Box (retrieved 2026-10-05)"
    },
    {
      "given": {
        "n": 100,
        "s": "16"
      },
      "expect": {
        "summary": "6 stacks + 4",
        "slots": 7,
        "shulkers": 1
      },
      "source": "hand calculation in content.mdx: 6 × 16 = 96; Minecraft Wiki, Item: most items stack to 64, some (ender pearls, snowballs, eggs, signs, buckets of snow) to 16, and tools, armor and potions do not stack, https://minecraft.wiki/w/Item (retrieved 2026-10-05)"
    },
    {
      "given": {
        "n": 100000,
        "s": "64"
      },
      "expect": {
        "summary": "1,562 stacks + 32",
        "slots": 1563,
        "shulkers": 58,
        "doubles": 29
      },
      "source": "hand calculation in content.mdx: 1,563 ÷ 27 = 57.9, 1,563 ÷ 54 = 28.9; Minecraft Wiki, Chest (27 slots; a large chest 54) and Shulker Box (27 slots), https://minecraft.wiki/w/Chest and https://minecraft.wiki/w/Shulker_Box (retrieved 2026-10-05)"
    }
  ],
  "sources": [
    "Minecraft Wiki, Item: stack sizes of 64, 16 and 1. https://minecraft.wiki/w/Item (retrieved 2026-10-05)",
    "Minecraft Wiki, Chest: 27 slots, a large chest 54. https://minecraft.wiki/w/Chest (retrieved 2026-10-05)",
    "Minecraft Wiki, Shulker Box: 27 slots. https://minecraft.wiki/w/Shulker_Box (retrieved 2026-10-05)"
  ],
  "related": [
    "nether-portal",
    "kd",
    "osrs-combat"
  ],
  "changelog": []
}
