Type-in tool

Disk image size calculator

Type in a disk's geometry, or a SCSI drive's block count and block size, and get the raw image size in bytes and in both decimal and binary units.

Listing 1

Disk image size

What do you know?

The "1.44 MB" example uses 80 cylinders, 2 heads, 18 sectors and 512 bytes, the PC 3.5-inch high-density format (source 1).

READY. Type the numbers and press RUN.

The formula

bytes = cylinders × heads × sectors per track × bytes per sector

bytes = block count × block size

Worked example: 80 × 2 × 18 × 512 = 1,474,560 bytes, the size of a raw 1.44 MB PC disk image. The geometry (80 tracks per side, 2 heads, 18 sectors, 512 bytes per sector) is the PC 3.5-inch high-density format listed in source 1. Divide by 1,000 for kB or 1,000,000 for MB (decimal units), and by 1,024 for KiB or 1,048,576 for MiB (binary units).

What the result assumes

Units

kB and MB are decimal: 1 kB is 1,000 bytes and 1 MB is 1,000,000 bytes. KiB and MiB are binary: 1 KiB is 1,024 bytes and 1 MiB is 1,048,576 bytes. The familiar "1.44 MB" floppy figure mixes the two: 1,474,560 bytes is 1.44 × 1,000 × 1,024 bytes.

Sources

  1. pc_dsk.cpp, PC disk image format table, row "1440K 3 1/2 inch high density", MAME project (18 sectors, 80 tracks per side, 2 heads, 512 bytes per sector)
  2. Metric (SI) Prefixes, National Institute of Standards and Technology (NIST), for kB, MB, GB and the zettabyte; and Prefixes for binary multiples, NIST, for KiB, MiB and GiB
  3. sg_readcap(8) manual page, sg3_utils project (READ CAPACITY reports the last logical block address and the logical block size)