Compression Result
{{ savingPercent }} %
{{ formatBytes(originalSize) }} {{ formatBytes(compressedSize) }}
Files

{{ drag ? 'Drop files here' : 'Drag & drop files here' }}

  • {{ f.name }} {{ formatBytes(f.size) }}
{{ compressionLevel }}
{{ '.' + outputExt }}
MetricValue
Original size {{ formatBytes(originalSize) }}
Compressed size {{ formatBytes(compressedSize) }}
Saving {{ savingPercent }} %

Introduction:

File compression reduces the storage footprint of data by reorganising repeated patterns and eliminating redundancy, allowing the same information to occupy fewer bytes without altering its content. Modern archive formats also bundle multiple items so they travel together, streamlining distribution and backup workflows across email, cloud drives, and version-control systems.

This tool accepts one or more local files, groups them into a portable archive, and then applies a selectable algorithm—lossless deflate, gzip, or Brotli—to squeeze the byte stream. A level slider fine-tunes the balance between processing time and space saving, while a filename field styles the resulting package for easy identification.

Compressing a quarterly report folder before emailing, for example, can cut its 25 MB size to under 8 MB, saving upload time and bandwidth for all recipients. Very large videos, photographs, and already-compressed formats may show minimal improvement and could even grow when re-archived. Always review the savings figure after processing to confirm benefits.

Technical Details:

Lossless compression encodes binary data so that decompression reproduces the exact original bit sequence. The algorithms offered here analyse repeating byte patterns, sliding windows, and statistical frequency to emit shorter symbol codes. Tar creates a raw concatenated stream with headers, while deflate, gzip, and Brotli then apply dictionary coding and entropy stages to shrink size further. These methods honour file boundaries, preserve timestamps, and deliver platform-agnostic archives that open on any modern system.

Core Process:

  1. Select files and read each into an in-memory byte array.
  2. Create a sequential archive header describing filenames, sizes, and timestamps.
  3. Apply the chosen algorithm: store only, deflate, gzip, or Brotli.
  4. Write the resulting byte stream to a Blob and expose a download link.
AlgorithmTransformationExtensionTypical Use
ZIP (Deflate)Dictionary + Huffman.zipGeneral sharing
ZIP (Store)None.zipBundling already-compressed media
TARNone.tarUnix backup streams
TAR + GZIPDeflate after TAR.tar.gzSource-code bundles
TAR + BrotliBrotli after TAR.tar.brWeb-optimised assets

Variables & Parameters:

ParameterMeaning
FilesOne or more items selected from local storage.
AlgorithmCompression method and container format.
Compression levelNumeric quality from 1 (fast) to 9 (compact).
Output nameStem used for the generated archive file.

Worked example (three files totalling 10 485 760 B, TAR.GZ, level 6):

10485760÷1024=10240 10240×compression factor(≈0.4)=4096 saving %= 10485760419430410485760 ×100=60.0

Assumptions & Limitations:

  • Content is processed entirely client-side; no network transfer occurs.
  • Compression levels map linearly to CPU time, not always to savings.
  • Already-compressed media may expand when re-packed.
  • Archive size is bounded by available browser memory.

Edge Cases & Error Sources:

  • Filenames containing non-ASCII characters may inflate header overhead.
  • Large individual files (>2 GiB) can hit Blob-size limits in older runtimes.
  • Suspended tabs can cancel in-progress compression tasks.
  • Clipboard export may fail under stringent browser privacy settings.

Scientific Validity & References:

Deflate is formalised in RFC 1951; gzip in RFC 1952; Brotli in RFC 7932. Tar specifications derive from POSIX ustar and GNU extensions.

Privacy & Compliance:

The algorithms operate solely within the local runtime, aligning with GDPR data-minimisation principles for client-side processing.

Step-by-Step Guide:

Follow these steps to create an efficient archive.

  1. Click the file selector or drag documents into the drop zone.
  2. Choose an Algorithm suited to your goal.
  3. If enabled, slide Compression level to balance speed and ratio.
  4. Name the archive in Output name.
  5. Press Compress and wait for the spinner to disappear.
  6. Inspect the savings figure or view the chart for a visual comparison.
  7. Download only after verifying size and content.

FAQ:

Which formats are supported?

The tool emits ZIP, TAR, TAR.GZ, and TAR.Brotli archives, each compatible with mainstream extraction utilities.

Does it work offline?

Yes. All computations run locally; you can disconnect from the internet once the page has loaded.

Is my data stored?

No. Files remain in local memory and disappear when you close or refresh the page.

How is saving % calculated?

The application subtracts compressed bytes from original bytes, divides by the original size, then multiplies by 100.

Why did my archive grow?

If content is already compressed—such as JPEG images or MP4 videos—adding headers can offset negligible gains, resulting in a larger file.

Glossary:

Archive
Container bundling multiple files and metadata.
Brotli
Modern dictionary-based algorithm optimised for web assets.
Deflate
Compression using LZ77 windowing and Huffman coding.
Entropy coding
Stage assigning shorter codes to frequent symbols.
GZIP
Deflate-compressed stream packaged with checksum and timestamp.

Files are processed locally in your browser; nothing is uploaded.