File size is determined by how much information is stored and how efficiently it is encoded. Uncompressed, the math is brutally simple: a 12-megapixel photo at 24-bit color holds 12,000,000 pixels x 24 bits / 8 = 36,000,000 bytes, or 36 MB. Compression shrinks this — JPEG typically to 3 to 6 MB for that photo, a 6:1 to 12:1 ratio — by discarding information the eye barely notices. Video follows bitrate: file size = bitrate x duration / 8, so a 2-hour movie encoded at 8 Mbps is 8 x 7,200 / 8 = 7,200 MB, or 7.2 GB.
Audio is the same idea at smaller scale: CD-quality audio runs 1,411 kbps (44,100 samples x 16 bits x 2 channels), which is about 10.6 MB per minute; a 128 kbps MP3 compresses that to under 1 MB per minute. Text is tiny by comparison — a 300-page novel as plain text is roughly 1 MB, which is why e-book libraries feel weightless next to photo collections. Modern codecs (H.265/HEVC for video, Opus for audio) roughly halve sizes versus their predecessors at equal quality, so the codec matters as much as the settings.
Practical uses: sizing cloud storage (a year of phone photos at 4 MB each, 5 per day, is 7.3 GB), choosing video export settings (halving the bitrate halves the file), and understanding why a '128 GB' phone fills up — the OS, apps, and a few 4K videos at 400 MB per minute consume it faster than the number suggests. This calculator estimates sizes from dimensions, bitrates, and durations.