Compress JPG - Reduce JPEG File Size Free Online

Compress JPG files in your browser — no upload, no sign-up. Drag, set quality, download a smaller JPEG in seconds. Totally free and private.

Shrink your JPG file without losing visible quality

Drop a JPG above, drag the quality slider, and download a smaller file in seconds. No sign-up, no upload — everything runs right in your browser. Perfect for cutting image sizes before posting to a website, sending by email, or hitting a strict upload limit.

Your file never leaves your device. The compression is done entirely by your browser using the built-in canvas API, so your photos stay private.

How to compress a JPG in 3 steps

  1. Choose your file — click the upload area or drag your JPG onto it.
  2. Set the quality — slide the quality control left to shrink the file more, or right to keep more detail. A value around 70–80 gives a good balance between size and sharpness for most photos.
  3. Download — click the download button to save the compressed JPEG to your device.

The tool shows the original size and the compressed size side by side, so you can see exactly how much you saved before you download.

Worked example: compressing a holiday photo

Say you have a phone photo saved as holiday.jpg that weighs 4.2 MB. That is too big to attach to most emails (many providers cap attachments at 5 MB, and slower connections make large photos painful).

Quality settingOutput file sizeVisual difference
90~1.8 MBVirtually none
75~700 KBBarely noticeable
60~380 KBSlight softening in fine detail
40~200 KBVisible compression artefacts

For a typical email attachment or website hero image, quality 75–80 is the sweet spot. You save around 80% of the original file size with very little visible loss.

How to compress a JPG in code

If you need to automate JPEG compression in a script or CI pipeline, here are two minimal, copy-pasteable examples.

Python (Pillow library)

# pip install Pillow
from PIL import Image

img = Image.open('holiday.jpg')
img.save('holiday_compressed.jpg', format='JPEG', quality=75, optimize=True)

The quality parameter accepts 1–95 (95 is near-lossless). Setting optimize=True tells Pillow to run an extra pass that can shave a few extra kilobytes.

JavaScript (browser canvas)

// Runs in a browser — no libraries needed
async function compressJpg(file, quality = 0.75) {
  const bitmap = await createImageBitmap(file);
  const canvas = document.createElement('canvas');
  canvas.width  = bitmap.width;
  canvas.height = bitmap.height;
  canvas.getContext('2d').drawImage(bitmap, 0, 0);
  return new Promise(resolve =>
    canvas.toBlob(resolve, 'image/jpeg', quality)
  );
}

The quality argument here is a float between 0 and 1. Pass 0.75 for roughly 75% quality — the same logic this page's tool uses under the hood.

How the compression works

JPEG compression (defined in the JPEG standard, maintained by the Joint Photographic Experts Group) works by dividing an image into small 8×8 pixel blocks and discarding fine detail the human eye is least sensitive to — mainly high-frequency colour shifts. Lowering the quality setting throws away more of that detail, which means a smaller file but also softer edges at very low settings.

This tool draws your image onto an HTML canvas element, then calls canvas.toBlob() with the JPEG MIME type and your chosen quality value. The browser's own image engine does the rest. Nothing is sent to a server.

When to use JPEG compression — and when not to

  • Use it for photos and gradients — JPEG is designed for continuous-tone images like portraits, landscapes, and product shots.
  • Use it before uploading to social media or a CMS — platforms like WordPress and Shopify often accept JPEGs but benefit from pre-compressed files that load faster.
  • Skip it for logos, icons, and screenshots with text — JPEG introduces subtle colour smearing around hard edges. Use PNG or SVG for those.
  • Skip it if you need a transparent background — JPEG does not support transparency. Convert to PNG instead if you need transparent areas.
  • Skip it for lossless archiving — each time you save a JPEG at less than 100% quality, some detail is permanently lost. Keep a master copy in a lossless format (TIFF or PNG) if you plan to edit the image again later.

For more on JPEG quality and when lossy compression is worth the trade-off, see the MDN docs on canvas.toBlob(), which explains the quality parameter in depth.

Your data stays private

Many online image tools upload your photo to a remote server for processing. This tool is different: the entire compression runs locally in your browser using the canvas API. Your JPG is never transmitted anywhere, so there is no risk of your images ending up on a third-party server.

That matters especially if you are compressing personal photos, client work, or confidential product images.

One takeaway

Smaller JPEGs mean faster page loads, smaller email attachments, and fewer rejected uploads — and you can reach that in seconds without installing anything. Use the tool above to compress your JPG right now.

Frequently asked questions

Is my photo uploaded to a server when I compress it here?+
No. The compression happens entirely in your browser using the HTML canvas API. Your file never leaves your device and is never sent to any server, so your images stay completely private.
How small can I make a JPG without it looking bad?+
For most photos, a quality setting of 70–80% cuts the file size by 70–85% with no obvious visual loss. Below 50% you start to see blurring and blocky artefacts, especially around edges and text. The before/after size display in the tool lets you see the trade-off before you commit.
What is the difference between 'compress JPG' and 'resize JPG'?+
Compression reduces file size by discarding fine colour detail — the image dimensions stay the same. Resizing reduces file size by making the image physically smaller (fewer pixels). Compression is the right choice when you need the same image at a smaller file size; resizing is better when you need a thumbnail or a specific pixel dimension.
Can I compress a JPG to under 100 KB?+
Usually yes. Drag the quality slider down until the 'after' size shown by the tool falls below 100 KB. How low you need to go depends on the original image — very high-resolution photos may need a quality setting of 40–60 to hit 100 KB. If the file is still too large at low quality, you may also need to reduce the image dimensions.
Does compressing a JPG reduce its dimensions (width and height)?+
No. This tool only adjusts the JPEG quality — the pixel dimensions are preserved. The output image will be the same width and height as the original, just encoded at a lower file size.
Is this tool free? Do I need to create an account?+
Completely free, no account needed, and no watermarks are added to your image. Just upload, compress, and download.
How do I compress a JPG in Python?+
Use the Pillow library: from PIL import Image; img = Image.open('photo.jpg'); img.save('photo_compressed.jpg', quality=75, optimize=True). Install Pillow first with pip install Pillow. The quality value ranges from 1 (smallest) to 95 (near-lossless).
Can I compress PNG or WebP files with this tool?+
This tool is optimised for JPG/JPEG files. If you upload a PNG it will be converted to JPEG during compression, which means you lose any transparent background. For PNG files where you need to keep transparency, use a dedicated PNG compressor instead.