How Lossless Metadata Stripping Works in JPEG, PNG, and WebP
File structure of the three main web image formats, where metadata lives in each, and how it is removed without touching the picture.
Primary Browser Tool
EXIF & Metadata Remover
Strip EXIF, GPS location, camera, and software metadata from one or many photos before sharing them.
Two Ways to Remove Metadata
The simple method is to decode the image to pixels and save a new file. Metadata is lost because it is never copied, but so is some quality: a re-saved JPEG is compressed a second time, and the file size changes unpredictably.
The precise method treats the file as a sequence of labeled blocks and copies it with the metadata blocks left out. The compressed picture data is never decoded, so the output is the same image to the last bit. EXIF Remover uses this method.
Where Metadata Lives in Each Format
All three formats separate picture data from descriptive data, which is what makes clean removal possible.
| Format | Building block | Removed | Kept |
|---|---|---|---|
| JPEG | Marker segments | APP1 (EXIF, XMP), APP13 (IPTC/Photoshop), COM (comments), other application segments, anything after the end marker | APP0 (JFIF), APP2 ICC color profile, APP14 (Adobe), tables and scan data |
| PNG | Chunks | tEXt, zTXt, iTXt (text and XMP), eXIf, tIME, anything after IEND | IHDR, PLTE, IDAT, iCCP, gAMA, pHYs, transparency chunks |
| WebP | RIFF chunks | EXIF, XMP | VP8/VP8L image data, ALPH, ICCP, animation chunks |
Details That Matter
Three details decide whether stripping is done correctly.
- Orientation: phone cameras often store sensor data unrotated and record the needed rotation in EXIF. Deleting all EXIF would turn such photos sideways. When the orientation is anything other than normal, a new 36-byte EXIF block holding only that tag is written in its place.
- Color profile: the ICC profile describes how color values should be interpreted. It is not personal data, and removing it changes how wide-gamut photos look, so it is preserved.
- Trailing data: some phones append a short video (motion photos), a depth map, or a secondary image after the JPEG’s end marker. Viewers ignore it, but it is still in the file. The tool finds the true end of the image by walking through the scan data and drops everything after it.
Keeping the File Valid
Removing blocks must leave a file that still follows its format’s rules. JPEG segments and PNG chunks are self-contained, so omitting them requires no other change. WebP needs two adjustments: the size field in the RIFF header must match the new length, and the feature flags in the extended header, which announce the presence of EXIF and XMP, must be cleared. A reader that trusted the old flags could otherwise look for data that is no longer there.
Practical Examples
A motion photo
A 5.8 MB phone JPEG contains a 2.9 MB still image followed by a 2.9 MB video clip. After cleaning it is 2.9 MB, and the still image is unchanged.
Common Mistakes & Honest Limitations
Mistakes to Avoid
- Using a re-save to strip metadata from photos you intend to archive, and accepting a quality loss that was avoidable.
Technical Limitations
- Information hidden inside the pixel data itself, such as an invisible watermark, is not metadata and is not affected.