ArrayKit

Compress Image to a Target Size

Type a size such as 50 KB, 100 KB or 2 MB and the tool finds the highest JPEG or WebP quality that still fits under it — on your device, with nothing uploaded.

Compress Image to a Target Size

Type a size such as 50 KB, 100 KB or 2 MB and the tool finds the highest JPEG or WebP quality that still fits under it — on your device, with nothing uploaded.

Every attempt is encoded in your browser. Your photos, which often include identity documents, are never uploaded, and the result carries no EXIF or location data.

Set the pixel size first with the Image Resizer

About Compress Image to Size

Upload forms, job portals and exam sites publish a hard ceiling — 20 KB for a signature, 50 KB for a photo, 200 KB for a scan — and reject a file that is even a few bytes over. There is no formula from a byte limit to a quality setting, because the same slider position gives very different sizes for different pictures. So this tool searches: it encodes the photo, measures the result and narrows the quality range until it finds the highest quality that still fits. If even the lowest quality is too large, it shrinks the picture as well, but never below a minimum share of the original size that you control. Every result shows its size, quality and scale, and a photo that is already under the limit is re-saved without growing.

Features

  • Presets for 20 KB, 50 KB, 100 KB, 200 KB, 500 KB, 1 MB and 2 MB, plus any custom value in KB or MB
  • Searches for the highest quality that fits instead of guessing at a setting
  • Shrinks the picture too when quality alone cannot reach the target, within a minimum size you set
  • Optional longest-side limit applied before the search starts
  • Saves as JPEG, or WebP where the browser can write it
  • Live progress shows the quality and size of each attempt, with Cancel between attempts
  • Before and after previews with the exact size, quality and scale for every photo
  • Works through many photos in turn and packs the results into one ZIP

How to use the Compress Image to Size

  1. Drop, choose or paste your photos
  2. Pick a target size, or type your own and choose KB or MB
  3. Watch the search narrow in on the quality that fits
  4. Check the size, quality and scale on each card, then download one photo or the ZIP

Example

Input

passport.jpg — 2.4 MB
Target: 50 KB · save as JPEG

Output

passport.jpg 2.4 MB → 49.6 KB (target 50 KB) · quality 58 % · 82 % scale

Quality alone could not reach 50 KB, so the picture was also scaled to 82 % of its original size.

Common errors & troubleshooting

  • It says it could not reach the target. — The limit is below what the picture can reach at the minimum size you allow. Lower the Never below percentage, resize the photo smaller first, or raise the target.
  • The photo looks blurry or blocky. — A very small target forces a low quality or a small picture. Choose the largest limit the form allows; a 20 KB file is a thumbnail-sized image.
  • A PNG's transparent background turned white. — PNG is converted to JPEG, which cannot be transparent, so see-through areas are filled with white. Choose WebP if the form accepts it.
  • The form still rejects a file that is under the limit. — Some forms count a kilobyte as 1,000 bytes and others as 1,024. Aim a little below the limit, and check whether the form also fixes the pixel dimensions.

Frequently asked questions

How does Compress Image to Size find the quality that fits my limit?
It encodes the photo at a high quality, measures the file, and narrows the quality range from both sides until the result lands just under your target. If even the lowest quality is too big, it reduces the picture size and searches again.
Why is my PNG converted to JPEG when I compress it to a size?
PNG is lossless, so lowering a quality setting does not shrink it — only fewer pixels would. JPEG and WebP trade tiny losses of detail for a much smaller file, which is what a byte target needs. Transparent areas turn white in a JPEG.
What happens if the target size is too small for my image?
The tool tries the lowest quality, then shrinks the picture down to the minimum share you allow. If it still cannot fit, it says so and offers the smallest result it made. Lower the minimum, raise the limit or resize the photo first.
Should I choose JPEG or WebP for the compressed image?
JPEG is accepted by virtually every upload form and viewer. WebP usually reaches the same quality at a smaller size and can keep transparency, but some portals refuse it. Use JPEG unless you know WebP is allowed.
Does compressing a photo here keep its EXIF and location data?
No. The photo is drawn and saved again, which drops EXIF metadata such as camera model, capture time and GPS position. The picture itself is kept as closely as the target allows.
What file sizes do government, exam and job forms usually ask for?
It varies, so read the form's instructions. Signatures are often limited to around 20 KB, passport-style photos to about 50 KB, and scanned documents to 100 to 500 KB or a couple of megabytes. Set the pixel size first if the form requires one.

Related tools

  • Image Resizer — Resize photos by pixels, percentage, preset or longest side — in batches, with a ZIP download.
  • Image Optimizer — Re-encode and shrink images (JPEG/WebP/PNG), optionally resizing.
  • Image Format Converter — Convert images between PNG, JPEG and WebP entirely in your browser.
  • Compress PDF to Size — Bring a PDF under an exact byte target such as 100 KB, 200 KB or 2 MB.
  • Passport Photo Maker — Crop a photo to passport and ID sizes and lay out a print-ready sheet of copies.
  • Base64 Image Encoder / Decoder — Convert images to Base64 Data URIs with ready-made HTML and CSS snippets, or decode a Data URI back to a downloadable image.
  • EXIF Viewer & Remover — View and strip EXIF metadata (including GPS) from photos — nothing is uploaded.

More Images tools

  • Image Optimizer — Re-encode and shrink images (JPEG/WebP/PNG), optionally resizing.
  • Image Format Converter — Convert images between PNG, JPEG and WebP entirely in your browser.
  • EXIF Viewer & Remover — View and strip EXIF metadata (including GPS) from photos — nothing is uploaded.
  • Base64 Image Encoder / Decoder — Convert images to Base64 Data URIs with ready-made HTML and CSS snippets, or decode a Data URI back to a downloadable image.
  • App Icon Generator — Turn one image into every iOS, macOS and Android app icon size — downloaded as a ZIP, in your browser.
  • Sprite Sheet CSS Animation Generator — Turn a sprite sheet into a copy-paste CSS @keyframes animation using steps(), with a live preview.
  • SVG to PNG Converter — Convert SVG to PNG or JPG at any scale, with a transparent or solid background, in your browser.
  • Image Color Picker — Upload an image and pick colors from any pixel to get HEX, RGB and HSL values, in your browser.
  • Color Format Converter — Convert a color across HEX, RGB, HSL, HWB, LAB, LCH and OKLCH with a live swatch.
  • Barcode Generator — Generate EAN, UPC, Code 128 and Code 39 barcodes and download them as SVG or PNG.
  • Image Color Palette Extractor — Extract a dominant color palette from an image as HEX, RGB and HSL with CSS variables.
  • Flip & Rotate Image — Rotate by 90° and flip images horizontally or vertically, then download — in your browser.
  • Image Cropper — Crop an image to any area or fixed aspect ratio and download it, in your browser.
  • Image Watermark — Add a text or logo watermark to an image, anchored or tiled, with opacity and rotation.
  • Blur & Redact Image — Permanently blur, pixelate or black out parts of a screenshot before sharing it.
  • Round Image Corners — Clip photos to rounded rectangles or circles and export PNGs with transparent corners.
  • Color Blindness Simulator — See any image the way people with protanopia, deuteranopia or tritanopia see it.
  • Image DPI Changer — Set a PNG or JPEG’s DPI for print without recompressing a single pixel.
  • BlurHash Generator — Turn an image into a BlurHash string, and decode any hash back to a preview.
  • Placeholder Image Generator — Make placeholder images at any size, as SVG, PNG or a data URI.
  • ASCII Art Generator — Convert any image into ASCII art, with character sets, contrast and invert.
  • Image Filters — Apply grayscale, sepia, contrast, blur and more, then export the PNG and the CSS.
  • Image Splitter — Cut a picture into a grid of tiles and download them as a ZIP.
  • Image Merger — Combine images side by side, stacked or in a grid, with gaps and a background.

See all Images tools (35) · All tools