Skip to content
ENExplore Calculators

Archive Size Calculator

Estimate tar or zip archive output size from source file sizes and compression method.

About Archive Size Calculator

The tar format prefixes every file with a 512-byte header block and pads file content to 512-byte boundaries, so archiving many small files adds measurable overhead before compression even runs (512 bytes/file header, ~256 bytes/file average padding). After that overhead is added, the chosen compressor's typical savings — gzip and zstd around 60-70%, bzip2 65-75%, xz 70-80% for mixed data — determines the final archive size. xz achieves the best ratio but is markedly slower than zstd, which is often preferred for large backups where speed matters more than the last few percent of savings.

Formula

Archive size

archive_size = (sum(file_sizes) + file_count × 512 header + padding) × (1 − compression_savings)

s_i
size of file i
n
file count
c
compression savings fraction

Worked example

With the default values below, Archive Size Calculator returns Estimated Archive Size of 1.71 GiB. Change any input above and every figure here is recalculated in your browser.

Inputs used

Total Uncompressed Data Size (MB)minimum 0
5,000
Number of Filesminimum 0
2,000
Compression Methodone of None (plain tar), gzip (tar.gz) — ~60-70% typical savings, bzip2 (tar.bz2) — ~65-75% typical savings, xz (tar.xz) — ~70-80% typical savings, zstd (tar.zst) — ~60-70%, much faster
gzip (tar.gz) — ~60-70% typical savings

Results

Estimated Archive Size
1.71 GiB
Archive Size (MB)
1,750.51
Estimated Compression Savings
65.0%
Uncompressed tar Size (MB)
5,001.46
tar Header/Padding Overhead (MB)
1.465

Step by step

  1. 1Values used
  2. 2Archive size
  3. 3Estimated Archive Size= 1.71 GiB
  4. 4Archive Size (MB)= 1,750.51
  5. 5Estimated Compression Savings= 65.0
  6. 6Uncompressed tar Size (MB)= 5,001.46
  7. 7tar Header/Padding Overhead (MB)= 1.465

Assumptions and limits

  • The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 3 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

Why is tar overhead noticeable with many small files but not with a few large files?

The 512-byte header cost is per-file, not per-byte, so it scales with file count regardless of size. Archiving 100,000 tiny config files adds roughly 50MB of header overhead alone, while archiving 10 large video files adds only ~5KB — the same total data size produces very different overhead depending on file count.

Which compression method should I use for backups?

zstd is generally the best default for backups: it compresses nearly as well as gzip but several times faster, and supports very fast decompression. Reach for xz when archive size matters more than speed (e.g. long-term cold storage), and reserve bzip2 mainly for compatibility with older tooling.

Does compressing already-compressed files (like JPEGs) inside a tar.gz help?

Barely — media files are already near-incompressible, so wrapping them in tar.gz mainly adds the tar header overhead with little additional compression benefit. Plain tar (no compression) is often just as space-efficient and much faster for archives that are mostly media.

Archive Size Calculator – Calculate Estimated Archive Size