Compress to KB topic guide
Compress image to KB: hit a hard file-size limit
Direct answer
When a form, marketplace or passport service publishes a hard byte budget, the job is not “make it as small as possible.” The job is to land at or under the published maximum while staying above any published minimum, in a format the destination accepts. Read the official limit first, enter that KB target in Compress to KB, let a quality sweep try to keep the original dimensions, and only downscale if the quality floor still exceeds the budget.
What this workflow handles
Pixel count and bytes per pixel are separate levers, and a KB target is met by deciding which one gives. The same dimensions can differ several fold with encoder settings, so the practical question is not whether a file can be smaller but which rule you are willing to bend. Compress to KB searches in a fixed order and reports what it did. If the file is already at or under the target, the source bytes come back unchanged. Otherwise it sweeps encoder quality at the current dimensions first: JPEG and WebP between quality 10 and 92, and PNG by quantising the palette to 256, then 64, then 16 colours, because PNG has no quality dial. Only when the floor of that sweep still misses the budget does it step the dimensions down (100, 90, 80, 70, 60, 50, 40, 30, 25%, never below a 64 pixel side) and sweep again. Format is the third lever, and the Keep original format checkbox decides how soon it is pulled. With it on, the source format is searched at every size the ladder allows before any conversion is tried, and a PNG that still cannot fit goes to WebP with its alpha kept, then to JPEG on a white background — a preference, not a lock. With it off, WebP and JPEG are candidates at full size from the start, so a file can change container without losing pixels. Either way the result panel names the format and the dimensions it produced, and that report is what to check when the destination names JPEG or PNG specifically. Two rules can also collide when a destination fixes both dimensions and bytes: resize to the required pixels first, then set a target the scale ladder can reach. The “only count it as successful at or under target” checkbox gates the download, not the downscale.
Use Compress to KB to set a published KB/MB budget, quality-sweep at the original dimensions first, and downscale only if the quality floor still misses. The tool page publishes four measured cases run over the sample files shipped with this site, including one that honestly misses its budget, so each lever's cost is visible. For a balanced re-encode with no KB target, open Image Compressor instead.
How to use it
- Open the destination's own help page and write down four things: the maximum file size, any minimum file size, the accepted formats, and any maximum pixel dimension. Numbers quoted second-hand age badly.
- Convert megabytes to kilobytes by multiplying by 1,024, then enter a target at or under the published maximum and never below a published minimum. Leave headroom if the site re-encodes uploads on its side.
- Upload and run with Keep original format on when the destination names JPEG or PNG. This first pass changes quality only, so your pixel dimensions survive, and the source container gets every size before a conversion is considered. Check the format the panel reports, because the checkbox prefers that container without guaranteeing it.
- If the panel says the budget was not met, decide which rule bends: allow the stepped downscale, or raise the target. If the destination also caps dimensions, resize to that dimension first and re-run.
- Check the download yourself before you rely on it: file inspector for bytes and pixel dimensions, then the upload screen's own validation. The result panel names every change the search made, so a format or scale switch is never a surprise.
Frequently asked questions
How do I compress an image to a specific KB size?
Write down the destination's published maximum, and its minimum if it has one, before you touch the file. Convert megabytes to kilobytes by multiplying by 1,024, enter that target in Compress to KB, and leave headroom if the site re-encodes uploads itself. The tool sweeps encoder quality at the original dimensions first, then downscales in steps only if the quality floor still exceeds the budget, and it names any scale or format change in the result panel. web.dev's compress-images article recommends experimenting with quality rather than assuming one universal number, which is why this is a search instead of a preset.
Why do some uploads reject a file that is “too small”?
Some destinations publish a minimum as well as a maximum. GOV.UK digital passport photos must be at least 50KB and no more than 10MB. Compressing aggressively below that floor can fail validation even though the photo looks fine. Prefer at-or-under the published max while staying above any published min — do not chase the smallest possible file when a minimum exists.
Where do I find the limit for the site I am uploading to?
In the guide for that destination, not here. Each platform page in this cluster lists its own published numbers beside the help article they came from, so a change on one platform only has to be caught in one place. This page keeps to the method on purpose: a borrowed limit repeated across the site ages worse than no number at all.
What are the hard limits of Compress to KB?
Uploads go up to 10 MB and 20 megapixels, and targets go from 1 KB to 10240 KB. A target also has to stay within 250:1 of the source size, so a 6 MB photograph cannot be ordered down to 8 KB: the tool refuses that before decoding anything and names the floor for a file that size. One request runs at most fifteen encodes inside a twenty second search budget, and when the budget stops the search the panel reports the bytes actually measured instead of claiming the target was met. Nothing is upscaled, so an image below a destination's minimum dimensions needs a resizer that adds pixels.
Should I lower quality first or resize the image first?
Quality first, because it keeps the pixel dimensions the destination already accepted; that is the order the tool uses. Resize first only when the destination publishes a maximum dimension you already exceed, since downscaling twice costs detail twice over. web.dev treats quality settings and serving scaled images as separate checklist items for the same reason.
Which format should I pick for a KB budget?
Pick from the formats the destination lists, then pick by content. JPEG suits photographs. PNG suits flat artwork and screenshots, where a smaller palette often wins without leaving PNG at all. WebP is usually the smallest of the three at similar quality when the destination accepts it. If a form names JPEG or PNG, that beats a smaller WebP the form will reject, so leave Keep original format on: it makes the search exhaust the source container at every size before a conversion is tried. A conversion can still follow when the source format cannot reach the target, so read the format on the result panel before uploading.
How is Compress to KB different from Image Compressor?
Image Compressor uses one balanced default per format (no KB target). Compress to KB sweeps quality toward the size you set and may downscale only when needed. Use Image Compressor for a single balanced re-encode; use Compress to KB when a destination publishes a hard byte budget. Pillow’s JPEG quality/optimize, WebP save options and PNG optimize docs describe the encoder parameters behind both tools.
Can I hit exactly 100 KB every time?
Usually at or under, not exactly on the number. Encoders land on discrete quality steps; a few bytes under the target is normal. If the budget is impossible under the current constraints, Compress to KB says so and offers the smallest best-effort file. For two-sided limits (GOV.UK 50KB–10MB), aim under the max and confirm you are still above the min before uploading.
Sources
- GOV.UK — Photos for passports (digital photos): https://www.gov.uk/photos-for-passports — Digital passport photo must be at least 50KB and no more than 10MB; at least 600 pixels wide and 750 pixels tall. The two-sided limit this page is written around. (checked 2026-11-20)
- web.dev — Compress images: https://web.dev/articles/compress-images — Experiment with various quality settings: there is no one universal compression setting, which is why the tool searches instead of applying a preset. (checked 2026-11-20)
- Pillow — Image.save (JPEG quality, optimize): https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#jpeg — JPEG quality and optimize parameters used in the quality sweep between quality 10 and 92. (checked 2026-11-20)
- Pillow — WebP saving options: https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#webp — Lossy quality and lossless WebP encoding for opaque and alpha sources, and the WebP step in the format fallback. (checked 2026-11-20)
- Pillow — PNG optimize: https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#png — Lossless PNG optimize pass, tried before any format fallback. (checked 2026-11-20)
- Pillow — Image.quantize (the PNG palette lever): https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.quantize — Palette reduction to a set colour count, which is how PNG gets a lossy lever when it has no quality dial. (checked 2026-11-20)
Explore the compress to kb topic cluster
This guide covers hitting a hard byte budget. Related guides cover email, LinkedIn share photos, Instagram Graph JPEG caps, Twitter / X still-image caps, Notion inline image caps, WordPress Media Library caps, Webflow and Wix site-builder Assets upload caps, Facebook Help photo upload caps, Pinterest web Image Pin caps, YouTube custom thumbnail caps, Threads API image post caps, Bluesky post embed caps, Discord, Telegram, and GitHub attachment caps, post-compress diagnosis, file size vs dimensions, and resize vs compress.
Related guides
-
Compress images for Gumroad
Gumroad Help 50 MB image cover cap, 1280×720 recommendation, 4096 px auto-resize; thumbnails ≥600×600.
-
Compress images for email attachments
Gmail and Outlook.com 25 MB caps — shrink photos so the message still sends as a real attachment.
-
Compress images for WhatsApp
Meta Cloud API 5 MB JPEG/PNG image-message cap.
-
Compress images for GitHub
GitHub Docs 10 MB cap for images and GIFs on issues and pull requests.
-
Compress images for Discord
Discord Support 20 MB free file upload cap per attachment (Nitro tiers higher).
-
Compress images for Telegram bots
Telegram Bot API sendPhoto 10 MB cap for inline bot photos.
-
Compress images for LinkedIn posts
LinkedIn Help share-photo 5 MB cap, aspect and pixel rules, plus the separate profile-photo limits.
-
Compress images for Instagram
Instagram Graph API 8 MB JPEG cap for feed, Story, and Reels cover.
-
Compress images for Twitter / X
X API 5 MB still-image cap for Posts and DMs (animated GIF 15 MB).
-
Compress images for Notion
Notion Help 5 MB cap for inline PNG/JPG display (all plans).
-
Compress images for WordPress
WordPress Media Library 2560 px big-image threshold and PHP upload_max_filesize limits.
-
Compress images for Wix
Wix Media Manager 50 MB images and 15 MB GIFs; Site Performance 25 MB upload note; SVG 250 KB; sRGB.
-
Compress images for Webflow
Webflow Help 4 MB Assets panel and CMS image fields; built-in Compress OG caveat; background images without responsive variants.
-
Compress images for Squarespace
Squarespace Help 20 MB upload cap, 500 KB performance recommendation, 120 MP and 2500 px width guidance; auto WebP display on site.
-
Compress images for Ghost
Ghost Help Ghost(Pro) per-file upload limits by plan (5 MB–1 GB); default self-hosted nginx 50 MB cap.
-
Compress images for Google Ads
Google Ads Help 5120 KB JPG/PNG Search, Performance Max, and Demand Gen image and logo assets; Demand Gen logo / Uploaded Display 150 KB rows labeled separately.
-
Compress images for Google Business Profile
Google Business Profile Help 10 KB–5 MB Maps listing photos; 720×720 recommended — not Google Ads assets.
-
Compress images for beehiiv
beehiiv Help 5 MB post/media-library uploads, 1200×630 thumbnails; community posts up to 10 MB.
-
Compress images for Mailchimp
Mailchimp Help Content Studio 1 MB image uploads; legacy 600 px and new builder 660 px email widths.
-
Compress images for Klaviyo
Klaviyo Help 10 MB email images with 1 MB load recommendation; form editor 5 MB; 600–1000 px full-width guidance.
-
Compress images for MailerLite
MailerLite Help 10 MB File manager cap, 1024 KB campaign recommendation; GIF 4 MB; campaign/site/form width rows.
-
Compress images for Facebook
Meta Help Center 15 MB photo uploads; keep PNG under 1 MB to avoid pixelation.
-
Compress images for Pinterest
Pinterest Help 20 MB web Image Pin max; BMP, JPEG, PNG, TIFF, WEBP.
-
Compress images for YouTube
YouTube Help custom thumbnails: 50 MB on desktop; 50 MB mobile video, 10 MB mobile podcasts; JPG or PNG.
-
Compress images for Threads
Threads API image posts: 8 MB max JPEG or PNG; width 320–1440 px, aspect ratio up to 10:1.
-
Compress images for Bluesky
Bluesky post embeds: 2 MB max per image blob (image/*); up to 4 images; alt text required.
-
Why is my image still large?
Diagnosis after compress when bytes barely moved.
-
File size vs dimensions
Why pixel count and byte count are different levers.
-
Resize vs compress
When the problem is too many pixels vs too many bytes.
-
Image Compressor
Balanced default re-encode with no KB target.
All compress to kb guides
- Compress images for email: hit Gmail and Outlook attachment caps
- Compress images for WhatsApp: hit the 5 MB image message cap
- Compress images for GitHub: hit the 10 MB image and GIF cap
- Compress images for Discord: hit the 20 MB free upload cap
- Compress images for Telegram bots: hit the sendPhoto 10 MB cap
- Compress images for LinkedIn posts: hit the 5 MB photo share limit
- Compress images for Instagram: hit the 8 MB JPEG upload limit
- Compress images for Twitter / X: hit the 5 MB image upload limit
- Compress images for Notion: stay under the 5 MB inline limit
- Compress images for WordPress: Media Library size and big-image rules
- Compress images for Facebook: file size and format before upload
- Compress images for Pinterest: hit the 20 MB web Image Pin cap
- Compress images for YouTube: custom thumbnail file-size limits
- Compress images for Threads: hit the 8 MB image post limit
- Compress images for Bluesky: hit the 2 MB post embed limit
- Compress images for TikTok: hit the 20 MB photo upload limit
- Compress images for Shopify: hit the 20 MB and megapixel upload limits
- Compress images for Mastodon: hit the 16 MB post attachment limit
- Compress images for Slack: byte size and inline preview limits
- Compress images for eBay: hit the 12 MB listing photo limit
- Compress images for Etsy: stay under the 1 MB upload reliability tip
- Compress images for Medium: hit the 25 MB story-editor limit
- Compress images for Google Business Profile: fit 10 KB–5 MB photo rules
- Compress images for Wix: Media Manager limits and practical upload ceilings
- Compress images for Webflow: 4 MB Assets limits and upload prep
- Compress images for Squarespace: 20 MB cap and 500 KB performance recommendation
- Compress images for Ghost: Ghost(Pro) plan caps (5 MB–1 GB) and self-hosted 50 MB nginx default
- Compress images for Gumroad: 50 MB cover limit and thumbnail prep
- Compress images for beehiiv: 5 MB newsletter uploads, 1200×630 thumbnails, and 10 MB community posts
- Compress images for Mailchimp: 1 MB Content Studio uploads, 1024 KB targets, and legacy vs new builder widths
- Compress images for Kit: smaller-than-25 MB gallery, form/LP sizes, and email look-best width
- Compress images for Klaviyo: 10 MB email ceiling, 1024 KB load targets, form 5120 KB, and full-width dimensions
- Compress images for MailerLite: 10 MB File manager, 1024 KB campaign prep, GIF 4 MB, and width rules
- Compress images for Brevo: 5 MB Content library, layout widths, and HTML/attachment contrast
- Compress images for Substack: official sizes, PNG email banners, and dimension-first prep
- Compress images for Google Ads: 5120 KB JPG/PNG assets, aspect ratios, and surface-specific rows