JPEG vs PNG vs WebP: how each format stores metadata
All three formats can carry metadata, but they do it in structurally different ways. If you are trying to understand what a file might be leaking — or why a metadata tool handles one format differently from another — the differences matter. This is a practical overview, not a specification walkthrough.
JPEG
JPEG is the oldest of the three and has the richest metadata ecosystem, mostly because it has had thirty years to accumulate one.
A JPEG file is a sequence of segments, each introduced by a two-byte marker. Metadata lives in several of these segments:
- APP1 (EXIF) — the primary metadata block. Contains camera settings, GPS coordinates, timestamps, orientation, an embedded thumbnail, and dozens of other fields defined by the EXIF standard. This is what most people mean when they say "photo metadata."
- APP1 (XMP) — Adobe's XML-based metadata format, stored in a separate APP1 segment identified by a namespace string. XMP can hold everything EXIF holds and more: editing history, rights information, custom fields from Lightroom or Photoshop.
- APP13 (IPTC-IIM) — an older standard from the news industry, used for captions, credits, and copyright notices. Still present in files that have passed through editorial workflows.
- COM (comment) — a free-text comment field. Rarely used by cameras, occasionally written by editing software.
A single JPEG can carry all four simultaneously, each with overlapping or contradictory information. A file exported from Lightroom, for instance, might have the camera's original EXIF, Lightroom's XMP sidecar merged in, and IPTC fields from a previous round of editing. Stripping metadata from a JPEG means removing all of these segments while leaving the compressed image data — the SOS (Start of Scan) segment and everything after it — untouched.
PNG
PNG uses a chunk-based structure. Every piece of data in a PNG is a named chunk with a length and a checksum. Metadata can appear in several chunk types:
- tEXt, zTXt, iTXt — text chunks that store key-value pairs. Common keys include "Author", "Description", "Software", and "Comment".
zTXtis the compressed variant;iTXtsupports Unicode. - eXIf — a chunk type added in the 2017 PNG specification update that embeds a standard EXIF block, exactly as it would appear in a JPEG. Before this chunk existed, some software wrote EXIF data into tEXt chunks as a raw hex dump, which was non-standard but widespread.
- tIME — a single timestamp recording when the image was last modified.
In practice, PNG files carry less metadata than JPEGs. Most cameras do not shoot PNG, so the files that exist are usually exports from editing software or screenshots. Screenshots tend to carry only the software name and a timestamp. Edited photos exported as PNG may carry a full EXIF block in an eXIf chunk if the software supports it.
Stripping PNG metadata means removing the text chunks, the eXIf chunk, and the tIME chunk. The critical image chunks — IHDR, IDAT, IEND — are left alone.
WebP
WebP uses the RIFF container format — the same family as WAV and AVI. Data is organised into named chunks inside the RIFF wrapper:
- EXIF chunk — contains a standard EXIF block. Cameras that shoot WebP (some Android phones in certain modes) write GPS, timestamps, and camera data here.
- XMP chunk — contains an XMP packet, same format as in JPEG.
WebP does not have an equivalent of IPTC or PNG's text chunks. Its metadata surface is smaller: just EXIF and XMP. Stripping it means removing those two chunks from the RIFF container.
Practical implications
JPEG is the most metadata-heavy format. If you are concerned about what a file reveals, JPEG is the one most likely to carry GPS data, serial numbers, and editing history. It is also the format that most metadata tools handle best, because it has been the primary target for thirty years.
PNG is usually lighter but not always safe. A PNG exported from Photoshop can carry a full EXIF block. A screenshot typically carries very little. Do not assume PNG means "no metadata" — check.
WebP falls in between. It supports EXIF and XMP but not IPTC. Android phones that save WebP files will embed GPS and camera data just as they would in a JPEG.
Conversion does not automatically strip metadata. Converting a JPEG to PNG or WebP may or may not preserve the metadata, depending on the tool. Some converters copy the EXIF block into the output format; others discard it silently. If metadata removal is your goal, strip it explicitly rather than relying on a format conversion to do it by accident.
MetaScrub's photo tool handles all three formats — JPEG, PNG, and WebP — parsing the format-specific structures described above and removing everything except the image data itself.