Reduce JPEG File Size in KB: Every Method That Hits It

Reduce JPEG file size in KB with jpegoptim --size, KB-target tools, or a resize-first approach for tight caps like passport photos under 240 KB.

By Mike Wiberg · · 14 min read

To reduce JPEG file size in KB to an exact number, either watch the output size update live in a browser compressor and stop the moment it clears your cap, or run jpegoptim --size=50k photo.jpg from the command line to hit roughly 50 KB automatically. Caps under about 100 KB usually need the pixel dimensions cut first, since quality alone rarely gets a full-size photo that small without visible damage.

A KB cap is a different problem than "make this smaller." I get some version of this question more than almost any other size question, not "how do I shrink this" but "how do I get this under 50 KB," a fixed number a system enforces exactly. Our JPEG hub guide covers the format broadly, but a passport photo portal capped at 240 KB does not care how much smaller your file got, only whether it cleared the line. That is why we built dedicated tools around the specific caps people hit most: 20, 50, 100, and 200 KB, plus 1 MB and 2 MB.

At a Glance: Ways to Reduce File Size in KB

Five methods cover nearly every KB-target situation, from a single file you are watching in a browser to a batch job running unattended.

Method How it hits the number Best for
Watch the live size in a browser tool Drop the quality slider, stop when the after size clears your cap One-off files, seeing the tradeoff yourself
jpegoptim --size=Nk Command line, lowers quality automatically toward the target Batches, scripts, repeatable jobs
Online "by file size" tools Upload once, enter a KB number, get an approximate result A single file, no install
Resize first, then compress Cut pixel dimensions before touching quality Sub-100 KB caps a full photo cannot reach otherwise
Strip metadata first Remove EXIF before you start Free bytes back on any smartphone photo

When You Need an Exact KB Number, Not Just "Smaller"

A KB cap is a hard, binary line a system checks, not a suggestion to trim, and getting close does not count. When a form or portal states a limit, the job is to hit exact file size limit rules, not to land somewhere in the neighborhood. U.S. digital passport photo portals reject anything over 240 KB outright, no partial credit for getting close (PhotoGov).

Where a hard cap actually shows up

Job application systems, government exam portals, and freelance platform profile uploads commonly flat-cap every attachment at one number, whether the file is a headshot, a scanned signature, or a certificate photo. A generic form field built around a fixed upload limit bounces a file the instant it crosses that line, usually with a message no more helpful than "file too large," and it never tells you by how much you missed.

These systems rarely give a second chance in the same session either; you re-select the file, wait for the upload to fail again, and only then realize the number needed to drop further. Knowing the target before you start, rather than discovering it through a failed submission, is the entire reason a live-size tool beats trial and error: you see the number moving toward the line instead of guessing and resubmitting.

The practical difference from an open-ended "make it smaller" job: with a KB cap, you keep adjusting, or change method, until the number is actually under the line. Guessing a quality percentage and hoping it lands under a specific KB figure wastes passes; watching the actual number while you adjust does not.

How Do You Reduce JPEG File Size in KB?

The direct route is to watch the after size update live as you move the quality slider, and stop the moment it clears your cap. The 50 KB compressor on this site is built around exactly this workflow, the most common flat cap job forms and portals use: no signup, no automatic target mode, just the live number and a slider you control.

Because you see the exact result of every step, this method never gives you an approximate answer. Either the number under the after size clears your cap or it does not, and you know immediately, unlike a batch tool that reports success without showing you the actual byte count. Start at the default of 80, check the number, and step down, 70, 60, 50, watching where it lands relative to your cap rather than guessing at a setting in advance.

How Far Does Quality Alone Get You Toward a KB Cap?

Not very far, once the cap gets tight, and the arithmetic shows exactly why. Our own canonical result is a 4.5 MB phone photo compressed to roughly 900 KB at quality 80, the tool's default. Divide that baseline by a few common caps and the gap is stark: a 200 KB cap needs the file about 4.5 times smaller than the quality-80 result, a 100 KB cap needs it about 9 times smaller, and a 50 KB cap needs it about 18 times smaller. No further quality drop alone gets you 18 times smaller without the image looking visibly damaged first, which is the whole reason resizing enters the picture below roughly 100 KB.

Reference point Size Roughly how many times smaller than quality 80
Quality 80, no cap (our default) 900 KB 1x, the baseline
200 KB cap 200 KB about 4.5x smaller
100 KB cap 100 KB about 9x smaller
50 KB cap 50 KB about 18x smaller
900 KB quality-80 result vs common KB caps same 4.5 MB source photo, byte totals Quality 80, no cap 900 KB 200 KB cap 200 KB 100 KB cap 100 KB 50 KB cap 50 KB Quality-80 figure is the site's canonical result on a 4.5 MB source. Cap bars are the target byte count itself. Bar length proportional to bytes.

jpegoptim size: The Command-Line Way to Hit a Number

For a batch, a script, or anything repeatable, jpegoptim --size=100k photo.jpg targets roughly 100 KB by lowering quality until the output approaches that figure, and jpegoptim --size=50k photo.jpg does the same for a 50 KB target (DigitalOcean). The tool works the same lever the manual method does, quality, just automated across however many files you point it at.

jpegoptim size, explained

The k suffix in a jpegoptim size flag means kilobytes; drop it and jpegoptim reads the number as bytes instead, an easy mistake to make in a script. The catch is the word "roughly": --size approaches the target, it does not guarantee it, and on a very detailed photo it may land a few KB either side of the number you asked for.

Combining size and strip in one pass

Metadata stripping and size targeting are two separate flags, and running them together in one command saves a pass: jpegoptim --strip-all --size=50k photo.jpg removes EXIF, IPTC, and ICC data first, then lowers quality to approach 50 KB on whatever is left, so the size target has less work left to do than if metadata were still sitting in the file. For a folder of a few hundred camera photos headed at a single portal, one command with both flags beats running two passes over the same batch.

Online Tools That Target an Exact KB

These are the tools people mean when they search for a way to compress image to KB target directly, rather than by a quality percentage: you enter or pick a number, upload the file, and get a result close to that figure back. Tools built this way, some offer a "by file size" input mode, others a dedicated page per common target like 20, 50, or 100 KB, work on the same principle as jpegoptim --size: quality is the only lever, so the result approaches your number rather than landing on it exactly.

Approach Input you give it Output precision
jpegoptim --size A KB number in a command Approximate, close to target
Browser live-size watching Nothing but your eyes on the number Exact, since you stop it yourself
Online "by file size" tools A KB number in a form field Approximate, close to target

These tools matter most for someone without a terminal handy, a phone at a passport office kiosk, or a shared work computer where installing anything is out of the question. The tradeoff is the same approximation jpegoptim --size makes: you get close to your number, then have to check the actual result rather than trusting the input field blindly. For a single file with no software installed, watching the live number in a browser compressor beats trusting an automated target and then re-checking the result anyway, since you already know the answer the moment the slider stops.

When Quality Alone Won't Get You There: Resize First

Quality has a floor before the compromise becomes visible, and a full-size photo run through that floor still may not clear a tight cap.

Resize before you compress

Cloudinary's own optimization test cut a beach photo to 19.5 KB by resizing it to 600 pixels wide and applying an automatic quality setting together, about 60 percent smaller than dropping quality alone would have reached on the same image at its original dimensions (Cloudinary). Pixels you will never display still cost bytes at every quality level, so shrinking the dimensions first means the quality slider works on a photo that already sits closer to your target.

The arithmetic behind why resizing helps

Halving both the width and height of an image cuts the total pixel count to roughly a quarter, and JPEG's byte count tracks pixel count closely at a fixed quality, so a quarter of the pixels lands you somewhere near a quarter of the bytes before quality does anything further. If quartering the pixel count still is not enough for a very tight cap, halving the dimensions again drops the pixel count to roughly a sixteenth of the original, which is usually where a stubborn 50 KB or 20 KB target finally clears, since quality alone was never going to get there on a full-size frame. Resizing is not built into our tool yet, so that step happens beforehand in whatever editor or OS tool you have; the compressor here then handles quality and format on the smaller result.

Does Stripping Metadata Actually Help Hit a KB Cap?

Yes, and it costs nothing visually. Every photo off a phone or camera carries EXIF data, the metadata block recording the camera model, the exact timestamp, and often GPS coordinates, and stripping it can reclaim 200 KB or more on some smartphone images before you have touched quality or dimensions at all (DigitalOcean).

That matters most on the tightest caps, where 200 KB is the difference between clearing a 240 KB passport limit and missing it. We strip EXIF automatically on every file here, no setting to find; the command-line equivalent is jpegoptim --strip-all photo.jpg or convert -strip, either of which removes EXIF, IPTC, and ICC data in one pass if you are scripting the job instead. Stripping metadata first, before you spend a single quality step, is the one move on this page that is free.

Why Can't Any Tool Hit the Exact Number Exactly?

Because quality is a 0 to 100 integer, and it is the only lever these tools turn, and quality does not map to bytes in a perfectly predictable way from one image to the next (web.dev). A busy, detailed photo needs a lower quality setting to reach the same KB figure than a simple, flat one does, so target-size tools approach the number rather than land on it.

Add the KB versus KiB question: jpegoptim treats k as 1,000 bytes, while some tools round to the nearest 1,024-byte KiB, and two tools asked for the same "100 KB" can hand back files a few KB apart. The manual, watch-the-number method sidesteps the ambiguity entirely, since whatever the after size reads is the after size, not an estimate.

For a batch where you cannot watch every file individually, the practical workaround is to run the automated target a little tighter than the real cap, aim --size=45k for a 50 KB limit, then spot-check a handful of the results afterward. That small margin absorbs the approximation without adding a manual step to every single file, so a batch job clears the real cap even on the files that land a few KB high.

Questions

How do I reduce a JPEG's file size to 100 KB or less?

Watch the live output size in a browser compressor and drop the quality until the number clears 100 KB, which most resized photos reach somewhere in the 50 to 70 quality range. If the photo is still over the limit at low quality, resize the pixel dimensions first, since a smaller photo needs far less quality reduction to hit the same byte target.

How do I compress a JPEG in Windows 11 to hit a KB limit?

Right-click the file, choose Open with Photos, then use the resize option to cut the pixel dimensions before saving a copy; Windows 11's built-in tools have no quality slider, so dimensions are the only lever available natively. For the quality lever and a live KB readout, a browser compressor is the faster route on Windows too.

Does jpegoptim --size guarantee the exact byte count I asked for?

No. It targets an approximate size near the number you give it by lowering quality until the output gets close, and on a detailed image it can land a few KB above or below the figure. Watching the live size in a browser tool as you adjust gives you the exact result instead of an estimate.

Why can't two different tools agree on the same "100 KB" result?

Because quality does not translate to a precise byte count, and different tools round differently between 1,000-byte kilobytes and 1,024-byte KiB. A busy photo also needs a different quality setting than a simple one to reach the same size, so any two automated tools asked for "100 KB" can hand back files a few KB apart from each other.

Is stripping metadata actually worth doing for a tight KB cap?

Yes, especially on the tightest limits. EXIF metadata can run 200 KB or more on a smartphone photo, and on a 240 KB passport-style cap that is close to the entire budget. The tool on this site strips it automatically on every file; `jpegoptim --strip-all` does the same from the command line.

Ready to Hit Your Exact KB Number

Hitting an exact KB number comes down to picking the right lever for how tight the cap is: watch the live size and adjust quality for anything with reasonable headroom, resize first when the cap sits under about 100 KB, and treat metadata stripping as a free step that is already on by default here. When you need to reduce JPEG file size in KB and actually watch the number cross the line, compress your file toward a 50 KB target and stop the slider yourself.