Keywords are short search terms attached to an image. The standard places for them are IPTC Keywords (dataset 2:25, repeatable, 64 bytes per keyword) and XMP dc:subject, an unordered rdf:Bag. Windows adds a third, XPKeywords (0x9C9E) in IFD0. Our tools neither show nor edit any of these, so everything on this page uses ExifTool.
[IFD0] XPKeywords : harbor;dawn
[IPTC] Keywords : harbor, dawn
[XMP-dc] Subject : harbor, dawnIPTC and XMP store one item per keyword; the comma is ExifTool's list separator, not data. XPKeywords is a different animal: one UTF-16LE string with semicolons between terms. It stays little-endian even inside a big-endian EXIF block, so "har" is 68 00 61 00 72 00 on disk.
Adding and removing keywords
exiftool -Keywords+=pier -Subject+=pier photo.jpg
exiftool -Keywords-=dawn -Subject-=dawn photo.jpg
exiftool -Keywords-=pier -Keywords+=pier -Subject-=pier -Subject+=pier photo.jpg+= appends without checking. Run the first line twice and you get harbor, dawn, pier, pier in both lists. The third form deletes the keyword before adding it, which leaves exactly one copy however many times it runs. For keywords with accents, add -codedcharacterset=utf8, otherwise ExifTool stores IPTC text as Latin-1.
Lightroom Classic writes dc:subject, plus lr:hierarchicalSubject for nested keywords such as Places|France|Brest. Other apps see only the flat list. In a PNG, IPTC Keywords has no standard home, while dc:subject rides along in the XMP chunk.
What keywords are good for
Your own library and stock agencies. Upload forms on stock sites usually import embedded keywords, which saves retyping. Search engines are another matter: Google's image metadata documentation lists Creator, Credit Line, Copyright Notice and a few licensing fields, and keywords are not among them. Stuffing them for SEO does nothing that documentation promises.
Keywords also leak. They often hold names of people, clients or places that the image alone doesn't reveal, and they survive many exports. The metadata remover deletes all three copies along with everything else. A sentence describing the image belongs in the image description, not in keywords, and the EXIF vs IPTC vs XMP guide explains why the same list is stored twice.