Do gzip, bzip2 and ISO Files Have Metadata?

📄 7 min readUpdated November 15, 2026

Some do. A .gz file usually carries the original file name and its modified date, and an ISO image records when it was built, the clock offset of the computer that built it and a program name. bzip2, xz and zstd files store no name or date at all. None of them touch the metadata inside the files you pack, so a photo keeps its GPS tags.

Which compressed formats store a file name or date?

We packed the same 2,680-byte text file, dated March 14, 2026 at 09:26:53 UTC, with GNU gzip 1.12, bzip2 1.0.8, XZ Utils 5.4.1, zstd 1.5.4 and 7-Zip 26.02 on Debian 12. ISO images came from the pycdlib Python library, because no ISO burner was installed.

FormatOriginal nameDateOther fields we found
gzip (.gz)Yes, by defaultYes, by defaultOperating system code, compression level, size
bzip2 (.bz2)NoNoBlock size only
xz (.xz)NoNoOriginal size, checksum type
zstd (.zst)NoNoOriginal size, when compressing a file
ISO 9660 (.iso)Yes, every fileYes, image and every fileTime zone offset, program, publisher and preparer fields

What's in a gzip header?

Ten fixed bytes, then an optional name. They hold a modified time, a compression-level hint and an operating system code. RFC 1952, the gzip spec, lists codes such as 0 for FAT, 3 for Unix and 11 for NTFS, so the byte hints at the kind of machine that made the file. GNU gzip at -9 wrote 2 in the level byte and at -1 wrote 4.

How the .gz was madeName storedDate storedOS code
gzip tax-2025-return.txttax-2025-return.txtThe file's modified time3 (Unix)
gzip -nNoneZero3 (Unix)
gzip -c < file > out.gzNoneThe file's modified time3 (Unix)
cat file | gzipNoneZero3 (Unix)
tar -czfNoneZero3 (Unix)
gzip on a finished .tarThe .tar's nameThe .tar's modified time3 (Unix)
Python gzip.open()The output name minus .gzThe second we ran it255 (unknown)
7-Zip, gzip typetax-2025-return.txtThe file's modified time3 (Unix)

Redirecting a file in with < dropped the name but kept the date, since gzip could still see the file. A real pipe stored zero, though RFC 1952 says a stream should carry the time compression started, so other gzip programs may differ.

Does gunzip bring back the old file name?

Not unless you ask. We renamed a .gz to holiday-photos.gz and ran gunzip -k: the output was called holiday-photos and carried the .gz file's own date. With gunzip -N it came back as a.txt, dated March 14. Anyone can read the stored name without unpacking: 7z l -slt printed the original name, date and "Host OS = Unix". The tar side of a .tar.gz, with its user and group names, is covered in our 7z, RAR and tar guide.

Do bzip2, xz and zstd files store anything?

Very little. The bzip2 file opened with "BZh9" and a block marker, and the format has no name, date or size field. The xz header held only a checksum type (CRC64), though xz -lvv read the original size, 2,680 bytes, from the index at the end. zstd wrote the size into its frame header when compressing a file, and left it out when reading standard input or with --no-content-size. A byte search found neither the name nor the date in any of the three.

The date still travels another way. All three copy the source file's modified time onto the compressed file on disk, and onto the file you unpack. Copy the files without keeping dates and the unpacked files get the copy time instead. We checked.

What does an ISO image record?

The volume descriptor at byte 32,768 has text fields for the system, volume, publisher, data preparer and application, plus four dates. We built one image with pycdlib's defaults and one with every field filled in.

Fieldpycdlib defaultOur filled-in test
System IDBlankLINUX
Volume IDBlankTAX_2025
PublisherBlankJ SMITH
Data preparerBlankJSMITH LAPTOP
ApplicationPyCdlib (C) 2015-2020 Chris LalancetteMY BURNER 2.1
Created / modifiedBuild time, local clockBuild time, local clock
Each file's dateBuild timeBuild time
Rock Ridge owner and mode0, 0, read-only (0444)0, 0, read-only (0444)

The genisoimage man page describes the publisher and preparer fields as "usually with a mailing address and phone number", with room for 128 characters. The xorrisofs man page says its preparer field normally holds the xorriso program ID. We read both pages today but didn't run either program, so we can't say what they fill in by default.

7-Zip's listing of the filled-in image didn't print the publisher or preparer, but a plain byte search found "J SMITH". A Joliet image repeats the fields in a second, UTF-16 descriptor.

Can an ISO reveal your time zone?

Yes. Every ISO 9660 date ends with an offset from GMT, counted in 15-minute steps. Built on our machine at UTC+11, the byte read 44. We built again with the TZ variable set to UTC and got 0, and set to America/Chicago we got -24, which is six hours behind. pycdlib also stamped every file inside with the build time.

Does Rock Ridge store your user ID?

It can. Rock Ridge adds Unix owner, group and permission bits to each file. pycdlib wrote owner 0, group 0 and read-only permissions. Both man pages say -r sets user and group IDs to zero, which implies plain -R keeps the IDs from your disk. xorrisofs adds Rock Ridge by default. We didn't test genisoimage, xorriso, Windows' built-in burner, macOS Disk Utility or any commercial burning app.

How do you make a cleaner .gz or ISO?

GoalCommandWhat we saw after
New .gz with no name or dategzip -n fileName flag off, date zero
Clean an existing .gzgzip -dc old.gz | gzip -n > clean.gzName and date gone, contents identical
zstd without the sizezstd --no-content-sizeSize field gone from the frame header
ISO with no program namepycdlib with a blank application IDApplication field blank

Each cleaned file unpacked to a matching SHA-256. The xorrisofs man page documents --modification-date and SOURCE_DATE_EPOCH for fixed image dates; we didn't run them. Renaming a .gz doesn't change the name stored inside.

Does compressing a file remove its metadata?

No. We packed a test photo with GPS tags and a Word file through gzip, gzip -n, bzip2, xz, zstd and an ISO, then unpacked all twelve. Every copy had the same SHA-256 as its original, and the photo still held its latitude and longitude.

So clean files before you pack them. Our Image Metadata Remover takes JPEG and PNG, and the Document Metadata Remover takes Word, Excel, PowerPoint and PDF. The EXIF Viewer shows what a photo holds, and the PDF Metadata Editor edits PDF fields. None open .gz or .iso files. ZIP has its own fields, covered in our ZIP guide, and photo location is in how to remove location from photos.

Frequently Asked Questions

Does a .gz file store the original file name?

Usually. GNU gzip stored both when it compressed a file. gzip -n, tar -czf and a plain pipe stored no name and a zero time.

Does bzip2 store the file name or date?

No. Our bzip2 file held only BZh9 and a block marker, with no name, date or size. The unpacked file takes its date from the .bz2 file on disk.

Can an ISO file show who made it?

It can. The volume descriptor has publisher, preparer and application fields holding whatever the burning program writes.

Does an ISO file reveal your time zone?

Yes. Each ISO 9660 date ends with a GMT offset in 15-minute steps. Our image built at UTC+11 stored 44, and builds set to UTC and Chicago stored 0 and -24.

Does compressing a photo remove its EXIF data?

No. We sent a photo through gzip, bzip2, xz, zstd and an ISO, and every unpacked copy matched the original byte for byte, GPS tags included.

Related Tools