Guide
Does Compressing a File Remove Its Metadata?
Usually not. Of the seventeen routes measured below, twelve carried the metadata straight into the smaller file. ImageMagick, sips and ffmpeg all kept the GPS coordinates, the camera serial number and the capture time, and the PDF presets kept every author name.
The exceptions are the interesting part. WebP’s reference encoder strips by default. Ours strips for JPEG output and keeps everything for PDF, video and audio, which is three different answers inside one application. That asymmetry has a cause, and it is the same cause in every tool.
Measured on 26 September 2026 on a MacBook Pro (M2 Pro, 16 GB) running macOS 27.0 build 26A428, with exiftool 13.50, ImageMagick 7.1.2-22 and ffmpeg. The test image is synthetic: an Apple system wallpaper with an invented tag set, 611,419 bytes carrying 39 EXIF, 9 GPS, 7 IPTC, 7 XMP and 25 ICC tags. Its coordinates point at the public Prime Meridian marker in Greenwich.
Which compressors strip metadata and which keep it?
The image and video rows are the same source files throughout, where survival means all 9 GPS tags. The PDF row means its 10 Document Info keys and 13 XMP tags.
| Tool and settings | Output | Size | Metadata survives? |
|---|---|---|---|
magick, resize 2000, quality 75 | JPEG | 76,498 B | Yes |
magick -strip | JPEG | 68,290 B | No |
sips -Z 2000 | JPEG | 178,248 B | Yes |
sips, quality 75 | JPEG | 737,353 B (+20.6%) | Yes |
cwebp -q 75 | WebP | 26,254 B | No |
cwebp -metadata all | WebP | 34,292 B | Yes |
magick to WebP | WebP | 34,840 B | Yes |
magick to AVIF | AVIF | 17,343 B | Yes |
magick to HEIC | HEIC | 37,655 B | Yes |
zip -9 then unzip | JPEG | 611,419 B (identical) | Yes |
| Smol image compression, default | JPEG | 90,912 B | No |
| Smol, metadata stripping switched off | JPEG | 90,930 B | No |
| Smol, metadata stripping off, WebP output | WebP | 34,840 B | Yes |
| Smol PDF compression, Tiny preset | 57,377 B, 64.6% smaller | Yes | |
| Smol video compression | MP4 | 117,808 B | Yes |
| ffmpeg re-encode, libx264 CRF 28 | MP4 | 100,492 B, 14.8% smaller | Yes |
ffmpeg -map_metadata -1 | MP4 | 117,713 B | No |
Two of those deserve a second look. sips, the tool already on your Mac, made the file 20.6% larger at quality 75 and then added metadata: IPTC went from 7 tags to 14 and XMP from 7 to 13, with a Photoshop resource block appearing out of nowhere. It is the only tool tested that finished with more metadata than it started with.
And zipping does nothing. The file that came out of the archive was byte-for-byte identical to the one that went in, all 39 EXIF tags present. Archive compression operates on the file as an opaque blob. It has no idea what an EXIF tag is.
Why do the defaults disagree so much?
Because metadata stripping is a decision each encoder makes independently, and most of them decided to preserve. The reasoning is sound from where they sit: an ICC profile affects how the image renders, a copyright line is somebody’s legal position, and an orientation tag decides whether the photo appears sideways. Throwing those away by default breaks more workflows than it protects.
libwebp went the other way. cwebp drops everything unless you ask for it, which is why the same image came out at 26,254 bytes with no metadata and 34,292 bytes with it. The metadata is 8,038 bytes, which is 23% of the file that keeps it. For a format built for the web, dropping it by default was the right call.
The practical consequence is that you cannot reason about this from the word “compress”. Whether your GPS coordinates survive depends on which library your tool shells out to and which flags it passes, and neither of those is usually visible in the interface.
Why does one app answer this three different ways?
Ours does, so here it is in full. These defaults are quoted from the settings the app itself reports back with every job, not from a manual.
| Operation | Default | Measured result |
|---|---|---|
| Image compression | stripMetadata: true | JPEG output had zero EXIF, GPS, IPTC, XMP, ICC and JFIF tags |
| PDF compression, all five presets | No metadata setting exists | All 10 Document Info keys, all 13 XMP tags, 3 comment authors and 1 attachment survived |
| Video compression | No metadata setting exists | Title, artist, comment, GPS position and shooting location all survived |
| Audio compression | stripMetadata: false | Title, artist, album, genre, comment and album artist all survived |
| Strip metadata | Separate operation | Removes everything on images and PDFs; refused MP4 and M4A in testing |
The honest explanation is that these are four different pipelines with four different encoders behind them, and the default in each case is whatever that encoder does. On the JPEG path the setting does not even change the outcome: with metadata stripping explicitly switched off, the output was 90,930 bytes with zero EXIF, GPS, IPTC, XMP or ICC tags and only the four-tag JFIF header restored. An 18-byte difference.
Switch the output to WebP with the same setting and all 39 EXIF, 9 GPS, 7 XMP and 25 ICC tags come through. That file was byte-identical to ImageMagick’s own WebP output, SHA-256 and all, which is the whole explanation: on that path the app is ImageMagick, and ImageMagick preserves.
The default that catches people out is not the metadata one. Image compression also defaults to resizing: maxWidth and maxHeight of 2,000 and quality 75. The 4,032 × 3,024 test image came out at 2,000 × 1,500. That is a sensible default for sharing and the wrong one for archiving.
Does compressing a PDF remove its metadata?
No, in every tool we have measured, and PDFs are where this matters most because the tags carry names rather than coordinates.
Our Tiny preset took the test contract from 162,058 to 57,377 bytes, a 64.6% reduction, and kept all 10 Document Info keys, all 13 XMP tags, all three comment author names and the embedded attachment. Medium landed at 74,008 bytes with the same result. Ghostscript took the same file to 139,864 bytes and copied Author, Title, Subject, Keywords and Creator across unchanged, replacing only the Producer string with its own.
There is one thing compression does remove, and it is the opposite of what you would guess. Rebuilding the file collapses its incremental-update history, so the previous versions of the metadata are gone even though the current version is not. Stripping does the inverse: it clears the current tags and leaves the history recoverable. That is why cleaning a PDF properly takes two commands.
Does compressing a video remove its GPS?
No. A phone video carries coordinates in the same way a photo does, and re-encoding it copies them into the new file.
Our test clip went through ffmpeg with libx264 at CRF 28, coming out 14.8% smaller at 100,492 bytes, and still reported its title, artist, comment, GPS position and the full shooting-location record. Our own video compression produced 117,808 bytes with exactly the same tags intact.
The flag that actually removes them:
ffmpeg -i clip.mp4 -map_metadata -1 -c copy clean.mp4That left nothing but ffmpeg’s own encoder string, at 117,713 bytes, with no re-encode and therefore no quality loss. exiftool -all= clip.mp4 also works and leaves a container creation date behind in the movie header.
How do you check rather than guess?
One command, before and after, on whichever tool you actually use:
exiftool -a -G1 -GPSLatitude -GPSLongitude -SerialNumber \
-DateTimeOriginal -Artist before.jpg after.jpgAnything that prints on the “after” side survived. Do this once per tool rather than once per file; the behavior is a property of the encoder and its settings, not of the photograph.
For a folder, exiftool -r -if '$gpslatitude' -p '$filename' dir/ lists every file that still has coordinates. More of these in our exiftool reference for macOS.
The rule of thumb that survives all of this: if you need the metadata gone, remove it explicitly. Compression is not a privacy operation and no tool has promised that it is.
When Smol is not the answer
If your question is only “how do I get the metadata off this file”, the answer is exiftool -all= file.jpg. Free, four seconds, and the output is byte-identical to what our strip operation produces, because our strip operation is exiftool with a bundled binary. On a folder, one exiftool process is several times faster than we are.
We are also the wrong tool if you want metadata preserved through compression on the JPEG path, which is a real requirement for photographers who need their copyright line to survive. Switching our metadata setting off did not bring EXIF back on that path. ImageMagick with no flags at all does exactly what you want: 76,498 bytes with all 39 EXIF tags intact.
Where a drop target is the right shape:
- You want smaller and cleaner in one pass, without running two tools over the same folder.
- You want the original left alone automatically rather than remembering an overwrite flag.
- Someone else has to do this repeatedly and will not be installing Homebrew.
Smol is $29 once. If you are here because you are about to post photos publicly, the more useful page is our checklist for sharing photos safely, and if you want to know what these tags are before deciding, what EXIF data actually contains walks a real tag dump line by line.
Frequently asked questions
Does compressing an image remove its EXIF data?
Usually not. ImageMagick at quality 75 with a resize to 2000 px kept all 39 EXIF tags, all 9 GPS tags, 7 IPTC, 7 XMP and 25 ICC tags on our test file. sips kept them too and added more. The WebP reference encoder cwebp is the main exception, dropping everything unless you pass -metadata all. If you need the metadata gone, remove it explicitly with exiftool -all=.
Does resizing a photo remove the GPS coordinates?
No. Resizing changes pixel dimensions and has nothing to do with the metadata blocks, which sit in separate marker segments at the front of the file. sips -Z 2000 took our 4032 by 3024 test image down to 2000 by 1500 and all 9 GPS tags came through unchanged, along with the camera serial number and the capture timestamp.
Does zipping a file remove its metadata?
No, and it cannot. Archive compression treats the file as an opaque blob. We zipped the test image at maximum compression and unzipped it, and the result was byte-for-byte identical to the original with all 39 EXIF tags and 9 GPS tags present. The same is true of any archive format.
Does compressing a PDF remove the author name?
No. Our Tiny preset took a test contract from 162,058 to 57,377 bytes, a 64.6% reduction, and every one of its 10 Document Info keys, 13 XMP tags, three comment author names and its embedded attachment survived. Ghostscript behaves the same way, copying Author, Title, Subject, Keywords and Creator into its output while replacing only the Producer string.
Does compressing a video remove its location data?
No. Re-encoding our test clip with ffmpeg at CRF 28 made it 14.8% smaller and kept the title, artist, comment, GPS position and shooting-location record. Use ffmpeg -i clip.mp4 -map_metadata -1 -c copy clean.mp4 to remove them, which also avoids a re-encode, or exiftool -all= which leaves only a container creation date behind.
Why does the same app strip metadata from images but not PDFs?
Because each file type runs through a different encoder and inherits that encoder’s default. In Smol, image compression defaults to stripping, audio compression defaults to keeping, and the PDF and video pipelines have no metadata setting at all. On the WebP output path the app produced a file byte-identical to ImageMagick’s, which preserves metadata, so the metadata survived there too.
Keep reading