Compress an Image to WebP or JPEG – Free

Compress an image by re-encoding it as WebP or JPEG at a quality you set, with an optional resize. The work is done in your browser, and the result lists the original and output byte counts.

How to use the Compress image tool

  1. Choose a PNG, JPEG, WebP, AVIF, GIF or BMP picture under Image file.
  2. Pick WebP or JPEG under Output format.
  3. To shrink a large picture, enter a pixel limit from 16 to 8192 in Maximum width or height (optional).
  4. Set Quality % (JPEG or WebP) from 1 to 100. An empty box means 80.
  5. Select Compress image, compare the Original and Output lines, then select Download.

How image compression cuts file size

Lossy codecs save bytes by discarding detail the eye is unlikely to miss. JPEG splits the picture into 8 × 8 pixel blocks, converts each block to frequency coefficients with a discrete cosine transform and rounds those coefficients. The quality number controls how coarse the rounding is. Lossy WebP predicts each block from its neighbors and stores only the rounded difference, which usually needs fewer bytes for the same visual result.

Pixel count is the second lever. Halving the width and height leaves a quarter of the pixels to encode, which often saves more than any quality change.

Worked example: a 12-megapixel photo

A 4032 × 3024 JPEG test photo of 1,840,741 bytes was compressed in Chrome with a maximum side of 1920 and quality 80. The scale factor is 1920 / 4032, so the height becomes 1440. WebP output shrank the file by about 96 percent. The same settings with JPEG output gave 152,374 bytes.

Output format: WebP, Maximum width or height: 1920, Quality: 80

1920 × 1440 pixels
Original: 1840741 bytes
Output: 73380 bytes

What the size and quality fields do

Both fields are optional, and each one changes a different part of the export.

  • Maximum width or height caps the longer side. The aspect ratio is kept and the other side is rounded to a whole pixel.
  • A picture already smaller than the limit is never enlarged.
  • Quality is handed to the browser's encoder as a value from 0.01 to 1. Lower numbers mean smaller files and more visible artifacts.
  • JPEG has no alpha channel, so transparent areas are painted white first. WebP keeps transparency.
  • The download keeps the source name with a .webp or .jpeg extension. EXIF tags are not copied.

When the output is not smaller

The result panel reports both sizes because re-encoding does not always help. In the same test, saving the 12-megapixel photo as JPEG at quality 95 without resizing produced 2,113,464 bytes, more than the original. A 23,449-byte PNG screenshot with flat colors grew to 118,456 bytes as JPEG, while WebP brought it down to 19,478.

Photos gain the most from lossy compression. Screenshots, diagrams and logos have sharp edges and few colors, which PNG already stores efficiently. Try WebP for those, lower the quality, or reduce the dimensions.

File limits and unsupported input

The source can be up to 30 MiB, and the exported picture must fit within 24 megapixels, for example 6000 × 4000. Set a maximum side for anything larger. Only the first frame of an animated GIF or WebP is saved. The type is detected from the file's first bytes, so HEIC, TIFF and SVG files are refused even if renamed.

Frequently asked questions

What quality setting should I use to compress a photo?

Start at the default of 80 and look at the preview. Values between 70 and 85 usually keep photos clean at normal viewing sizes. Go lower for thumbnails, and stay higher for images with text or fine lines.

Is my image uploaded to compress it?

No. The browser decodes the file, draws it on a canvas and encodes the new WebP or JPEG locally. The picture is never sent over the network.

Why is the compressed file larger than the original?

The source was already compressed harder than your settings, or it is a flat-color graphic that suits PNG. Lower the quality, switch the output format to WebP, or set a maximum width or height.

Can I compress an image to an exact size such as 100 KB?

There is no target-size option. Run the tool, read the Output byte count, then lower the quality or the maximum side and run it again until the file is under your limit.

Related tools