60

Until now I believed that 1024 bytes equals 1 KB (kilobyte) but I was reading on the internet about decimal and binary system.

enter image description here

So, actually 1024 bytes = 1 KB would be the correct way to define or simply there is a general confusion?

SamYan
  • 1,553
  • 1
  • 19
  • 38
  • 4
    Afaik the kilo, mega, giga, tera prefixes predate the information age and are powers of 10. I would trust the Wikipedia that to make a difference the shortcuts for powers of 2 are Ki, Mi and so on. – Harald Nov 06 '13 at 18:28
  • 1
    There is somewhat of a general confusion, but in some contexts it is clear; if you buy 4GB of RAM it's 4^32 bytes, since they don't make it any other way. Not so clear for disk drives or flash drives - but in those there's also 'loss' due to formatting overhead and so forth. So it's all mushy anyway. – greggo Nov 07 '13 at 16:25
  • 1
    Operating systems use the SI notation but mean IEC. Just check the file properties of any file in windows. I think Scientific Notation on memory sizes is the infraction since the industry always used 1024 as far as I know. @They predate the information age, but the information age has final say as to what disk sizes mean!\ – Menelaos Jul 20 '16 at 12:50
  • Personally, I think we should have stuck with base 2 for storage size / transfer rates. For highly technical people and programmers, 1 kB = 1,024 bytes makes MUCH more sense since in computing everything is in base 2 anyway, and 1024 can conveniently be expressed as 0x400. For non-technical people, the difference is totally irrelevant anyway so they wouldn't care. – antred Mar 30 '17 at 09:04

4 Answers4

54

What you are seeing is a marketing stunt. Since non-technical people don't know the difference between Metric Meg, Gig, etc. against the binary Meg, Gig, etc. marketers for storage will use the Metric calculation, thus 1000 Bytes == 1 KiloByte.

This can cause issues with development or highly technical people so you get the idea of a binary Meg, Gig, etc. which is designated with a bi instead of the standard combination (ex. Mebibyte vs Megabyte, or Gibibyte vs Gigabyte)

RocketSpock
  • 2,031
  • 16
  • 11
  • 11
    Exactly, that's what I think. But the funniest thing is that this confusion exists among many programmers, including me until now. Every day you learn something. Thanks for response. – SamYan Nov 06 '13 at 18:33
  • 1
    I agree, I was the same way for a long time. – RocketSpock Nov 06 '13 at 18:35
  • 2
    Marketing stunt by people who don't comprehend how many problems you create when you try to taking one of the most fundamental constants in computer science and try fudging it. – Nosajimiki Sep 05 '17 at 21:36
29

There are two ways to represent big numbers: You could either display them in multiples of 1000 (base 10) or 1024 (base 2). If you divide by 1000, you probably use the SI prefix names, if you divide by 1024, you probably use the IEC prefix names. The problem starts with dividing by 1024. Many applications use the SI prefix names for it and some use the IEC prefix names. But it is important how it is written:

Using IEC standard:
1 KiB = 1,024 bytes (Note: big K)
1 MiB = 1,024 KiB = 1,048,576 bytes

Using SI standard:
1 kB = 1,000 bytes (Note: small k)
1 MB = 1,000 kB = 1,000,000 bytes

Source: ubunty units policy: https://wiki.ubuntu.com/UnitsPolicy

darpet
  • 3,073
  • 3
  • 33
  • 40
  • 1
    It should be added that MANY tools and many people still use kB to mean 1024 bytes. So even though 1000 is in a sense the "correct" usage (whatever that means), it is likely to cause confusion. – jforberg Mar 09 '16 at 22:16
  • This post benefited from the summary of the official linked documentation. – mbigras Dec 19 '18 at 21:36
8

In the normal world, most things go by the power of 10. This would include electricity, for example.

But, in the computer world, it is about half binary. For example, when they sell a hard drive, they sell it by the value of 10, so if it is a 1KB drive, then it is 1000 B. But, when the computer reads it, the OS's usually read by the value of 1024. This is why, when you read the size of space available on a drive, it reads much less then what it was advertised. A 500 GB drive will read only about 466GB, because the computer is reading the drive by the binary 1024 version. Not the power of 10 that it was sold and advertised by. Same will go with flash drives. But, RAM is sold, and read by the computer, by the Binary 1024 version.

One thing to note.. It is "B", not "b". There are 8 bits "b" in a Byte "B". The reason I bring this up is when you get internet service, they usually advertise the speed by bits, not bytes. When it reads in the download box on the computer, it reads the speed in bytes. Say you have a 50Mb internet connection, it is actually 6.25MB connection in the download speed box, because you have to divide the 50 by 8 since there are 8 bits in a byte. That is how the computer reads it. Another marking strategy too. After all, 50Mb sounds much faster then 6.25MB. Other then speeds through a network, most things are read by bytes "B". Some people do not realize that there is a difference between the "B" and "b".

Gaurav Jeswani
  • 4,410
  • 6
  • 26
  • 47
Kaniki
  • 89
  • 1
  • 1
-1

Quite simple...

The word 'Byte' is a computing reference for which the letter 'B' is used as abbreviation. It must follow then that any reference to Bytes, eg. KB, MB etc, must be based on the well known and widely accepted 1024 base. Therefore 1KB must equal 1024 Bytes, 1MB must equal 1048576 Bytes (1024x1024) etc.

Any non-computing reference to Kilo/Mega etc. Is based on the decimal 1000 base, eg. 1KW or 1KiloWatt which is 1000 Watts.

William
  • 27
  • It was simply wrong to use the prefix kilo to mean anything other than 1000. Once it caught on it's hard to get people away from it. I'm not going to be saying 'kibibyte', it's sound like something that that should be fed to a cat. – Paul McCarthy Oct 04 '21 at 11:56