How to Strip EXIF Data from JPEG Images
Every JPEG image you share carries a hidden attachment. Your camera writes it automatically: the exact model and serial number of your device, the lens you used, your GPS coordinates, the date and time down to the sub-second, and in some cases your name. This data is called EXIF, and it is embedded directly into the file structure of every JPEG you produce. The good news is that removing it is straightforward once you understand how JPEG files store metadata. This guide walks through the technical architecture of JPEG metadata and explains why canvas redrawing is the most thorough removal method available.
Understanding JPEG APP Segments
A JPEG file is not a single block of data. It is a sequence of markers and segments, each serving a specific purpose. The file begins with the SOI (Start of Image) marker and ends with the EOI (End of Image) marker. Between them, the JPEG standard defines Application markers -- labeled APP0 through APP15 -- that allow different types of metadata to coexist in the same file.
Here are the APP segments most relevant to metadata:
APP0 (JFIF -- JPEG File Interchange Format): This is the baseline JPEG marker. It identifies the file as a JPEG, specifies the pixel density (DPI), and may contain a small thumbnail. Every standard JPEG produced by a camera or image editor contains an APP0 segment.
APP1 (EXIF and XMP): This is the workhorse of JPEG metadata. APP1 carries the entire EXIF data structure, which itself is organized into Image File Directories (IFDs). The primary IFD (IFD0) contains core image attributes. The EXIF Sub-IFD stores camera shooting parameters -- exposure time, aperture, ISO, focal length, flash status, white balance, and metering mode. The GPS Sub-IFD stores latitude, longitude, altitude, and bearing. APP1 also frequently carries XMP (Extensible Metadata Platform) data, an XML-based metadata format developed by Adobe that can store editing histories, copyright claims, and C2PA content credentials.
APP13 (IPTC-NAA / Photoshop IRB): This segment stores IPTC (International Press Telecommunications Council) metadata, originally designed for news wire services. It includes fields for captions, credits, keywords, categories, and copyright notices. Adobe Photoshop also uses APP13 to embed its own Image Resource Block (IRB), which can contain layer information, paths, and color management data.
APP11 (JUMBF -- JPEG Universal Metadata Box Format): This is where C2PA content credentials live in JPEG files. APP11 uses the JUMBF (JPEG Universal Metadata Box Format) standard to embed structured, cryptographically signed provenance data. A single C2PA manifest in APP11 can be 50 to 320 kilobytes.
| APP Segment | Metadata Type | Typical Size | What It Contains |
|---|---|---|---|
| APP0 | JFIF | 100–500 bytes | JPEG identifier, DPI, thumbnail |
| APP1 | EXIF + XMP | 2–50 KB | Camera settings, GPS, timestamps, software, XMP packets |
| APP13 | IPTC / IRB | 500–5 KB | Captions, credits, keywords, Photoshop data |
| APP11 | JUMBF / C2PA | 50–320 KB | Content credentials, cryptographic signatures, provenance |
The remaining APP segments (APP2 through APP10, APP12, APP14, APP15) are used for ICC color profiles (APP2), FlashPix data (APP3), and various manufacturer-specific extensions. Most consumer cameras and AI tools do not write to these segments, but they can still contain data worth removing.
Two Methods for Stripping JPEG Metadata
There are two fundamentally different approaches to removing metadata from JPEG files: binary stripping and canvas redrawing.
Binary stripping works by parsing the JPEG file structure, identifying the APP markers that contain metadata, and removing those segments while preserving the image data (the SOS -- Start of Scan -- segment and everything after it). Tools like ExifTool and libexif use this approach. It is surgical and preserves the original image data exactly, bit-for-bit. However, binary stripping has a significant limitation: you must know which segments to remove and which to keep. Miss an obscure APP segment, and metadata survives. Some tools strip APP1 but leave APP13 untouched, or remove EXIF but miss the XMP packet nested inside APP1.
Canvas redrawing takes a completely different approach. The image is loaded into an HTML5 Canvas element in the browser, then re-exported as a new JPEG from scratch. The Canvas API produces a clean JPEG containing only the standard markers needed for display: SOI, APP0 (JFIF), DQT (quantization table), SOF (start of frame), DHT (Huffman table), SOS (image data), and EOI. No APP1, no APP13, no APP11, no metadata whatsoever. The new file is a fresh JPEG that has never seen the original metadata.
Why Canvas Redrawing Is More Thorough
Binary stripping requires you to enumerate every possible metadata container and remove each one. If a new standard introduces metadata in APP14 tomorrow, your binary stripper needs an update. Canvas redrawing is inherently future-proof: it produces a clean file regardless of what metadata the original contained. It does not need to know about APP11, caBX, or any other segment -- because it never copies any of them.
Quality Comparison: Binary Stripping vs Canvas Redrawing
The main concern with canvas redrawing is image quality. Re-encoding a JPEG involves lossy compression, which means some visual information is discarded. How much does this matter in practice?
The answer depends on the quality setting used during canvas export. Modern browsers support quality parameters from 0.0 to 1.0. At quality 0.92 (the default used by most canvas-based tools, including RemoveAI Image), the visual difference between the original and the redrawn image is imperceptible to the human eye for most photographs. Independent testing has shown that at quality 0.92, the PSNR (Peak Signal-to-Noise Ratio) between original and redrawn images exceeds 42 dB for typical photographs -- well above the 30–35 dB threshold where compression artifacts become visible.
At quality 1.0, the output is nearly indistinguishable from the original even under pixel-level comparison, though file sizes increase by 30 to 50 percent. At quality 0.80, compression artifacts become faintly visible in smooth gradients and fine text, but are still imperceptible at normal viewing distances.
| Canvas Quality | PSNR (typical photo) | Visual Impact | File Size Change |
|---|---|---|---|
| 1.0 (maximum) | > 48 dB | Indistinguishable from original | +30–50% larger |
| 0.95 (high) | > 44 dB | Indistinguishable at normal viewing | +5–15% larger |
| 0.92 (standard) | > 42 dB | Imperceptible for most photos | Similar or slightly smaller |
| 0.80 (economy) | > 36 dB | Faint artifacts in gradients | 15–30% smaller |
JPEG Is Always Lossy
Even binary stripping involves re-encoding if you make any pixel-level changes. The only way to get a truly lossless output is to start with a lossless format (PNG, TIFF). For JPEG files, some quality reduction is inherent to the format. If absolute lossless quality is required, convert to PNG before or after metadata removal.
Step-by-Step: Stripping EXIF from JPEG with Canvas Redrawing
Here is exactly what happens when you use a browser-based tool like RemoveAI Image to strip metadata from a JPEG file:
Step 1 -- Load the image into memory. The browser reads the JPEG file and decodes it into raw pixel data stored in memory. At this point, the metadata in the original file is still present in the file buffer but is separate from the decoded pixel data.
Step 2 -- Draw pixels onto a Canvas. The decoded pixel data is drawn onto an off-screen HTML5 Canvas element. The Canvas now holds only the visual content of the image -- no EXIF, no XMP, no C2PA, no GPS. The metadata segments from the original file are not transferred to the Canvas.
Step 3 -- Export as a new JPEG. The Canvas toBlob() method is called with the desired MIME type (image/jpeg) and quality parameter (e.g., 0.92). This creates an entirely new JPEG file from the pixel data on the Canvas. The new JPEG contains only the structural markers required by the JPEG specification -- no metadata segments from the original file.
Step 4 -- Download the clean file. The new, clean JPEG is returned to the user. It is a completely new file that shares no structural data with the original. Every APP segment, every IFD entry, every XMP packet, every C2PA manifest has been eliminated.
The entire process takes place in the browser. No data is uploaded to any server. The original file remains on your device untouched, and the clean file is generated locally and downloaded directly.
What Gets Removed and What Does Not
Canvas redrawing removes all metadata stored in the file structure:
- All EXIF fields (camera model, serial number, exposure settings, timestamps)
- All GPS data (latitude, longitude, altitude, bearing)
- All XMP packets (editing history, copyright, C2PA manifests)
- All IPTC data (captions, credits, keywords)
- All C2PA content credentials (cryptographic provenance, JUMBF boxes)
- All thumbnails embedded in metadata segments
- All manufacturer-specific MakerNote data
Canvas redrawing does not remove steganographic watermarks embedded in the pixel data itself, such as Google's SynthID. These watermarks operate at the pixel level and survive redrawing because the pixel values are preserved (within JPEG compression tolerance). If you need to address steganographic watermarks, a different approach is required -- see our guide on AI watermarks for details.
FAQ
Does stripping EXIF reduce image quality?
For JPEG files, canvas redrawing involves one additional generation of lossy compression. At quality 0.92 (the standard setting), this additional generation produces changes that are imperceptible to the human eye in most photographs. The PSNR typically exceeds 42 dB, well above the threshold of visibility. For PNG files, canvas redrawing is lossless because PNG uses lossless compression -- the output pixels are identical to the input pixels.
Can stripped EXIF data be recovered?
No. When metadata is removed via canvas redrawing, the new file does not contain the original metadata in any form. The original metadata segments are not hidden, obfuscated, or moved -- they are simply absent from the new file. There is nothing to recover. This is different from simply hiding metadata, which some tools do by zeroing out values but leaving the segment structure intact.
Is it legal to strip EXIF data from photos?
Yes, in all major jurisdictions. Metadata removal is a standard practice in photography, journalism, and digital asset management. Photographers routinely strip metadata before publishing to protect their privacy. Journalists strip GPS data to protect source locations. The only context where metadata removal might be problematic is if you are attempting to conceal the AI-generated nature of an image in a jurisdiction where AI content disclosure is legally mandated -- such as under certain provisions of the EU AI Act.
EXIF metadata in JPEG files is a comprehensive record of your camera, your settings, your location, and your hardware identity. Removing it does not need to be complicated. RemoveAI Image uses canvas redrawing to strip every APP segment -- EXIF, XMP, IPTC, C2PA, GPS -- from your JPEG files entirely in your browser. No uploads, no servers, no software to install. Drop your images, get clean files, and share with confidence.
Ready to clean your images?
Try our free browser-based tool to detect and remove AI metadata from your images.
Open Metadata Cleaner