Image Resizer KB
Compress a JPG, PNG or WebP image to fit a target size in KB. The tool runs a binary search on quality, then shrinks the dimensions if quality alone is not enough. The original and the result appear side by side.
Key features
- Resize images to a specific file size in KB
- Binary search on quality, up to 15 tries per image
- Side-by-side preview of original and compressed images
- Supports JPG, PNG, and WebP formats
- All processing in your browser - no uploads
Guide
This tool resizes an image to meet an exact file size target measured in kilobytes. You specify a target like 100 KB, 200 KB, or 50 KB, and the tool lowers the compression quality, then the image dimensions if needed, until the file fits under your target. If even the smallest version is too large, the tool shows the closest size it reached with a warning. The processing happens entirely in your browser using the Canvas API. No image data is uploaded to any server. The compression worker loads its script from the jsDelivr CDN, but your image stays on your device.
Why target a specific file size. Many systems impose strict file size limits on uploaded images, and these limits are enforced by server-side validation that rejects files even 1 byte over the threshold. Government visa application portals often require a photograph between 50 KB and 100 KB. Job application sites may cap profile photos at 200 KB. Email signature images are typically kept under 50 KB to avoid bloating every sent message. University enrollment systems, insurance claim forms, online exam portals, professional licensing boards, and healthcare patient registration systems all have their own limits.
The frustration of manual file size targeting is well known. You open an image editor, export at quality 80, check the file size. It is 145 KB. You try quality 60. Now it is 82 KB. You try quality 70. It is 108 KB. Quality 65 gives you 94 KB. Maybe that is close enough, or maybe you want to use as much of the allowed budget as possible for maximum quality. This binary search by hand can take a dozen attempts. This tool automates the search.
How the tool works technically. The process has two stages: a quality search first, then dimension reduction if needed.
Stage one: quality search. If your file is already under the target, the tool returns it unchanged. Otherwise it caps the longest side at 4096 pixels and runs a binary search on the quality setting between 0.01 and 1.0. Each try encodes the image, checks the blob size, and moves the quality up or down. The search stops after 15 tries, when the search range closes, or as soon as a result lands between 90 and 100 percent of your target.
Stage two: dimension reduction. Quality alone cannot always reach the target. A 4000x3000 photo at very low quality can still be larger than 100 KB, and PNG output ignores the quality setting. In that case the tool shrinks the longest side to 80 percent, encodes at quality 0.6, and repeats up to 20 times or until the side reaches 16 pixels. It keeps the first version that fits and tells you the new pixel size, and the aspect ratio stays the same.
The result usually lands between 90 and 100 percent of the target, so a 100 KB target often gives 90 to 99 KB. If no version fits, you get the smallest file the tool produced and a warning that shows its size. The tool prioritizes being under the limit over being close to it, because a file that is 1 KB over the limit gets rejected by upload validation, while a file that is 5 KB under works perfectly.
The tool only reduces dimensions after the quality search fails, so an image that can reach the target through quality keeps its full pixel size.
Step-by-step usage. Open the image resizer tool page. Upload your source image by dragging it onto the drop zone or clicking to browse. Enter the target file size in KB using the input field. Common targets are 50, 100, 150, 200, and 500 KB. The output keeps the format of your source file, so convert it first if you need a different format. Click the resize button. The tool displays the output image alongside the original, with the final file size and the percentage reduction from the original. If the result looks acceptable, click download. If the quality seems too low, consider whether you can increase the target size or use a different source image.
Common use case: passport and visa photos. Most countries specify both dimension and file size requirements for online visa applications. India's e-visa portal requires a face photo between 10 KB and 300 KB at 350x350 pixels. The US passport renewal site asks for a photo between 54 KB and 240 KB at 600x600 pixels. The UK visa application system wants photos at 600x750 pixels between 50 KB and 10 MB. Schengen visa applications vary by country but typically want 50-100 KB at specific pixel dimensions. China's visa application wants 354x472 pixels between 40 KB and 120 KB.
These requirements combine pixel dimensions with file size, which means you need a two-step process. First, resize or crop to the exact pixel dimensions. Then use this tool to compress to the target file size range. The tool accepts already-dimensioned images, so if you provide a 600x600 photo and set a 200 KB target, it will only adjust quality without changing the dimensions.
Common use case: email signatures. A corporate email signature image (company logo, headshot, or combined graphic) should be under 50 KB to prevent mailbox bloat. When 100 employees each send 30 emails per day with a 200 KB signature image, that generates 600 MB of signature image data daily across the organization. Over a year, that is 150 GB of just signature images in the email system. At 50 KB per signature, the annual total drops to 37 GB. The difference matters for Exchange servers, Gmail storage quotas, and recipients with limited mailbox space. Use this tool to compress the signature graphic to exactly 30-50 KB while maintaining readability of logos and text.
Common use case: forum and platform avatars. Many forums, gaming platforms, and community sites impose file size limits on avatar uploads. A 100 KB limit is common on platforms like Reddit, various phpBB and vBulletin forums, and community Discord servers (for emoji and stickers). If you have a 500 KB image you want to use, this tool compresses it to fit within the upload limit.
Common use case: online exam and certification portals. Many professional certification boards (CompTIA, AWS, Cisco, PMI) and university online exam systems require a photo upload with strict size limits for identity verification. These systems are often built on older frameworks with conservative upload limits. A 100 KB or 200 KB ceiling with specific dimension requirements is typical. Failing to meet the exact specifications can block your exam registration.
Output format considerations. JPEG produces the smallest files for photographs because its lossy DCT compression is specifically designed for the kinds of patterns found in natural scenes. At equivalent visual quality, a JPEG photograph is about 25-35 percent larger than the same image in WebP lossy format. However, JPEG is accepted by virtually every upload portal, while WebP support is inconsistent on older systems. For file-size-targeted resizing where the image needs to be uploaded to a specific portal, JPEG is almost always the right choice.
PNG is appropriate only if you need transparency and your target file size is generous. A transparent PNG of a photograph at 600x600 pixels will typically be 300-1500 KB. Compressing to 100 KB while maintaining transparency requires aggressive palette reduction that may destroy photographic quality. PNG works for simple logos and graphics with flat colors, where palette-based encoding is efficient.
Common mistakes. Targeting too small a file size. At some point, compression cannot reduce file size further without making the image unrecognizable. A 300x300 JPEG photograph cannot be compressed below about 3-5 KB and still look like a photograph. The mathematical minimum encoding for 90,000 pixels with any recognizable structure is a few KB. If your target is 5 KB for a complex photographic image, the result will be heavily artifacted with visible 8x8 block patterns, extreme color banding, and loss of all fine detail. The tool will produce the file, but it may not serve your purpose.
Ignoring dimension requirements. File size and pixel dimensions are independent requirements. A portal asking for "100 KB, 600x600" needs you to address both. If you only target the file size without first setting the correct dimensions, the tool may downscale the image to meet the size target. The resulting dimensions might be 400x300 instead of the required 600x600, and the portal will reject the upload. Check both dimension and file size requirements before processing. Handle dimensions first, then file size.
Using lossless format for a tight target. If you try to export a 600x600 photograph as PNG at under 100 KB, it will not work. Lossless PNG of a photograph at 600x600 is typically 500-1500 KB because every pixel must be encoded without loss. The tool would need to reduce the palette to very few colors (16 or fewer), which destroys photographic quality. Switch to JPEG for tight file size targets with photographic content.
Re-compressing an already compressed image and expecting good results. If your source is a 90 KB JPEG at quality 50 and you target 100 KB, the tool returns the file unchanged because it already fits. Re-encoding it at a higher quality would not help either, because the artifacts from the quality 50 encoding are permanent. Always start from the highest quality source available.
Advanced tips. For the sharpest result at a given file size, pre-process the image to remove unnecessary high-frequency detail. Slight noise reduction or Gaussian blur (0.3-0.5 pixel radius) on the source can reduce the encoded file size by 10-20 percent at the same quality level. The visual difference is not perceptible at small to medium image sizes (under 1000 pixels) but the file size savings can be meaningful when targeting a tight limit.
If you need an exact pixel dimension and exact file size, process in two steps. First use the image cropper or a resize tool to set the exact pixel dimensions without worrying about file size. Then feed that correctly dimensioned image into this tool and set only the file size target. This two-step approach ensures both requirements are met precisely without the tool making unwanted dimension changes.
For batch processing (e.g., preparing 20 product photos all under 150 KB for an e-commerce upload), process them sequentially. Each image has different content complexity (number of colors, amount of detail, presence of text), so each will end up at a different JPEG quality level but the same file size ceiling. A flat-color product on a white background may achieve quality 90 at 150 KB, while a detailed textured product may need quality 55. The tool handles this automatically, optimizing each image individually.
Performance characteristics. The quality search makes up to 15 encoding passes, and the dimension step can add up to 20 more. The passes run in a web worker, so the page stays responsive. Large photos take longer than small ones because every pass re-encodes the full image.
File size accuracy. The tool accepts the first result between 90 and 100 percent of the target, so a 100 KB target often gives 90 to 99 KB. The granularity depends on the JPEG quality parameter. The Canvas API accepts quality as a float from 0.0 to 1.0, but the internal encoder maps this to quantization table indices with finite precision. Adjacent quality values (e.g., 0.78 and 0.79) may produce the same file size for some images. If no version fits, the tool says so instead of hiding it.
Hidden EXIF data impact. JPEG files from cameras often contain EXIF metadata (camera model, lens, exposure settings, ISO, GPS coordinates, creation timestamp, color profile) that adds 1-30 KB to the file. Some phone cameras embed thumbnails in the EXIF data that can be 10-20 KB alone. The Canvas API strips all EXIF data during re-encoding. The output file has zero metadata overhead. If your source file had 15 KB of EXIF data, the tool effectively has 15 KB more room for image pixel data at the same target size, resulting in higher visual quality.
Color profile handling. The Canvas API converts all images to the sRGB color space when drawing to the canvas. If your source image has an embedded Adobe RGB or Display P3 color profile, the conversion to sRGB may shift some saturated colors slightly. For the vast majority of web and document submissions, sRGB is the expected and required color space, so this conversion is appropriate and actually beneficial.
Comparing with dedicated desktop tools. Adobe Photoshop's "Save for Web (Legacy)" and "Export As" features offer similar file-size-targeted export with real-time quality preview. TinyPNG, Squoosh (by Google), and ShortPixel are popular online alternatives. The advantage of this browser-based tool is privacy (no upload, no server processing), speed (no network round-trip latency), and availability (no account or install). The disadvantage compared to Photoshop is the lack of advanced encoding options like explicit chroma subsampling control (4:4:4, 4:2:2, 4:2:0), progressive JPEG output, or optimized Huffman tables. For most file-size-targeted use cases where the goal is "make this image fit under X KB for a portal upload," the browser-based approach produces results indistinguishable from desktop tools.
Multiple format outputs for the same target size. Some upload portals accept both JPEG and PNG but enforce the same file size limit. In that case, try both formats. A simple graphic with flat colors may fit under 100 KB as PNG while looking terrible at that size as JPEG. A photograph will almost always produce a better result as JPEG at any given file size. The tool keeps the source format, so convert the image with a format converter first, then run each version through this tool.
Target size ranges. Some portals specify a minimum and maximum file size (e.g., "between 50 KB and 200 KB"). The tool targets the maximum to give you the highest possible quality. If you want to target a specific value within the range, enter that value. There is no advantage to being closer to the minimum unless you are trying to conserve storage or bandwidth on your own systems.
Orientation correction. Phone cameras store orientation information in EXIF metadata. A portrait-mode photo may be stored as a landscape bitmap with an EXIF orientation flag of 6 (rotate 90 degrees clockwise). The Canvas API in modern browsers reads this flag and draws the image in its correct visual orientation. When the tool re-encodes the image, the output is in the correct orientation without any EXIF flag (because Canvas strips metadata). This means the output will display correctly everywhere, even in applications that do not read EXIF orientation (like some older image viewers and CMS thumbnail generators).
Using the tool for document scans. Scanned documents (passport copies, ID cards, certificates) often need to be uploaded to government or corporate portals with strict file size limits. Scans from flatbed scanners at 300 DPI can produce 2-5 MB files. This tool can reduce them to the required 100-500 KB range while maintaining text readability. For scanned text documents, use quality 75-85. Below quality 70, text edges become fuzzy and small print may become unreadable. If the portal accepts PDF, converting the scan to a compressed PDF is often more space-efficient for text-heavy documents than JPEG compression.
Mobile device usage. This tool works in mobile browsers (Chrome for Android, Safari on iOS). On mobile, the file picker opens the photo library or camera. You can take a photo and immediately resize it to the target file size, all on the phone. This is useful when you need to submit a document photo or selfie to a portal while away from a computer. The processing runs on the phone itself.
Batch upload preparation. When preparing multiple images for a bulk upload (product catalog, student ID photos, employee headshots), process all images to the same target size for consistency. Create a checklist of the portal's requirements: pixel dimensions, file size range, format, color mode (RGB vs. CMYK), and any content requirements (white background, centered face). Process each image through the dimension tool first, then through this file size tool. Verify each output meets all requirements before uploading.
Frequently asked questions
How does resizing to a specific KB work?
The tool uses binary search on compression quality to iteratively approach your target file size as closely as possible.
Will image quality be affected?
Some quality loss occurs with compression. The tool finds the best quality level that meets your target size.
