Compression Result
{{ savingPercent }} %
SHA-256 {{ sha256Hex.slice(0,8) }}…
{{ formatBytes(originalSize) }} {{ formatBytes(totalCompressedSize) }} {{ parts.length }} parts
Files:

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

  • {{ displayPath(f) }} {{ formatBytes(f.size) }}
{{ compressionLevel }}
{{ '.' + outputExt }}
{{ progressPct }}%
Metric Value Copy
Original size {{ formatBytes(originalSize) }}
Compressed size {{ formatBytes(totalCompressedSize) }}
Saving {{ savingPercent }} %
Parts {{ parts.length }}
SHA-256 {{ sha256Hex }}

                

Introduction:

File compression is the process of encoding data to reduce its byte size. Also called archiving, it can combine multiple items into one stream while preserving path names in browser‑based file compression. Many archival formats track metadata using compact headers, and one widely used layout is the USTAR header for portability.

It accepts files as input and maps them into a lossless container using a chosen algorithm. The engine filters hidden paths or exclusion patterns, flattens folder structure on request, then compresses and optionally groups content into an archive or a single compressed stream. It reports the new size and saving percentage plus optional split parts and a SHA‑256 hash for integrity.

Imagine packaging a project folder of images, scripts, and documents using ZIP, leaving already‑compressed media unaltered, and sharing the result with a short verification hash. Seeing a saving near forty percent signals faster transfers without changing the content. Compression of media already stored in efficient formats may offer little benefit, so test and adjust levels.

Technical Details:

1) Concept Overview

The engine supports these lossless modes: ZIP with deflation, ZIP with storage only, TAR without compression, TAR.GZ using gzip, and TAR.BR using Brotli. GZ or BR operate on a single file; when multiple inputs are present, they are first grouped into a TAR stream and then compressed. A configurable level controls speed versus size where applicable. Hidden files and exclusion globs can be removed. Optionally, long paths are flattened, the output is split into fixed‑size parts, and a SHA‑256 digest is computed for the final artifact.

2) Core Process

  1. Filter inputs by hidden‑path rule and comma‑separated globs (case‑insensitive).
  2. Derive an output base name from the folder root or the first file.
  3. Select the algorithm; wrap multiple files into TAR for GZ or BR.
  4. Compress: deflate where set, store already‑compressed types when smart mode is on.
  5. Create a single blob; optionally slice it into parts of splitMB × 1×10⁶ bytes.
  6. Compute SHA‑256 over the final blob, or the concatenation of all parts.
  7. Report original size, compressed size, saving percentage, parts, and hash.
Symbols and units used by the compressor
Symbol Meaning Unit/Datatype Source
OTotal size of included filesbytes (integer)Derived
CCompressed size (or sum of parts)bytes (integer)Derived
SSaving percentage% (one decimal)Computed
LCompression levelinteger (0–9 or 0–11)Input
AAlgorithmenumInput
MSplit size per partMB (decimal; 1×10⁶ B)Input
PNumber of partsintegerDerived
HIntegrity hashSHA‑256 hex (64 chars)Computed
FFlatten paths optionbooleanInput
XExclusion patternsstring (globs)Input
KSkip hidden (dotfiles)booleanInput

3) Interpretation & Thresholds

Compression level ranges by algorithm
Threshold Band Lower Bound Upper Bound Interpretation Action Cue
TAR or ZIP (Store) 0 0 Level setting is ignored. Leave any number; outcome unaffected.
ZIP / GZ 0 9 Higher values reduce size at the cost of speed. Increase for text; lower when speed matters.
Brotli (BR / TAR.BR) 0 11 Broader range; higher values spend more time. Use higher levels when time permits.
GZ / BR with multiple files Files are first grouped into TAR, then compressed. Expect .tar.gz or .tar.br output.

A positive saving indicates the compressed artifact is smaller than the original total. Zero or negative values can occur with already‑compressed media or when storage‑only modes are used; that is expected behavior.

4) Variables & Parameters

Configuration parameters and their effects
Parameter Meaning Unit/Datatype Typical Range Sensitivity Notes
Algorithm Compression/container method enum ZIP, ZIP(Store), TAR, TAR.GZ, TAR.BR, GZ, BR High GZ/BR are single‑file unless wrapped in TAR.
Compression level Time versus size tradeoff integer 0–9 or 0–11, or ignored Medium Ignored for TAR and ZIP(Store).
Smart compression Store pre‑compressed types without deflate boolean on / off High Prevents growth of media and archive files.
Flatten paths Drop directory structure boolean on / off Medium Stores only file names in the container.
Skip hidden Exclude dotfiles and dotfolders boolean on / off Low Affects any path segment starting with “.”.
Exclude patterns Comma‑separated globs string e.g., *.mp4,*.zip,node_modules/** High Anchored, case‑insensitive, slash‑aware.
Split into parts Slice the final blob MB (decimal) 0, 5, 25, … Medium 0 keeps a single file; naming includes .partNN.
Output name Base file name string derived or user‑supplied Low Falls back to folder root or first file.

5) Units, Precision & Rounding Policy

Units and rounding behaviors
Aspect Policy
Byte display units KB, MB, GB, TB labels use powers of 1024.
Split size units MB means 1×10⁶ bytes per unit.
Decimal separator Period (dot).
Displayed precision Sizes to two decimals; saving to one decimal.
Rounding Native JavaScript toFixed behavior; no custom tie rule.

6) Validation & Bounds Extracted from Code

Inputs, bounds, and error texts
Field Type Min Max Step/Pattern Error Text
Files File list / folder 1 (after filters) Drop, pick, or folder selection “No files to include after applying filters.”
Algorithm Select ZIP, ZIP(Store), TAR, TAR.GZ, TAR.BR, GZ, BR
Compression level Range (integer) 0 0 / 9 / 11 Disabled for TAR and ZIP(Store)
Exclude patterns Text Comma‑separated globs; anchored; case‑insensitive
Split into parts (MB) Number 0 Step 1; 0 disables splitting
Brotli compressor Process Quality equals selected level “Brotli compression failed.”
General errors Process “Compression failed.”

7) Worked Example

Scenario: Three files are included after filters. Choose TAR.GZ with level 6 and no splitting.

O = 1,534,000 B+2,600,000 B+875,000 B O = 5,009,000 B C = 3,030,000 B S = (OC) / O × 100 = 39.5  %

Result: about 39.5% smaller, one file produced, plus a SHA‑256 hash for verification.

8) Assumptions & Limitations

  • Processing occurs entirely in the browser; large inputs consume memory and time.
  • Displayed KB/MB/GB labels use powers of 1024. Heads‑up
  • Split size uses decimal megabytes (1×10⁶ bytes). Heads‑up
  • Non‑ASCII characters in TAR headers are written as low‑byte values only. Heads‑up
  • Very long TAR paths are split into a 155‑char prefix and 100‑char name, trimming beyond those limits.
  • GZ/BR compress a single file; multiple inputs are automatically wrapped in TAR.
  • “Smart compression” stores many media and archive extensions without deflation.

9) Edge Cases & Error Sources

  • Glob patterns are anchored and case‑insensitive; unintended matches can exclude files.
  • Hidden‑path detection excludes any segment starting with a dot, including parent folders.
  • Cancel stops progress updates; ongoing compression calls may still complete in the background.
  • SHA‑256 can be blank where the platform lacks crypto.subtle support.
  • Extremely many small files increase overhead compared with fewer large files.

10) Smart‑Store Extension Set

File types stored without deflation in ZIP when smart mode is on
Category Extensions
Images jpg, jpeg, png, gif, webp, avif, bmp, ico, svgz, heic, heif
Audio mp3, aac, m4a, ogg, oga, opus, flac
Video mp4, mkv, mov, avi, webm
Archives zip, rar, 7z, gz, bz2, xz, zst, br, tar
Documents / Fonts / Images pdf, woff, woff2, otf, ttf, apk, dmg, iso

11) Scientific / Standards Backing

The implementation corresponds to widely recognized specifications: the ZIP archive format (store and deflate modes), the GZIP format, the USTAR TAR header layout, and the Brotli bitstream specification.

12) Privacy & Compliance

Files are processed locally in your browser and not transmitted to any server; the output is downloaded directly from memory. Use hashes to verify integrity when sharing archives.

How‑to:

Follow these steps to compress files efficiently and verify the result.

  1. Add files or pick a folder; confirm the list reflects what you intend.
  2. Choose Algorithm suited to single‑file or multi‑file input.
  3. Set Compression level; higher trades time for smaller output.
  4. Enter Output name if you want to override the derived base.
  5. Open advanced options and toggle smart store, flatten paths, skip hidden, and exclusion globs.
  6. Use Split into parts if you plan to share by size‑limited channels.
  7. Start compression, then download the single file or all parts when ready.

Warning Splitting uses decimal megabytes; combine parts in order before verifying.

Example: Select 120 photos and 3 videos, choose ZIP with smart store on, set level 6, and export a single archive with a SHA‑256 hash for later checks.

  • Copy a CSV summary to compare before‑and‑after sizes later.
  • Save the JSON report alongside the archive for reproducibility.

You now have a portable archive with verifiable integrity and clear size savings.

FAQ:

Is my data stored?

No. Processing and hashing run in your browser; downloads are generated locally from memory. Nothing is uploaded or retained server‑side.

Which algorithms are supported?

ZIP (deflate), ZIP (store), TAR, TAR.GZ, TAR.BR, and single‑file GZ or BR. Multiple inputs with GZ/BR are automatically wrapped into TAR first.

Can I gzip multiple files?

Yes. Multiple files are grouped into a TAR stream and then compressed, producing .tar.gz. The same rule applies to Brotli as .tar.br.

What does smart compression do?

It stores many pre‑compressed types (media, archives, fonts) without deflation to avoid size growth, based on their extensions.

How is the SHA‑256 computed?

The digest covers the final blob. If split, parts are concatenated in order and the hash is computed over the merged bytes.

How accurate is the saving?

It uses exact byte totals; the displayed percentage is rounded to one decimal place for readability.

Which units are used?

Display labels KB/MB/GB use powers of 1024. Split size uses decimal megabytes where 1 MB equals 1×10⁶ bytes.

Does it work offline?

Yes. After the page loads, compression and hashing function without connectivity.

What about licensing?

No license text is declared in the package. Generated archives remain your files; verify any redistribution terms that apply to your content.

Troubleshooting:

  • “No files to include after applying filters.” Remove patterns or disable hidden‑file skipping.
  • “Brotli compression failed.” Switch to gzip or ZIP, then retry.
  • “Compression failed.” Retry with fewer files or without splitting to reduce memory pressure.
  • Hash not shown. Your platform may lack crypto.subtle; download is still valid.
  • Unexpectedly larger ZIP. Turn on smart compression or choose ZIP(Store) for pre‑compressed media.
  • Overlong paths in TAR. Enable flatten paths to avoid name trimming.

Advanced Tips:

  • Tip Use globs like *.mp4,*.zip to exclude bulky media and nested archives.
  • Tip Enable flatten paths when target systems dislike deep directory hierarchies.
  • Tip Raise levels for text‑heavy projects; lower them for quick, iterative packaging.
  • Tip Keep the JSON summary with the archive to document settings and inputs.
  • Tip Use splitting to bypass attachment limits while preserving one hash for all parts.

Glossary:

Archive
A container that packages one or more files.
ZIP (deflate)
ZIP entries compressed using the deflate method.
ZIP (store)
ZIP entries stored verbatim without compression.
TAR
A sequential file container without compression.
GZ / BR
Single‑file gzip or Brotli compressed streams.
TAR.GZ / TAR.BR
A TAR stream compressed by gzip or Brotli.
USTAR header
TAR layout with fixed fields and checksum.
SHA‑256
A 256‑bit hash used for integrity checking.
Glob
Pattern syntax for matching paths.
Dotfile
A file or folder whose name starts with a dot.