Skip to content
Tejo Tools
Search
Menu

How to resize an image to 20 KB or any size limit

Bring a photo under an upload form’s KB limit by making it smaller in pixels, without guessing.

Last updated

Open Resize images

Why upload forms cap the size in KB

Application forms, exam portals and job sites often take a photo or a scanned signature only when its file is under a stated size, written as a number of KB. A site that receives a great many uploads keeps each one small so that it arrives quickly over a slow connection and takes little room to store. A photo straight from a phone camera is far larger than such a cap, so the form turns it away until the file is made smaller.

A form photo rarely needs all the detail a camera records. A face or a signature stays clear at a fraction of the camera’s width, so making the picture smaller in pixels is often enough on its own.

What a KB is

KB stands for kilobyte. The tools on this site count 1 KB as 1,024 bytes, so a 20 KB limit means at most 20,480 bytes. Some sites count a kilobyte as 1,000 bytes instead, and their 20 KB is 20,000 bytes. A file that ends comfortably under the number passes either way. A file that lands between 20,000 and 20,480 bytes can pass on one site and be refused on another, which explains a form rejecting a file that looked small enough.

What decides an image file’s size

Three things set the size of the file, and each can be changed on its own:

  • Pixels. The width times the height is the number of pixels the file has to describe. Halve both sides and a quarter of the pixels remain. Each example below reaches its limit by changing the pixels alone.
  • Format. JPG and WebP store photos compactly by leaving out fine detail the eye hardly notices. PNG keeps every pixel exactly, which suits logos, screenshots and pictures with transparent areas, but a photo saved as PNG is much larger than the same photo as JPG.
  • Quality. JPG and WebP files have a quality setting. A lower setting leaves out more detail, so the file gets smaller, and at some point blocky patches and smudged edges appear, around text and sharp lines first.

What the picture shows matters too. A plain sky or a white wall takes far less space than leaves, gravel or patterned fabric, so two photos of the same width and height can end up with quite different file sizes. That is why no fixed width gives a fixed number of KB, and why a tool that measures the result is quicker than trial and error.

Two ways to get under the limit

Fewer pixels, the same quality. Resize images has a File size option under Resize by. You type the most KB you allow, and it works out the largest width and height whose file still fits, with the proportions kept and the format unchanged. You can also choose a width yourself and read the size it gives.

The same pixels, a lower quality. Compress images has a File size option too. It lowers the quality first and keeps the width and height while a lower quality alone gets the file under the limit. Only when even quality 30 is too big does it make the picture smaller in pixels as well. In that mode a PNG that already fits is kept as it is, without its metadata, unless a WebP copy is smaller. Any other PNG is saved as WebP.

The two change different things. Compressing keeps the pixel size only as long as a lower quality is enough. Resizing keeps the quality setting and the format, so a JPG stays a JPG and the detail that is left stays crisp.

Worked examples

These examples use the two sample images of Resize images: landscape.jpg, a photo of 2,400 × 1,600 px and 54.5 KB, and badge.png, 320 × 320 px and 50.8 KB with transparent corners. Select Try a sample on the tool to get the same files. Sizes are given as the tool shows them.

A 54.5 KB photo to a 20 KB limit, by file size

Under Resize by, choose File size and enter 20 as the Max size. The photo comes back at about 1,118 × 745 px and about 19.7 KB, so it fits under 20,480 bytes with a little room to spare. Its shape hasn’t changed: 1,118 ÷ 745 is still about 1.5, the 3 : 2 of the original. With 10 in Max size, the same photo becomes about 627 × 418 px and about 9.5 KB.

The same photo, by width

Choose Width under Resize by and type 1200. The photo becomes 1,200 × 800 px and about 22.4 KB, which is still over 20 KB. Type 1000 instead and it becomes 1,000 × 667 px and about 17.2 KB, under the limit. Picking a width works, but it can take a guess or two, and the width that fits may be narrower than it needs to be: 1,000 px against the 1,118 px that File size found for the same limit.

A PNG badge with transparent corners

Add badge.png with File size at 20 KB. It returns as a PNG of about 173 × 173 px and about 19.9 KB, with its corners still transparent. That leaves a little under a third of its pixels. A PNG keeps every pixel exactly and has no quality setting to lower, so pixels are the only thing left to reduce while it stays a PNG.

Step by step

  1. Open Resize images and drop the photo on the box, paste it, or select Choose files.
  2. Under Resize by, choose File size.
  3. Type the form’s limit in Max size, in KB.
  4. Read the new size on the file’s card, then select Download.

When the limit is too small to reach, the card says so instead of saving a file. It names the smallest size it got to and points to Save as WebP under More options, a format that is often smaller for the same picture. If the form takes only JPG, a larger limit or a crop of the picture are the other ways forward.

Checking the result before you upload

Each file’s card shows the new width, height and file size, so the result can be compared with the form’s limit before it is saved. With File size, Resize images never makes a picture larger than it was: a photo that already fits keeps its own pixel size. The saved image is a new file, and the original stays as it was on your device.

Both tools run in your browser, so the photo isn’t uploaded anywhere to be resized or compressed. The new image is made from the pixels alone, so the camera details and any location data in the original are left out.

Tools in this guide