Measuring storage and calculating file sizes Cambridge IGCSE Computer Science (9–1) revision

Not started

Learn it

In plain words

Storage is measured in bits and bytes, and then in units that go up by 1024 each time. The names look odd at first, but they follow a pattern: kibi, mebi, gibi, tebi.

Why 1024 and not 1000? Because 1024 is a power of 2 (2 multiplied by itself ten times), and everything in a computer is built on powers of 2.

6 things to know

  1. A bit is a single 1 or 0. A nibble is 4 bits. A byte is 8 bits.
  2. 1 kibibyte (KiB) = 1024 bytes. 1 mebibyte (MiB) = 1024 KiB. 1 gibibyte (GiB) = 1024 MiB.
  3. The pattern carries on: 1 tebibyte (TiB) = 1024 GiB, 1 pebibyte (PiB) = 1024 TiB, 1 exbibyte (EiB) = 1024 PiB.
  4. To change to a larger unit, divide. Bits to bytes: ÷ 8. Then ÷ 1024 for each step up.
  5. To change to a smaller unit, multiply by the same numbers.
  6. Image file size = width × height × colour depth. Sound file size = sample rate × resolution × seconds. Both come out in bits.

Worked example

An image is 2048 pixels by 1024 pixels with a colour depth of 8 bits. Calculate its file size in mebibytes.

  1. Bits = 2048 × 1024 × 8.
  2. Divide by 8 for bytes: 2048 × 1024 bytes.
  3. Divide by 1024 for kibibytes: 2048 KiB.
  4. Divide by 1024 for mebibytes: 2 MiB.

Tips and tricks

  • Use 1024, never 1000, and give the answer in the unit the question asks for.
  • Leave the multiplication unfinished and cancel as you go. The numbers are chosen so that the 8 and the 1024s divide out neatly.
  • The order from small to large: bit, nibble, byte, KiB, MiB, GiB, TiB, PiB, EiB.
6 questions, about 2 minutes.

It lands in your notebook with its questions as flashcards.

Measuring storage and calculating file sizes: 6 questions and answers

These are the quiz’s questions. Do the quiz first, then come back here for the ones that got you.

  1. How many bits are there in a byte?
    • 2
    • 4
    • 8 (the answer)
    • 1024

    And half a byte, 4 bits, is a nibble.

  2. What is a nibble?
    • 2 bits
    • 4 bits (the answer)
    • 8 bits
    • 1024 bits

    One hexadecimal digit is exactly one nibble.

  3. How many bytes are there in a kibibyte?
    • 8
    • 1000
    • 1024 (the answer)
    • 1 000 000

    Each unit is 1024 of the one below.

  4. Which list is in order from smallest to largest?
    • MiB, KiB, GiB, TiB
    • KiB, MiB, GiB, TiB (the answer)
    • KiB, GiB, MiB, TiB
    • TiB, GiB, MiB, KiB

    Kibi, mebi, gibi, tebi.

  5. How many kibibytes are there in 3 mebibytes?
    • 3000
    • 3024
    • 3072 (the answer)
    • 3 000 000

    3 × 1024 = 3072.

  6. A file is 16 384 bits. What is its size in kibibytes?Stretch
    • 2 (the answer)
    • 8
    • 16
    • 2048

    16 384 ÷ 8 = 2048 bytes, and 2048 ÷ 1024 = 2 KiB.

Still stuck on this one?Ask in the Papermunch Discord, or help someone else who is. Discord is for ages 13 and up.Join the server

Things you can type

Or go straight to

Or browse a shelf