What This Guide Covers

This page is a working procedure for getting a JPEG ready for a website: what to do, in which order, and what to check at the end. It does not try to explain why JPEG loses detail or what the phrase "no quality loss" can honestly mean. That discussion lives in Compress JPEG Without Losing Quality, and the mechanics of the format are in How JPEG Compression Works. Here the goal is narrower: a smaller file that still looks right where it will be shown.

The Workflow at a Glance

  1. Keep an untouched original. Every later step starts from it, never from a previous export.
  2. Resize to the size the image is displayed at. Pixel dimensions matter more than any quality slider.
  3. Export once at a tested quality. Start in the 75-85 range and adjust by eye.
  4. Decide on progressive encoding. It changes how the image appears while loading, not how it looks when done.
  5. Handle metadata deliberately. Strip what you do not need, keep what you do.
  6. Deliver it properly. Correct dimensions in the markup, sensible caching, lazy loading below the fold.
  7. Check the result at the size visitors will actually see.

Step 1: Protect the Original

JPEG is a lossy format, so a saved JPEG can never be restored to the camera file or design export it came from. Keep the original in a separate folder and treat every web version as disposable output. If a page redesign later needs larger images or a different crop, you can regenerate them from the source instead of stretching a small, already compressed file.

Step 2: Resize Before You Compress

A photo straight from a phone or camera usually has far more pixels than a web page can show. Compression cannot fix that gap efficiently, because the file still carries detail the screen will throw away. Work out the largest width the image is displayed at in your layout, then export at that width. For sharp results on high-density screens, export a second version at roughly twice the width and let the browser choose between them with srcset. The WebP optimization guide shows the markup for that.

Our JPEG compressor has max width and max height fields in Custom mode, but they are not applied reliably at the moment. Resize oversized photos in an image editor first, then upload them.

Step 3: Pick a Quality Starting Point

JPEG quality is a setting inside the encoder, not a measure of how the picture looks, and the same number can give different results in different software. Treat the values below as places to begin testing, not as promises.

Image typeStart atWhat to look for
Detailed photos, product shots85Fine texture and edges staying crisp when zoomed
General editorial photos80Smooth skies and skin without blocky patches
Backgrounds, blurred or busy images75Banding in gradients, halos near sharp edges

Export, view at the real display size, then at 100 percent zoom. If you see blocky squares in flat areas or fuzzy halos around text and edges, raise the quality a few points. If you cannot see any difference from the original at normal viewing size, try lowering it and compare again. Stop when the next step down becomes visible. In our tool, Lossy mode defaults to 85, which is a reasonable first pass. Other quality values are not applied reliably yet, so compare the result before you download.

Step 4: Progressive or Baseline

A baseline JPEG paints from the top down as data arrives. A progressive JPEG first shows a rough version of the whole image and sharpens it in passes, as defined in ITU T.81 (JPEG standard). The finished picture looks the same. Progressive files can feel faster on slow connections because something appears early, and they are a sensible default for large photos. Very small images such as thumbnails gain little from it. Progressive decoding takes a bit more work from the browser, so test on a modest device if the page carries many large images.

Step 5: Metadata Without Surprises

Camera files carry EXIF data: camera model, settings, sometimes GPS coordinates, and often an embedded preview. None of it is needed to display the picture, and location data is a privacy risk on public pages. Removing it also makes the file smaller. Two cautions apply:

  • Orientation. Many phones store a rotation flag in the metadata instead of rotating the pixels. If a tool strips the flag without applying it, the image appears sideways. Check a portrait photo after processing.
  • Colour profiles. An embedded ICC profile tells software how to interpret the colours. Photographers who work in a wide colour space may see a colour shift if the profile is dropped. For ordinary sRGB web content this is rarely a concern.
  • Copyright fields. If you rely on embedded credit or licence text, keep it.

Step 6: Delivery

A well-prepared file can still slow a page if it is delivered badly. Set width and height attributes on every img so the browser reserves space and the layout does not jump. Use loading="lazy" for images below the first screen, but not for the main image at the top, which should load as early as possible. Give static images long cache lifetimes and change the file name when the image changes. When you are ready to go further, WebP and AVIF usually give smaller files for photos; the AVIF, WebP and JPEG comparison helps with that decision, and JPEG can stay as the fallback.

Using the Tool for This Workflow

  • Add up to 5 JPEG files per batch. Formats accepted are PNG, JPEG, WebP and AVIF.
  • Pick Lossless or Lossy (quality default 85). Custom mode has extra fields, but they are not applied reliably yet.
  • Read the sizes in the results table to confirm what you got.
  • Use the before and after view to inspect faces, text and gradients, then download singly or as a ZIP.
  • Files are uploaded to our servers over HTTPS and deleted automatically after processing. No registration is needed.

For large folders, the batch compression guide covers how to organise the work.

Troubleshooting

SymptomLikely causeWhat to try
File is still largeDimensions far above display sizeResize first, then compress
Blocky squares in sky or wallsQuality too low for smooth areasRaise quality a few points
Smudged text or logo edgesWrong format for the contentUse PNG, see the PNG guide
Output is bigger than the inputSource was already compressed hardKeep the original file
Photo shows sidewaysOrientation flag removedRotate the pixels, then export

Mistakes That Waste the Effort

  • Compressing an oversized image instead of resizing it.
  • Re-exporting a JPEG that was already exported, instead of going back to the original.
  • Choosing one quality number for every image on the site without looking at any of them.
  • Judging only at a zoom level nobody will use, or only on one screen.
  • Lazy loading the top-of-page image, which delays what visitors see first.

Pre-Publish Checklist

  • Original stored safely and untouched
  • Width matches the display size, with a larger version for dense screens if needed
  • Quality tested by eye on this image, not copied blindly
  • Progressive choice made for large photos
  • Location data removed, orientation and colours checked
  • Width and height set in markup, lazy loading applied only below the fold
  • Page tested on a phone
  • Browser support: universal (caniuse)

Next Steps

Ready to process a batch? Open the JPEG compressor. To understand why a setting behaves the way it does, read How JPEG Compression Works. For the difference between lossy and lossless approaches in general, see Lossy vs Lossless Compression.