MetaPurge

XMP vs IPTC vs EXIF: three metadata systems in one photo

A single JPEG can carry three unrelated metadata systems, written by three different pieces of software at three different times. They overlap in content and never overwrite each other automatically.

By Rajat Malik Updated 9 min read

People talk about "the metadata" as if it were one block. In a file that has been through a camera, an editor and a publishing pipeline, it is usually three blocks built on different foundations, stored in different places, and read by different software.

That is the practical reason a stripped file can still leak. Delete the EXIF segment and the XMP packet is untouched. Delete that too and an IPTC caption may still name the photographer in APP13.

Three systems in one file

SystemEncodingIn a JPEGBuilt for
EXIFBinary TIFF-style IFDsAPP1, identifier ExifCapture settings: exposure, lens, GPS, timestamps
XMPRDF/XML textAPP1, Adobe namespace URIEdit history, ratings, rights, cross-application properties
IPTC IIMBinary datasetsAPP13, inside a Photoshop resource blockEditorial captions, by-lines, credit and rights

EXIF: binary, fixed and camera-first

An EXIF block is a TIFF file embedded in the image. It starts with a two-byte byte-order mark — II for little-endian, MM for big-endian — then the number 42, then an offset to the first image file directory.

An IFD is a count followed by twelve-byte entries. Each entry holds a tag number, a data type, a count and either the value itself or an offset to it. Values of four bytes or fewer are stored inline; anything larger lives elsewhere in the block and is reached by offset. Types include ASCII, SHORT, LONG, RATIONAL and their signed variants.

IFD0 holds the basic tags. Two entries point to sub-directories: 0x8769 for the Exif IFD, which holds exposure and lens data, and 0x8825 for GPS. There is often a third pointer to a thumbnail IFD, which is a second small JPEG with its own tags.

EXIF is compact, universally supported and terrible at evolution. The tag list is fixed by the standard, so vendors bolt on proprietary MakerNotes that only their own software reads. It has no concept of a namespace and no place to record an edit history.

XMP: XML, extensible and Adobe-shaped

XMP is a subset of RDF serialised as XML. Properties are grouped by namespace: dc: for Dublin Core fields such as creator, rights and subject, xmp: for dates and the creating tool, photoshop: for city, credit and headline, crs: for Camera Raw develop settings. That extensibility is its advantage: a new property needs no new binary specification.

The interesting namespace is xmpMM:, which holds provenance. xmpMM:History is an ordered list of events, each with an action, a timestamp, a software agent and sometimes the parameters used. xmpMM:DerivedFrom and the document and instance identifiers let an application trace a file back through versions.

In a JPEG, the packet sits in an APP1 segment whose payload begins with the namespace URI http://ns.adobe.com/xap/1.0/ followed by a null byte. A packet larger than the space available is split: a small standard packet plus one or more extended-XMP APP1 segments carrying the remainder under a GUID.

IPTC IIM: the press record

IPTC IIM is a binary format built from datasets. Each dataset begins with the marker byte 0x1C, then a record number, then a dataset number, then a two-byte length. Record 2 is the editorial record, and its dataset numbers are the ones that matter in practice.

DatasetFieldTypical content
2:05Object NameShort title
2:25KeywordsRepeated terms for search
2:55Date CreatedEditorial date, as eight digits
2:80By-linePhotographer's name
2:85By-line TitleJob title or role
2:90CityPlace of capture
2:101CountryCountry name
2:105HeadlinePublishing headline
2:110CreditProvider, not necessarily the author
2:116Copyright NoticeRights statement
2:118ContactAddress of the rights holder
2:120Caption-AbstractThe full caption

In a JPEG, these datasets are wrapped in an APP13 segment starting with the identifier Photoshop 3.0 and a null byte, then an 8BIM resource with ID 0x0404. The nesting is why some tools report "no metadata" on a file that has a complete IPTC caption: they never look inside APP13.

IIM is 8-bit and was designed before Unicode was universal, so non-Latin captions are often stored in a local encoding and display as mojibake. That limitation is a large part of why IPTC later defined IPTC Core and Extension as XMP schemas rather than extending IIM.

Two things called IPTC "IPTC" in modern software usually means the XMP schemas, not the binary IIM record. A file can have one, the other, or both, holding different captions. When a tool says it removed IPTC, check which one it meant.

Why removing one leaves the others

The three systems are stored independently. Nothing in the format keeps them in sync, and no writer is obliged to update the others. A camera writes EXIF only. Lightroom writes XMP. Photoshop writes XMP and often IIM as well. A wire service may write all three.

Duplication is normal. The same caption can exist in dc:description in XMP and in dataset 2:120 in IIM. The same coordinates can exist in the GPS IFD and as exif:GPSLatitude in XMP. Deleting one copy changes nothing about the other.

There is also a container subtlety in JPEG. EXIF and XMP both live in APP1 segments, so a tool that removes "the APP1 segment" may remove one and leave the other depending on which it found first. Removing both requires finding both signatures, not just the first APP1.

PNG and WebP have the same problem in different clothing: a PNG can hold eXIf and an XMP iTXt chunk, and a WebP can hold an EXIF chunk and an XMP chunk. In every container, the count of metadata blocks is what matters, not the count of metadata formats.

Removing all three

Work by signature, not by extension. In a JPEG, expect one or two APP1 segments, an APP13, possibly a COM, and an APP2 if there is a colour profile. In a PNG, walk the chunk list and read every text chunk's keyword. In a WebP, check the VP8X flags and then the chunk list.

If you are weighing which system to keep for legitimate reasons: EXIF for capture settings, XMP for workflow and rights in Adobe tools, IIM when a downstream agency requires the old record.

For the tag-level view, see what EXIF contains, and for the containers see JPEG segments and PNG chunks. The next guide covers the two blocks that should stay.

See what your photos are carrying

Drop an image in. MetaPurge lists every tag, then rewrites the file without touching a pixel.

Open the metadata remover

Where to go next

Rajat Malik Frontend architect and the author of MetaPurge. Builds browser tools that keep files on the device, and writes about the parts of the web that leak by default. rajatmalik.dev