Curious Minds

Clear answers to science and history questions

Why Is the Same File a Different Size in Different Places?

· 6 min read · Science

The same file can show a different size in different places because of three main reasons: the file system's allocation unit (cluster) size, whether the size shown includes overhead or metadata, and differences in how binary vs. decimal units (GiB vs. GB) are reported. In short, the "size" you see is not always the exact byte count of the file's content—it can be rounded up, include extra data, or be displayed in different units.

What Exactly Is File Size?

At its core, a file's size is the number of bytes it occupies. A byte is 8 bits, and each character in a text file typically takes 1 byte. However, the way operating systems and file managers present that number varies. For example, a text file containing the word "hello" is 5 bytes. But when you view it in Windows Explorer, it might show as 5 bytes, or as 4 KB, or as 5 bytes (5 bytes) depending on the view settings. The discrepancy arises because the file system stores data in blocks, and the "size on disk" is different from the "actual size."

File System Allocation Units (Cluster Size)

Most file systems (NTFS, APFS, ext4, FAT32) divide the storage into fixed-size blocks called clusters or allocation units. A file is stored in whole clusters, even if it doesn't fill the last one. For example, on a typical NTFS drive with a 4 KB cluster size, a 5-byte file still occupies 4 KB on disk. The "size on disk" reflects this allocated space, while the "size" column shows the logical byte count. So the same file might appear as 5 bytes in one place (logical size) and 4 KB in another (size on disk).

Binary vs. Decimal Units (GiB vs. GB)

Another common cause is the difference between binary and decimal units. Hard drive manufacturers and some operating systems use decimal (base 10) units: 1 KB = 1,000 bytes, 1 MB = 1,000,000 bytes. Other systems, particularly Windows, use binary (base 2) units: 1 KiB = 1,024 bytes, 1 MiB = 1,048,576 bytes. So a file that is exactly 1,000,000 bytes may be shown as 1 MB (decimal) or 977 KiB (binary). This is why you might see a file as 1.0 MB in one app and 977 KB in another.

Metadata, Overhead, and Hidden Data

Some file systems store additional information along with the file, such as extended attributes, access control lists, or resource forks (on macOS). This metadata is not part of the file's content but is stored in the same directory entry or inode. When you copy a file to a different file system, that overhead may be included or excluded, changing the reported size. For example, copying a file from an NTFS drive to a FAT32 drive might drop NTFS-specific metadata, making the file appear smaller.

Compression and Deduplication

File systems like NTFS support transparent compression, and some storage systems use deduplication or thin provisioning. When compression is enabled, the file's logical size remains the same, but the actual storage used is smaller. The "size on disk" might reflect the compressed size, while the "size" shows the uncompressed size. Similarly, deduplication can make a file occupy less physical space than its logical size, but the reported size may still be the logical size.

How to Check the True Size

To avoid confusion, you can check the exact byte count using command-line tools. On Windows, use dir or fsutil to see both logical and physical sizes. On macOS/Linux, use ls -l for logical size and du -h for disk usage. For example, ls -l file.txt shows the number of bytes, while du -h file.txt shows the disk usage including cluster rounding. These tools give you the precise numbers, so you can compare them across systems.

Common Problems and Misconceptions

A frequent misconception is that a file's size should be identical everywhere. In reality, it's normal for the same file to show different sizes due to the factors above. For instance, a 100 MB video file might show as 100 MB in your cloud storage app (which uses decimal), but as 95.4 MB in Windows Explorer (which uses binary). Another problem is when copying files to a USB drive formatted with FAT32, which has a 4 GB maximum file size limit—a file larger than that will fail to copy, even if it fits on the source drive.

How to Choose the Right View

If you need to compare file sizes accurately, use the byte count (the "Size" column in most file managers, but check the units). For disk space planning, use "Size on disk" because it reflects actual storage consumption. When sharing files, the logical size is what matters for transfer time and bandwidth. Always be aware of the unit system: most modern operating systems now use binary units but label them as KB/MB/GB, which can be misleading. For precise work, use tools that show bytes or use the IEC standard (KiB, MiB, GiB).

Frequently Asked Questions

Why does a file show a different size after copying to a USB drive?

Because the USB drive likely uses a different file system (e.g., FAT32 vs. NTFS) with a different cluster size. The logical size remains the same, but the "size on disk" may differ. Also, if the USB drive is smaller than the file, the copy will fail.

Why does my file show 1 MB in one app and 0.98 MB in another?

That's the binary vs. decimal difference. 1 MB (decimal) equals 1,000,000 bytes, which is approximately 0.95 MiB (binary). Many apps use decimal, while Windows uses binary. So the same file can be 1.0 MB (decimal) or 0.98 MiB (binary).

What is the difference between "Size" and "Size on disk"?

"Size" is the logical number of bytes in the file. "Size on disk" is the actual space occupied on the storage device, including cluster rounding and metadata. For small files, the size on disk can be much larger than the logical size.

Can I reduce the size on disk without changing the file?

Yes, by using a file system with a smaller cluster size, or by enabling compression. For example, NTFS compression can reduce the size on disk for text files and other compressible data, but it may slow down access. Alternatively, you can store the file in an archive like ZIP, but that changes the file itself.

Why does a folder size differ between Windows and macOS?

Because each operating system uses different units (binary vs. decimal) and may include different metadata in the folder size calculation. Also, hidden files like .DS_Store on macOS or desktop.ini on Windows can add to the total.

Is there a way to see the exact byte count of a file?

Yes, use command-line tools: stat -c %s filename on Linux, stat -f %z filename on macOS, or dir on Windows (it shows bytes). You can also use file properties in most file managers, but check the units—some show bytes by default.

In this article
  1. What Exactly Is File Size?
  2. File System Allocation Units (Cluster Size)
  3. Binary vs. Decimal Units (GiB vs. GB)
  4. Metadata, Overhead, and Hidden Data
  5. Compression and Deduplication
  6. How to Check the True Size
  7. Common Problems and Misconceptions
  8. How to Choose the Right View
  9. Frequently Asked Questions