WipeMark

Sponsored

Advertise

KB vs KiB: Why a '20 KB' File Gets Rejected by Upload Forms

A 20 KB limit can mean 20,000 or 20,480 bytes. Why your computer and the form disagree, how to read a file's real size, and the size that passes both.

By the WipeMark team6 min read

Key takeaways

  • A kilobyte is 1,000 bytes in the decimal (SI) system and 1,024 bytes in the binary one, which standards call a kibibyte (KiB). Software uses both and labels both "KB".
  • So a "20 KB" limit is 20,000 bytes on one site and 20,480 on another. Files between the two pass one and fail the other.
  • Windows File Explorer counts 1,024 bytes a KB; Apple says OS X Leopard and earlier did too, while current Macs show decimal sizes. The same file can look different on two computers.
  • For a maximum, stay under the limit × 1,000 bytes. For a minimum, stay over the limit × 1,024. Then the file passes however the form counts.
  • The exact size in bytes is always in the file's properties (Windows) or Get Info (Mac). Use that number, not the rounded one.

You resize a photo to 20 KB, your computer says 19.8 KB, and the upload form still says it is over the limit. Nothing is broken. You and the form are counting kilobytes differently, and the difference is 24 bytes per kilobyte, which is 480 bytes on a 20 KB file. This guide explains the two ways of counting, how to read a file's real size, and the one rule that makes a file pass every form: aim for the stricter number.

Two kilobytes

In the metric system, kilo means a thousand: a kilogram is 1,000 grams, a kilometer 1,000 meters. By that rule a kilobyte is 1,000 bytes, and that is how the International System of Units defines it.

Computers, though, count memory in powers of two, and 2¹⁰ is 1,024, close enough to 1,000 that early software borrowed the word. For decades "1 KB" meant 1,024 bytes in most operating systems and 1,000 in others, and nobody could tell which from the label.

In 1998 the International Electrotechnical Commission (IEC) gave the binary units their own names: a kibibyte (KiB) is 1,024 bytes, a mebibyte (MiB) 1,048,576 bytes. The names exist, and Linux tools often use them, but most everyday software still writes "KB" for both.

UnitDecimal (SI)Binary (IEC)Gap
Kilobyte1 kB = 1,000 bytes1 KiB = 1,024 bytes2.4%
Megabyte1 MB = 1,000,000 bytes1 MiB = 1,048,576 bytes4.9%
Gigabyte1 GB = 1,000,000,000 bytes1 GiB = 1,073,741,824 bytes7.4%

The gap grows with every step up, which is why a new hard drive "loses" space when you plug it in: the box counts in decimal, the computer in binary.

Why your computer and the form disagree

Windows File Explorer shows file sizes counting 1,024 bytes a KB, and labels them KB. A file of 20,480 bytes shows as exactly 20 KB.

Macs have changed. Apple's support page on how storage is measured names "OS X Leopard and earlier" among the systems that use the binary count; current macOS shows sizes in decimal. So the same file can read 20 KB on a Windows PC and 20.5 KB on a Mac.

Upload forms are written by whoever built the site, and they use whichever their code uses. Some compare the byte count with 20 × 1,000, others with 20 × 1,024. The page rarely says which. Government rules are usually written in plain words, "240 kB" or "no more than 10MB", without saying which kilobyte they mean.

19,00019,50020,00020,48021,000Safe everywhereDepends on the siteOver everywhere20 KB, 1,000 a KB20 KB (KiB), 1,024 a KBbytes
Where '20 KB' falls on each count. Below 20,000 bytes, every form accepts the file; between 20,000 and 20,480, it depends on the site; above 20,480, every form refuses it.

The rule that always works

You cannot know how a form counts, but you do not need to. Aim for the stricter reading.

For a maximum, use 1,000 bytes a KB. A 20 KB maximum becomes 20,000 bytes. A file of 20,000 bytes or less passes a site counting 1,000 and one counting 1,024.

For a minimum, use 1,024 bytes a KB. A 10 KB minimum becomes 10,240 bytes. A file of 10,240 bytes or more passes both ways.

That is all. The cost is tiny: you give up 480 bytes on a 20 KB file, about 2%, which on a passport-size JPEG is a barely visible step in quality.

Our resizer reads every limit this way, so the number it shows always passes. Try your own file's numbers here:

Will the portal take this file?

That file is 20.30 KB counting 1,000 bytes a KB, or 19.82 KB counting 1,024.

  • A site counting 1,000 bytes a KB Rejected
  • A site counting 1,024 bytes a KB Passes
  • Safe either way Rejected

To be safe, aim for at most 20,000 bytes.

How to read a file's real size

The size a file app shows is rounded and in one of the two units. The byte count is exact.

Windows. Right-click the file, choose Properties. The General tab shows something like "Size: 19.8 KB (20,300 bytes)". The number in brackets is the one that matters.

Mac. Select the file and press Command-I (Get Info). The Size line shows something like "20 KB (20,300 bytes)".

Linux. In a terminal, ls -l file.jpg prints the size in bytes; ls -lh rounds it in binary units.

Phones. Gallery and file apps usually show only a rounded size. If you are close to a limit, check the file on a computer, or use a tool that reports bytes. Our file checker reads the file on your device and shows both the KB and the exact byte count.

Where the numbers show up

A few real rules, quoted from their official sources, and what they mean in bytes:

RuleAs writtenSafe target
DV Lottery photo, U.S. State Department"Equal to or less than 240 kB"At most 240,000 bytes
UK passport photo online, GOV.UK"At least 50KB and no more than 10MB"51,200 to 10,000,000 bytes
Canada citizenship photo online, IRCC"No more than 4 MB"At most 4,000,000 bytes
SBI clerk signature, State Bank of India"Between 10 kb – 20 kb"10,240 to 20,000 bytes

Notice the UK rule: 10 MB is 10,000,000 bytes one way and 10,485,760 the other, a gap of nearly half a megabyte. A large photo straight from a camera can land in that gap.

The DV Lottery photo guide and the photo size rules pages go through each of these in full.

Two worked examples

A DV Lottery photo at 245,000 bytes. On a Windows PC, Explorer divides by 1,024 and shows 239 KB, under the 240 kB limit. The State Department writes "240 kB", the decimal symbol, which is 240,000 bytes. If the entry system compares against 240,000, the photo is 5,000 bytes over. Re-save it a little smaller, at 235,000 bytes say, and it passes on any reading. A 600 × 600 photo has plenty of room: at good quality it is usually well under 150,000 bytes.

A signature that must be 10 KB to 20 KB. The resized signature comes out at 10,100 bytes. Divided by 1,000 that is 10.1 KB, over the minimum; divided by 1,024 it is 9.86 KB, under it. A form that counts in binary will refuse it as too small, while your computer may show "10 KB". Bring it to at least 10,240 bytes, by allowing a slightly larger image if the form permits or by padding, and the problem is gone.

In both cases the file was "fine" by one count and not by the other. The safe targets, 240,000 and 10,240 bytes, make the question irrelevant.

Why minimum sizes exist, and how to meet them

A maximum is easy to understand: a site does not want to store huge files. Minimums surprise people. Forms set them to stop people uploading tiny, blurry thumbnails, especially of signatures and photos, which the site would then have to reject by hand.

The trouble is that a small, clean image, such as a signature on white paper, compresses very well. A 140 × 60 pixel signature can be 4 or 5 KB even at the highest JPEG quality. You cannot make it bigger by raising the quality any further.

There are two honest ways to reach the minimum:

Make the image bigger in pixels, if the form allows it. More pixels means more bytes. Often the form fixes the size, though.

Add padding inside the file. A JPEG can carry comment segments that viewers ignore. Adding empty bytes there makes the file bigger without changing a single pixel of the picture. That is what our resizer does when a file is under your minimum, and it says so on the page. The form checks bytes, and the bytes are there.

What does not work is saving the file again and again at "100%" in an editor: each save re-compresses, the size barely moves, and the quality drops.

MB limits on PDFs and documents

The same gap applies to megabytes, and it is bigger: almost 5%. Many portals cap documents at 1 or 2 MB. A 2 MB limit is 2,000,000 bytes or 2,097,152; a scanned PDF of 2,050,000 bytes passes one and fails the other.

Treat MB like KB: for a maximum, multiply by 1,000,000. If you need to shrink a scan to fit, our PDF compressor measures the whole finished PDF against the limit read that way, and the guide to fitting a PDF under a limit explains what it trades away.

A checklist before you upload

  1. Read the limit on the form, and whether it is a maximum, a minimum or both.
  2. Turn it into bytes the strict way: maximum × 1,000, minimum × 1,024.
  3. Check the file's exact size in bytes in Properties or Get Info.
  4. If it is over, resize or compress until it is under the byte target. If it is under a minimum, add pixels if allowed, or padding.
  5. Check the file type too: a PNG renamed to .jpg is still a PNG, and forms that check the real type will refuse it.

Reads every limit the strict way and shows the exact bytes before you download. Runs in your browser; nothing is uploaded.

Resize a photo now

Questions people ask

Is 1 KB 1,000 or 1,024 bytes?

Both, depending on who is counting. The SI prefix kilo means 1,000, so 1 kB is 1,000 bytes. Since 1998 the IEC has used kibibyte (KiB) for 1,024 bytes, but a lot of software, including Windows, still writes KB for 1,024.

Why does the form say my 20 KB photo is too big?

Your computer probably shows sizes counting 1,024 bytes a KB, so a 20,300-byte file appears as 19.8 KB. If the form counts 1,000 bytes a KB, its limit is 20,000 bytes and the file is 300 bytes over. Make the file smaller than 20,000 bytes.

How do I see the exact size of a file in bytes?

On Windows, right-click the file and choose Properties; Size shows the bytes in brackets. On a Mac, select it and choose Get Info; the size line shows the bytes. On a phone, file apps usually show only a rounded size, so check on a computer or with a tool that reports bytes.

What size should I aim for to be safe?

For a maximum of N KB, aim for at most N × 1,000 bytes; for a minimum, at least N × 1,024 bytes. A 20 KB maximum becomes 20,000 bytes and a 10 KB minimum becomes 10,240 bytes.

Does it matter for MB limits too?

Yes, and more: 1 MB is 1,000,000 bytes or 1,048,576 bytes, a gap of almost 5%. A 2 MB upload limit can be 2,000,000 or 2,097,152 bytes. Stay under the decimal figure.

Resize to the exact KB

Free, no sign-up. Runs on your device; nothing is uploaded.

Try WipeMark free

Keep reading