Does Compressing a Photo Remove Its Metadata?
← All posts
photo compression metadatacompress photo EXIFreduce file size metadataimage quality metadata

Does Compressing a Photo Remove Its Metadata?

Compressing a photo shrinks its pixel data, but EXIF, GPS and XMP metadata often survive untouched. Here's why a smaller file size doesn't mean clean.

Photo by Arina Krasnikova on Pexels

TL;DR: Compressing a photo and removing its metadata are two separate operations, and one does not guarantee the other. JPEG compression works on the image data — the DCT coefficients that the quality setting quantizes — while EXIF, GPS, IPTC and XMP live in separate marker segments (APP1 and APP13) that a compressor can copy across untouched. So a re-saved, smaller file can still carry your camera serial number, the capture timestamp and exact GPS coordinates. Some tools do strip metadata as a side effect: Photoshop's Save for Web and many online compressors drop most tags by default, while "Save As," resizing in a basic viewer, and phone "optimize storage" generally keep them. Because you cannot tell from file size whether metadata survived, the reliable approach is a dedicated, lossless metadata strip that removes the tags without re-compressing the pixels.

Does compressing a photo remove its metadata?

Sometimes — and that "sometimes" is exactly the problem. Compression is not designed to remove metadata, and whether the metadata disappears is a side effect of which tool you used and how it was configured, not a guarantee you can lean on. Run the same image through three different compressors and you can get three different results: one strips everything, one keeps the lot, and one quietly preserves the GPS coordinates while dropping the copyright line you actually wanted to keep.

The reason for the confusion is that both operations make the file change and one of them makes it smaller, so people assume they are the same act. They are not. Compression rewrites the picture; metadata removal deletes the record about the picture. A tool can do either without doing the other. That is why "I compressed it before I posted it" is not a privacy strategy — it is a coin flip, and you do not get to see which way it landed unless you go and read the fields yourself.

Why are compression and metadata removal different operations?

To see why a smaller file can still be a leaky file, it helps to know where the two kinds of data actually live inside a JPEG. The file is a sequence of marker segments. The picture itself is stored as entropy-coded scan data, sitting after the quantization tables (DQT), the start-of-frame marker (SOF) and the Huffman tables (DHT). The metadata lives somewhere else entirely: the APP1 segment that begins with the bytes Exif\0\0 holds the EXIF block — DateTimeOriginal, the camera Make, Model and Software, and the nested GPS IFD with your latitude and longitude. A second APP1 can carry an XMP packet, and the APP13 segment holds the Photoshop resource block where IPTC captions and keywords sit. If you have never looked at these fields directly, our primer on what EXIF data actually is lays out what a camera writes into every frame.

When you move a JPEG's quality slider, you are changing the quantization step applied to the image's DCT coefficients — coarser quantization throws away more high-frequency detail, which is what shrinks the scan data and softens the picture. That process touches the DQT tables and the entropy-coded data and nothing else. The APP1 and APP13 segments are not part of the picture, so a compressor is free to copy them, byte for byte, into the smaller output file. The result is a photo that is half the size and still carries every coordinate, serial number and timestamp it started with. The three metadata standards that coexist in one image — covered in IPTC vs EXIF vs XMP — each ride along in their own segment, and a quality change does not single any of them out for deletion.

A smartphone screen displaying a grid of photos in a gallery app Photo by Airam Dato-on on Pexels.

This separation is why the embedded thumbnail is such a reliable survivor. Cameras tuck a small preview image inside the EXIF block, and because compressing the main image does not parse or rebuild the APP1 segment, that thumbnail typically comes through compression intact — sometimes still showing the uncropped original frame even after you have cropped and shrunk the photo you can see. The same logic applies across formats. Converting to a more efficient codec does not clear the slate: WebP keeps EXIF and XMP in its own chunks, which is why we have a separate walkthrough on removing metadata from a WebP file, and HEIC stores EXIF inside a meta box, as our HEIC versus JPEG comparison explains. Smaller, newer and more compressed does not mean cleaner.

Which compression tools strip metadata, and which keep it?

The honest answer is that you have to know your specific tool, because the behavior varies wildly even within a single application. Photoshop is the clearest illustration. Its Save As and Save a Copy paths preserve all metadata, EXIF included. Its Export As is far more aggressive, offering only a couple of choices — no metadata, or copyright and contact information only. And the older Save for Web dialog gives you a metadata dropdown ranging from None up through "All except Camera Info" to "All," which Adobe documents in its Save for Web guide. One program, the same source image, three completely different metadata outcomes depending purely on which menu you picked.

Web-based compressors lean the other way. Many of the popular online image optimizers strip metadata by default as part of squeezing the file — their goal is the smallest possible byte count, and the EXIF block is dead weight to them, so it goes. That is convenient if removal is what you wanted, but it is a default, not a promise: a tool can change that behavior in an update, some offer a "preserve" option that an account or API can switch back on, and you generally cannot inspect what a remote service actually did to your file. And there is a deeper catch with anything server-side, which we will come back to.

At the other extreme, the everyday acts people most often mistake for cleaning do nothing of the sort. Resizing a photo in a basic viewer such as Preview usually writes out a smaller image with the EXIF — GPS and all — carried straight across. A phone's "optimize storage" setting downsamples the copies it keeps on the device to save space, but it does not scrub the descriptive data, and the version you actually share is typically the full original anyway. The GPS field is the one most people most want gone, and casual resizing is exactly the kind of step that leaves it sitting in the file; our explainer on how GPS coordinates get embedded in photos shows how stubborn that tag is.

How do you make sure a compressed photo has no metadata?

Stop trying to make one operation do two jobs. If your goal is a smaller file and no metadata, do the removal deliberately and let compression be its own separate step. The most reliable order is to strip first, then compress only if you still need to.

Strip the metadata with a tool built for it. Open Metadata Cleaner in any browser and drop in the photo. It performs a container rewrite — it copies the image data into a fresh file and simply omits the APP1, APP13 and comment segments — so the EXIF, the GPS IFD, the IPTC and XMP packets, the MakerNote and the embedded thumbnail all come out, while the visible pixels stay byte-for-byte identical. Nothing is re-compressed, so unlike "compress it to clean it," you lose no quality at all. The mechanics of that lossless rewrite are the subject of our deeper piece on how metadata scrubbing works. If you would rather do it inside the operating system, our cross-platform guide to stripping EXIF data from a photo covers Mac, Windows and iPhone.

Then, and only if you actually need the file smaller, compress the cleaned copy. Because the metadata is already gone, the compressor has nothing to carry forward — you get the size reduction without the leak. Finally, verify. The single most useful habit here is to never trust file size as a proxy for privacy: a 200 KB photo can carry exactly the same coordinates as the 6 MB original. Re-open the finished file and confirm the fields are empty before you share it. The Electronic Frontier Foundation's work on privacy makes the broader case that the safest data is the data you never expose in the first place — and where your file goes during this process matters as much as what happens to it.

A person working with digital photos on a laptop at a desk Photo by cottonbro studio on Pexels.

That last point is worth dwelling on. If your reason for cleaning a photo is that you do not want your home coordinates in the wild, uploading the original to a remote compression service to have it shrunk — and incidentally stripped — defeats the purpose, because the unprotected file has already left your device. A tool that does the work locally, in the browser, never transmits the data you are trying to remove. When you choose how to clean a file, "where does my photo go?" is the first question, not an afterthought.

What compression does not do for your metadata

Being clear about the limits is what separates a useful method from a false sense of security, and there are several worth stating plainly.

Compression never touches what the picture shows. Shrinking the file does nothing to a house number, a street sign, a face or a reflection in a window — visual information lives in the pixels, and a smaller photo shows the same scene. It also cannot reach a copy you have already shared: once an original is uploaded, any version a platform or recipient kept still carries its data, and compressing your local file afterwards does not claw that back. Clean first, share second.

There are subtler gaps too. The IPTC photo-metadata model, maintained by the IPTC standards body, defines fields that editors embed precisely so they travel with the image — which is part of why a quality change leaves them in place rather than clearing them. Metadata can also sit in a sidecar file beside the image, entirely outside the photo, where nothing you do to the JPEG will affect it. And provenance standards such as C2PA Content Credentials are designed to be re-attached: stripping or recompressing a file can remove a manifest, but re-processing it through certain editors writes a fresh one, as the Content Authenticity Initiative describes. Compression is not a metadata tool, and treating it like one leaves all of these untouched.

The bottom line

Compressing a photo changes the picture; removing its metadata deletes the record attached to the picture. They are different jobs, they live in different parts of the file, and doing one tells you nothing reliable about the other. A compressor might strip your EXIF, or it might shrink the file to a fraction of its size and hand back every coordinate and timestamp intact — and you cannot tell which from the byte count. If clean is what you need, remove the metadata on purpose with a tool that does a lossless rewrite, verify the fields are empty, and treat any compression you do as a separate, optional step.

Try Metadata Cleaner free — strip EXIF, GPS, IPTC, XMP and the embedded thumbnail from any image, video or audio file, locally in your browser, with no quality loss and nothing uploaded.