PhotoFit

PhotoFit / Guides

KB vs KiB: why a file just under the limit can still fail

Two definitions of a kilobyte are in common use. Storage makers and many websites use 1 KB = 1000 bytes. Windows, and many programmers, use 1 KB = 1024 bytes (strictly, a kibibyte, or KiB). The difference is 2.4 percent, which is enough to turn a pass into a fail.

An example

A form says "maximum 50 KB". A file of 51,000 bytes shows as 49.8 KB in a file manager that uses 1024, so it looks fine. A portal that counts in 1000s sees 51 KB and refuses it.

The minimum has the same problem in reverse

A form says "minimum 20 KB". A file of 20,100 bytes is 20.1 KB in 1000s but only 19.6 KB in 1024s, and a portal that counts in 1024s may refuse it as too small.

How to stay safe

  • Stay under the maximum counted in 1000s, with a small margin.
  • Stay over the minimum counted in 1024s, with a small margin.

PhotoFit does this automatically. For a 20 to 50 KB window it aims for roughly 20.9 to 49.2 thousand bytes, which passes under either definition.

What if the window is very narrow?

With a window like 10 to 10.5 KB, no file can satisfy both definitions. The tool then picks the safest size inside the window and tells you.

Open the resizer