Character sets map characters to codes. Original ASCII defines 128 codes using seven bits; text files often store each ASCII character in a full byte. A = 65, a = 97 and 0 = 48.
Unicode covers many writing systems and emoji. Its encodings differ: UTF-8 uses one to four bytes per code point and preserves ASCII-range byte values; UTF-16 uses one or two 16-bit code units.
Text size depends on the encoding and actual characters. A fixed characters × bits-per-character calculation needs an explicit fixed-width assumption and excludes headers or compression.
Unicode character representation
Images
A bitmap is a grid of pixels. Pixel dimensions are width × height; colour depth is bits per pixel, allowing up to 2depth possible pixel values.
Raw pixel-data size = width × height × colour depth. At 100 × 100 and eight bits per pixel, this is 80,000 bits = 10,000 bytes.
Headers, metadata, padding and compression can change the stored file size. More bits allow more possible colours but cannot recreate absent source detail.
Colour depth and available shades
Sound
Sampling measures an analogue signal at regular intervals; quantisation represents each measured amplitude using an available discrete level. Sample rate is samples per second, and bit depth is bits per sample.
Raw PCM size in bits = sample rate × bit depth × duration × channels, excluding headers and compression. Mono audio at 44,100 Hz, 16 bits and ten seconds needs 7,056,000 bits = 882,000 bytes.
Higher sample rate can capture higher-frequency detail, and greater bit depth permits finer amplitude precision. Neither guarantees audible improvement for every source.
Illustrative 2-bit samples
Trade-offs
Quality versus file size, storage and transmission.
スライド
Sign up free to view the lesson slides
Step through every slide for this topic — plus flashcards and revision notes — with a free account.