If you have spent any time optimising images for the web, you have probably come across the name jpegoptim. It refers both to a long-standing command-line utility and, in our case, to a browser-based workflow that brings the same proven techniques to anyone without a terminal. This article explains what JPEG optimisation is, what the jpegoptim approach does under the hood, and how to use it to make your images dramatically smaller without sacrificing quality.

You can try everything described here for free with the core optimise JPEG tool, which mirrors what the classic utility does on the command line.

What Is JPEG Optimisation?

A JPEG straight out of a camera or design tool is rarely encoded efficiently. It typically carries generic compression tables, embedded metadata, an embedded colour profile, and sometimes a full thumbnail preview. JPEG optimisation is the process of re-encoding that file so it stores the same visible image in fewer bytes. The goals are smaller downloads, faster pages, and lower bandwidth bills — all without the viewer noticing any difference.

The work falls into two families. Lossless optimisation reorganises the existing data without changing any pixels. Lossy optimisation selectively discards detail the human eye cannot easily perceive, in exchange for much larger savings. A good optimiser lets you choose between them, or combine them.

What jpegoptim Does Under the Hood

The classic jpegoptim utility, and the optimisation engine behind our tool, performs several distinct operations on a JPEG:

  • Optimises Huffman tables. JPEG uses Huffman coding for its final entropy step. Default encoders ship generic tables; rebuilding them to match the actual image is lossless and typically saves a few percent for free.
  • Strips metadata. EXIF tags, GPS coordinates, camera thumbnails, XMP, and comment blocks are removed unless you choose to keep them.
  • Re-compresses to a target (optional). If you set a maximum quality or a target file size, it re-quantises the image to hit it.
  • Converts to progressive (optional). Reordering scans improves perceived load and often shrinks the file further.

Lossless Mode: Free Savings

The most appealing feature is lossless mode. Because Huffman optimisation and metadata stripping never alter pixel data, you can run them on any JPEG with zero quality risk. On photos with large EXIF blocks or an embedded camera thumbnail, lossless cleanup alone can remove tens of kilobytes. There is genuinely no downside, which is why it should be the default for archival images. If you want the full mechanics, our article on lossless JPEG optimisation goes deeper.

Lossy Mode: Bigger Wins

When you can tolerate a tiny, usually invisible change, lossy mode unlocks far larger reductions. By capping quality at, say, 80, the encoder discards high-frequency detail that contributes little to perceived sharpness. The result is often a file less than half the original size. To understand precisely what is being thrown away and why it is hard to notice, read JPEG compression explained, which walks through the quantisation step where the loss happens.

How to Use the Tool: Step by Step

Using the browser-based workflow takes seconds and requires no installation:

  1. Open the optimiser. Load the optimise JPEG tool in your browser.
  2. Add your image. Drag a JPEG in or select it from disk. Processing happens locally where possible, so your file is not uploaded anywhere it does not need to be.
  3. Choose a mode. Lossless for archival safety, or a quality target like 80 for maximum savings.
  4. Decide on metadata. Keep the colour profile if accurate colour matters; strip everything else for privacy and size.
  5. Download the result. Compare the before and after sizes and confirm the quality is acceptable at full zoom.

jpegoptim Versus a Plain Re-Save

It is tempting to just re-export a JPEG from an image editor at a lower quality. That works, but it usually leaves savings on the table:

  • Plain re-save: Lowers quality, but often keeps generic Huffman tables and all metadata, and rarely goes progressive.
  • jpegoptim approach: Lowers quality if you want, plus optimises Huffman tables, strips metadata, and converts to progressive in a single pass.

The difference adds up. On a typical camera JPEG, the jpegoptim approach can produce a noticeably smaller file than an editor's "save for web" at the same visual quality, simply because it does more cleanup work in the same operation.

When to Reach for a Quick Compress Instead

Sometimes you do not need fine control — you just want a smaller file fast. For that, the compress JPEG tool applies a sensible balance of quality and metadata stripping with no settings to fiddle with. It is the quickest route when you are processing many images casually rather than tuning a single hero shot. The trade-off is control: you accept the tool's chosen balance instead of dialling in your own quality target, which is perfectly fine for the majority of everyday images where you simply want them smaller without fuss.

Where It Fits in a Modern Workflow

Optimising JPEGs is one part of a faster site. You should also serve modern formats where supported; our JPEG versus WebP comparison shows why, and the JPEG to WebP tool handles the conversion in a click. To keep every new image optimised automatically rather than relying on memory, see how to automate image optimisation across your build or upload pipeline.

How Much Smaller Can You Realistically Get?

The savings depend entirely on where the image started. A photo straight off a smartphone is usually the best candidate, because it tends to carry a large EXIF block, an embedded thumbnail, generic Huffman tables, and a quality setting far above what the web needs. On such files it is common to see reductions of 60 percent or more when you combine a lossy pass at quality 80 with full lossless cleanup.

An image that has already been processed by a competent "save for web" export will give up much less, perhaps 5 to 15 percent, because the obvious waste is already gone. And a file that has been through an aggressive optimiser before may barely shrink at all, since there is little left to remove. This is normal and not a sign the tool failed; it simply means the previous pass did its job.

Privacy as a Side Benefit

One advantage of running every image through an optimiser is that metadata stripping happens for free. Most people do not realise that a photo from their phone often records the exact GPS coordinates where it was taken. Publishing that online can expose your home address or daily routine without you ever intending to share it.

Because the jpegoptim approach strips EXIF, GPS, and comment data as part of a normal optimisation pass, you get a privacy benefit alongside the size reduction. If privacy is your main concern rather than bytes, our dedicated guide on stripping EXIF metadata from JPEG explains exactly what is removed and what is worth keeping, such as a copyright notice or a colour profile.

Conclusion

jpegoptim is a focused way to make JPEGs smaller: optimise the entropy coding, strip the cruft, and optionally re-compress to a sensible quality. Lossless mode is risk-free; lossy mode is where the big wins live; combining both gives the best of each. Start now with the optimise JPEG tool at jpegoptim and shrink your first image in seconds.