Online File Compressor
Compress one local file in your browser, choose ZIP, TAR, GZ, or Brotli output, then review size savings, SHA-256 integrity, and split parts.{{ resultsReady ? 'Archive Ready' : 'Compression Setup Ready' }}
| Metric | Value | Copy |
|---|---|---|
| Output file | {{ outputFilename }} | |
| Algorithm | {{ algorithmLabel }} | |
| Original size | {{ formatBytes(originalSize) }} | |
| Compressed size | {{ formatBytes(totalCompressedSize) }} | |
| Saving | {{ savingPercent }} % | |
| Parts | {{ parts.length }} | |
| SHA-256 | {{ sha256Hex }} |
Introduction
Compression is a practical trade between file size, compatibility, speed, and confidence that the bytes still match after a transfer. A smaller file can move through email limits, ticket systems, shared drives, and slower networks more easily, but the most useful format is often the one the receiving software already understands.
Two ideas are easy to mix up. Compression changes how bytes are represented so repeated patterns take less space. Archiving wraps data in a container so it can be handled as a known file type. A ZIP file can do both, a tar file is mainly a container, and gzip or Brotli output is usually a compressed stream for one input. Picking the right option means deciding whether size reduction, packaging, or downstream compatibility is the main goal.
Lossless compression is the normal choice for documents, logs, data exports, source files, and other content that must come back exactly as it started. It looks for repetition, predictable structure, and reusable byte patterns. Plain text, CSV, JSON, XML, and code often shrink well because field names, whitespace, timestamps, and similar records repeat. Photos, video, audio, PDFs, fonts, and existing archives often shrink very little because they already use dense encodings or their own compression.
- Container
- A wrapper such as ZIP or TAR that gives the output a familiar package structure.
- Compressed stream
- A single compressed byte stream such as gzip or Brotli, usually meant for one source file.
- Store mode
- Packaging without another compression pass, useful when the source is already dense.
- Integrity hash
- A digest that lets someone check whether the received output matches the produced output byte for byte.
The common mistake is chasing the highest compression level for every file. Higher levels can help text-heavy inputs, but they can waste time on already-compressed files and may even create a slightly larger result after wrapper overhead. For a handoff, a clear ZIP or tar choice can matter more than a small percentage change.
Compression also does not protect content by itself. A compressed file is still readable by anyone who can open the format, and a matching hash only proves that the packaged bytes were not changed after creation. Encryption, malware review, access control, and file-type trust are separate questions.
The original file supplies the size, name, and byte pattern that determine whether compression can help.
The chosen format decides whether the result is a container, a compressed stream, or both.
The finished output can be compared by size and verified later with an integrity hash.
How to Use This Tool
- Select or drop one source file. If more files are supplied, the tool keeps the first file and reports how many extras were ignored.
- Choose the output format. Use ZIP for broad handoff, TAR or tar-plus-compression when a Unix-style package is expected, and GZ or BR when a single-file compressed stream is the right target.
- Set the compression level when the chosen format supports it. ZIP and GZ use levels 0-9. Brotli modes use levels 0-11. TAR and ZIP Store ignore the level because they package without shrinking.
- Set the output base name if the default name is not what you want. The tool adds the selected extension.
- Leave smart compression on for ZIP Deflate unless you need to force DEFLATE on every ZIP entry. It stores common already-compressed types such as media, PDFs, archives, and fonts without wasting another compression pass.
- Use split parts only when a known upload or attachment limit requires it. The split size is decimal MB, so
50means about 50,000,000 bytes per part. - Run compression, then keep the download and any reporting exports you need. The result panel can copy or download the metrics table, export a DOCX summary, copy the SHA-256 value, save the size chart, and copy or download JSON.
The first completed run starts the download automatically. After that, the on-screen result remains available so you can re-download, copy the checksum, or keep a summary for a transfer record.
Interpreting Results
Read the size change together with the file type. A large positive saving on a log, CSV, or JSON export usually means the input contained repeated structure that the compressor could encode efficiently. A small saving on a photo, MP4, PDF, font, or existing archive is normal and may still be the correct result if the goal was packaging rather than reduction.
A negative saving is not automatically an error. Containers have headers, directory records, checksums, timestamps, or stream metadata, and those bytes can outweigh compression gains on very small or already dense inputs. In that situation, a store mode or different wrapper may be clearer than trying higher compression levels.
The SHA-256 value is an integrity check for the finished output. If the receiver calculates the same SHA-256 digest over the downloaded archive or over the recombined split output, the bytes match exactly. It does not prove that the contents are safe, private, original, or approved.
| Result | Likely meaning | Useful follow-up |
|---|---|---|
| High positive saving | The source has repeated text, records, whitespace, or other patterns that compress well. | Keep the format and decide whether a higher level is worth the extra wait. |
| Near-zero saving | The input is small, already compressed, or not repetitive enough for a visible gain. | Use ZIP Store or TAR if compatibility matters more than size. |
| Negative saving | The wrapper or stream overhead is larger than any reduction achieved. | Try a store mode, skip recompression, or keep the result only if the wrapper is required. |
| Multiple part files | The finished output exceeded the requested part size and was sliced into numbered downloads. | Send or store every part together; losing one part breaks the finished output. |
| Matching SHA-256 | The copied or received output matches the original compressed output byte for byte. | Use the hash as an integrity check, then apply normal file safety checks separately. |
Technical Details
Lossless compressors reduce size by replacing repeated byte patterns with shorter references and coding frequent symbols with fewer bits. DEFLATE, the compression method used by gzip and common ZIP entries, combines LZ77-style back references with Huffman coding. Brotli is also lossless and uses a modern dictionary and context-modeling design that can perform well on text-heavy data, especially when the receiving workflow already accepts .br output.
Container formats and compression formats solve different parts of the job. A ZIP output carries file records and may store or deflate each entry. A tar output writes fixed-size headers and padded file data, then tar.gz and tar.br compress that tar byte stream. A raw gzip or Brotli stream is better described as one compressed file, not a multi-file archive.
Transformation Core
| Mode | Output behavior | Level behavior | Best fit |
|---|---|---|---|
| ZIP (Deflate) | Builds a ZIP container and compresses entries with DEFLATE unless smart compression stores common dense file types raw. | 0-9 | General sharing where ZIP compatibility matters and some files may shrink. |
| ZIP (Store) | Builds a ZIP container without compression. | Ignored | Packaging already-compressed files or preserving a familiar wrapper with minimal processing. |
| TAR | Builds a tar container without compression. | Ignored | Workflows that expect tar packaging before another step. |
| TAR.GZ | Builds a tar container, then applies gzip compression to the tar bytes. | 0-9 | Unix-style handoff where tar plus gzip is expected. |
| TAR.BR | Builds a tar container, then applies Brotli compression to the tar bytes. | 0-11 | Tar-based output for systems that already accept Brotli. |
| GZ | Compresses the single selected file as a gzip stream. | 0-9 | Single-file transfer, logs, and command-line workflows that expect .gz. |
| BR | Compresses the single selected file as a Brotli stream. | 0-11 | Text-heavy files where Brotli support is already available. |
Formula Core
The saving percentage compares the final downloadable bytes with the original source size. When split parts are created, the compressed size is the combined size of all parts, because those are the bytes that must be transferred or stored.
Here So is the original file size and Sc is the finished compressed size, or the total of all split parts. For example, a 120 MB source that produces 30 MB of output has a saving of (1 - 30 / 120) x 100 = 75%. A 2 MB source that produces a 2.1 MB archive has a saving of -5%, which means the archive is larger than the source.
Split Parts
Splitting does not create independent mini-archives. It slices the finished output into numbered part files after compression. The part size uses decimal megabytes, so the threshold is the entered MB value multiplied by 1,000,000 bytes.
If the finished output is smaller than the requested threshold, no split is made. If the output is larger, file names are numbered with suffixes such as .part01 and .part02. The SHA-256 digest is calculated over the full compressed output, not over each part separately.
Privacy, Limits, and Safety Notes
Compression and SHA-256 hashing run in the browser session. The selected file is not sent to a compression server by the tool. Normal page resources still load from the web, so this should not be treated as an offline air-gapped workflow.
The workflow is intentionally single-file. It is not a folder archiver, recursive backup utility, encryption tool, malware scanner, or decompressor. For tar output, the focus is simple tar-style packaging of the selected file rather than preserving a directory tree with rich filesystem metadata.
Very large files depend on available browser memory and CPU time. If a browser tab becomes slow or fails during a high-level Brotli or large archive run, try a lower level, a store/container mode, or a dedicated desktop archiver for that workload.
Worked Examples
-
Sending a log file to support
A plain-text log often contains repeated timestamps, level names, request paths, and field labels. Choose GZ for a direct compressed stream or ZIP (Deflate) when the recipient prefers a ZIP file. After the run, compare the original and compressed sizes and copy the SHA-256 value so the receiver can verify the download. -
Wrapping a PDF without expecting much shrinkage
A PDF may already contain compressed images and internal streams. If the goal is a familiar attachment format, ZIP (Store) is often clearer than forcing more compression. If you choose ZIP (Deflate) with smart compression on, the file can be stored raw inside the ZIP when its extension is a poor recompression candidate. -
Keeping a data export under an upload cap
Suppose a CSV export is too large for a 50 MB ticket attachment limit. Choose ZIP (Deflate) or GZ, set a split size such as 45, and run compression. Keep every numbered part and the JSON or CSV summary so the transfer has both a part list and an integrity hash.
FAQ:
Does compression change the original file?
No. Lossless compression creates a new output file or stream. The selected source file is used as input and is not modified.
Why does the tool process only one file?
The workflow is built for one source file per run so the size comparison, checksum, output name, and optional split parts are unambiguous. Extra selected files are ignored and counted.
Should I use ZIP Deflate or ZIP Store?
Use ZIP Deflate when the source may shrink and a ZIP wrapper is useful. Use ZIP Store when the source is already compressed or the wrapper matters more than size reduction.
What does smart compression skip?
For ZIP Deflate, smart compression stores many image, audio, video, PDF, font, archive, package, and disk-image extensions raw instead of trying to deflate them again.
Why did a higher level not make the output smaller?
Higher levels search harder for useful patterns, but they cannot create repetition that is not there. Dense or already-compressed files may show little change, and wrapper overhead can dominate small files.
Can split parts be opened separately?
No. The parts are slices of one finished output. Keep all numbered parts together and recombine them before opening the archive or stream.
Is SHA-256 the same as encryption?
No. SHA-256 creates a fixed integrity digest. It helps detect changed bytes, but it does not hide file contents or control who can read them.
Glossary:
- Lossless compression
- Compression that preserves enough information to reconstruct the original bytes exactly.
- Archive container
- A file format that wraps data in a known structure, with or without compression.
- DEFLATE
- A widely used lossless compressed data format based on repeated-string references and Huffman coding.
- Gzip
- A single-file compressed format that commonly carries DEFLATE-compressed data with gzip wrapper fields.
- Brotli
- A lossless compressed data format that can work well on text-heavy input and is defined separately from gzip and ZIP.
- TAR
- A container format that stores file records in 512-byte blocks and is commonly compressed afterward as tar.gz or tar.br.
- SHA-256
- A 256-bit secure hash algorithm used here as an integrity check for the finished output.
- Split part
- One numbered slice of a finished compressed output, created to fit a transfer or storage limit.
References:
- APPNOTE.TXT - .ZIP File Format Specification, PKWARE.
- DEFLATE Compressed Data Format Specification version 1.3, IETF.
- GZIP file format specification version 4.3, IETF.
- Brotli Compressed Data Format, IETF.
- GNU tar and POSIX tar, GNU Project.
- Secure Hash Standard, National Institute of Standards and Technology.