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.
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.
| Format | Original name | Date | Other fields we found |
|---|---|---|---|
| gzip (.gz) | Yes, by default | Yes, by default | Operating system code, compression level, size |
| bzip2 (.bz2) | No | No | Block size only |
| xz (.xz) | No | No | Original size, checksum type |
| zstd (.zst) | No | No | Original size, when compressing a file |
| ISO 9660 (.iso) | Yes, every file | Yes, image and every file | Time zone offset, program, publisher and preparer fields |
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 made | Name stored | Date stored | OS code |
|---|---|---|---|
gzip tax-2025-return.txt | tax-2025-return.txt | The file's modified time | 3 (Unix) |
gzip -n | None | Zero | 3 (Unix) |
gzip -c < file > out.gz | None | The file's modified time | 3 (Unix) |
cat file | gzip | None | Zero | 3 (Unix) |
tar -czf | None | Zero | 3 (Unix) |
gzip on a finished .tar | The .tar's name | The .tar's modified time | 3 (Unix) |
Python gzip.open() | The output name minus .gz | The second we ran it | 255 (unknown) |
| 7-Zip, gzip type | tax-2025-return.txt | The file's modified time | 3 (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.
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.
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.
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.
| Field | pycdlib default | Our filled-in test |
|---|---|---|
| System ID | Blank | LINUX |
| Volume ID | Blank | TAX_2025 |
| Publisher | Blank | J SMITH |
| Data preparer | Blank | JSMITH LAPTOP |
| Application | PyCdlib (C) 2015-2020 Chris Lalancette | MY BURNER 2.1 |
| Created / modified | Build time, local clock | Build time, local clock |
| Each file's date | Build time | Build time |
| Rock Ridge owner and mode | 0, 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.
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.
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.
| Goal | Command | What we saw after |
|---|---|---|
| New .gz with no name or date | gzip -n file | Name flag off, date zero |
| Clean an existing .gz | gzip -dc old.gz | gzip -n > clean.gz | Name and date gone, contents identical |
| zstd without the size | zstd --no-content-size | Size field gone from the frame header |
| ISO with no program name | pycdlib with a blank application ID | Application 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.
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.
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.
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.
It can. The volume descriptor has publisher, preparer and application fields holding whatever the burning program writes.
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.
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.