Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Why does the Finder show a file as "129,900 bytes (131 KB on disk)"?

129900 bytes = 126.86 KB

If you round it off to the nearest 4k boundary the size cannot be 131kb. I am confused, can anyone help?

share|improve this question
Are you sure your disk is using 4KB clusters? – Ƭᴇcʜιᴇ007 Jan 28 '12 at 5:33
@techie007, since he said he's on a Mac, and Macs usually use HFS+ volumes, which use 4KiB blocks nowadays, the answer is probably "yes". BTW "clusters" is a Microsoftism which applies to FAT and NTFS. HFS+ uses the term "logical block" or just "block". – Spiff Jan 28 '12 at 6:27
up vote 5 down vote accepted

No, that's correct.

128KiB = 131072B = 131kB

share|improve this answer

Apple chose to stop using Kibi/Mebi/GibiBytes (1,024's, 1,048,576's, and 1,073,741,824's of bytes) in displaying file sizes in recent versions of Mac OS X. As of Lion and possibly Snow Leopard, it reports things in true kilo/mega/gigaBytes (1,000's, 1,000,000's, and 1,000,000,000's of bytes)

You're right that HFS+ typically uses 4096 byte blocks nowadays. So if your file is a little over 126,976 bytes in length, it won't fit in 31 blocks, so it'll use part of a 32nd block, so in some cases where just the blocks used are counted instead of the exact size of file, it may be listed as being 131,072 (rounded to 131KB) in length.

share|improve this answer
i have a small code to display the size,how would i write code – Manish Jan 28 '12 at 6:24
@Manish I can't understand what you're asking with that comment. – Spiff Jan 28 '12 at 6:30
sorry, it committed in middle. – Manish Jan 28 '12 at 6:35

31 4KiB clusters is 126,976 bytes. Not enough to hold the 129,900 bytes. 32 4KiB clusters is 131,072 bytes. That's enough to hold the 129,900 bytes. So it's using 32 4KiB clusters, or 128KiB which is 131,072 bytes or about 131KB.

share|improve this answer

The size of the file is 129900 bytes = 126.86 KB. The amount of space it is using on your hard drive is 131KB. To put it in simple terms.. This happens because your file system on the hard drive has several clusters. Each cluster may be only a few kilobytes. However, when the file is written to the hard drive, it may not use up a full cluster. Even if it did not use up a full cluster, that memory is essentially unavailable.

share|improve this answer
I believe "clusters" is a term from the FAT file system family that doesn't apply to HFS+. Of course he could be talking about a file on a FAT-formated drive, but it's not likely. – Spiff Jan 28 '12 at 6:21
129,900 bytes may be 126.86KiB, but it's 129.9KB. The difference matters here because we're talking about sizes on disk. – David Schwartz Jan 28 '12 at 7:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .