Initializing, please wait a moment

How to Compress a File Online (Step by Step)

Last reviewed 2026-04-27. Each step below runs in your browser on your own device. The file you compress never leaves your computer or phone.

30-second answer. Identify the file type first, then pick the matching tool. JPG / PNG photo: Compress Image at quality 80 typically saves 50-70%. HEIC photo: HEIC to JPG - the conversion is the size win. PDF: Flatten PDF when forms / annotations bloated the file. Single video: re-encode at lower bitrate (browser tools handle short clips). Document / spreadsheet / source-code file: ZIP it - DEFLATE cuts text-heavy files by 50-80%. If your input is a folder, not a single file, jump to how to compress a folder for email instead.

Step 1 - identify the file type

The "compress a file online" search returns generic tools that try to handle every type with the same algorithm. That works for some inputs and badly underperforms for others. Look at your file's extension first:

  • .jpg / .jpeg / .png -> image-compression path (Step 2A).
  • .heic / .heif -> convert to JPG first; the conversion is the bigger size win than any compression run (Step 2B).
  • .pdf -> PDF-specific flatten / re-save path (Step 2C).
  • .mp4 / .mov / .mkv -> re-encode at lower bitrate (Step 2D).
  • .docx / .xlsx / .pptx / .csv / .txt / .json / .xml / source code -> ZIP-it path (Step 2E).
  • .mp3 / .wav / .flac -> audio re-encode (Step 2F).

If you have a folder rather than a single file, ZIP is the answer because ZIP both bundles and compresses in one step. File compressor vs ZIP covers folder-vs-file decisions in detail.

Step 2A - JPG / PNG photos

Open Compress Image, drag your photo into the drop zone, set quality to 80 (the default), and download. A 5 MB iPhone JPG typically lands at 1-1.5 MB at quality 80 with no visible difference unless you zoom in to 200%. If you need a smaller result, drop quality to 70 - the savings are diminishing returns below that.

PNG is a lossless format. If your "PNG photo" is actually a photograph, save it as JPG instead - the size cut is much bigger. PNG should be reserved for screenshots, UI mockups, line art, and any image that needs transparency. JPG vs PNG for the web walks through the format choice.

Step 2B - HEIC photos

HEIC files from iPhone are already small (HEVC encoding), so re-compression rarely helps. The bigger problem is compatibility - HEIC does not open on Windows, older Android, most browsers, and most email clients without a paid codec install. Open HEIC to JPG, drag in the .heic file, download the .jpg. The JPG copy is similar size or slightly larger but opens everywhere. For batch HEIC work see how to convert 100 HEIC photos to JPG.

Step 2C - PDF files

PDFs come in two flavours. A scanned-document PDF (large because each page is a high-resolution image) compresses by re-saving at lower image quality - that path needs dedicated PDF software outside the scope of browser tools. A text-PDF that has been bloated by form fields, annotations, or revision history compresses well via Flatten PDF - flattening removes the editable layers, dropping a 12 MB form PDF to 2-3 MB. If you have a stack of small PDFs to send to one person, merging them into one is often the goal rather than compressing each individually - use Compose PDF.

For more PDF routing see the PDF editing ladder.

Step 2D - video files

Browser-only video compression is feasible for short clips (under 60 seconds at 1080p). Open Video Converter, set output bitrate to 1500 kbps for 1080p or 800 kbps for 720p, and re-encode. A 60 MB phone clip typically lands at 8-15 MB. For longer videos or 4K source, browser memory limits become a problem; use FFmpeg locally instead - FFmpeg online vs local FFmpeg covers the boundary case.

Step 2E - documents and source code

This is the path most "free file compressor" results miss. A 30-page DOCX, a 200-row CSV, a 4,000-line source-code file - all of these have huge compression ratios under DEFLATE. Open Zip File, drop the file, download the .zip. A 12 MB DOCX with embedded screenshots typically lands at 4-5 MB. Plain-text source code can shrink by 70-80%. Do not skip this step if your file is text-heavy; it is the best size cut available without losing fidelity.

Step 2F - audio files

Browser ZIP does not help because audio formats are already compressed. The right path is format conversion - WAV to MP3 at 192 kbps, or FLAC to OGG. Browser tools for audio re-encoding are limited; dedicated software (Audacity, fre:ac) is faster for this case. The exception: if you have a single 5 MB WAV that needs to fit a 2 MB upload limit, online conversion is fine.

Step 3 - verify the output

After compression, double-check three things before sending:

  • Open the compressed file once. Image compressors can rarely produce a corrupt JPG, but a corrupt PDF or video looks fine in the file manager and only fails when the recipient opens it.
  • Check the size against the limit you needed. Email caps are typically 25 MB attachment, sometimes 10 MB. Some web forms cap individual fields at 5 MB.
  • If the file is going to a contract / legal / banking system, keep the original. Some recipients reject lossy-compressed files because they must accept the bit-exact original.

What if the result is still too big?

If your compressed file is still over the limit, two options usually work. Convert format: many "compressed" files are still in the wrong format. PNG photo to JPG can give 90% size cut, even after a JPG compress. Use a transfer link: Drive, Dropbox, WeTransfer all give you a URL to send instead of an attachment. The recipient downloads the original file at full fidelity. For files larger than 25 MB this is almost always the right answer.

If your file was supposed to be a folder of files, ZIP is the answer (one ZIP, all files inside). See how to compress a folder for email. If you already have a ZIP that is too big, see how to reduce zip file size online.

Privacy

Every tool linked in this guide runs in your browser on your own device. The file you compress is never uploaded to a server. That matters if your file contains anything personal, financial, medical, or work-confidential. For background see free online tools that work without uploading files.

← Back to All Guides

Why trust these tools

  • Ten-plus years of web tooling. The freetoolonline editorial team has shipped browser-based utilities since 2015. The goal has never changed: get you to a working output fast, without an install.
  • Truly in-browser - no upload. Every file-processing tool on this site runs in your browser through modern Web APIs (File, FileReader, Canvas, Web Audio, WebGL, Web Workers). Your photo, PDF, audio, or text never leaves your device.
  • No tracking during tool use. Analytics ends at the page view. The actual input you paste, drop, or capture is never sent to any server and never written to any log.
  • Open-source core components. The processing engines underneath (libheif, libde265, pdf-lib, terser, clean-css, ffmpeg.wasm, and others) are public and audit-able. We link to each one in its tool page's footer.
  • Free, with or without ads. All tools are fully functional without sign-up. The Disable Ads button in the header is always available if you need a distraction-free run.