Photo Sideways After Removing EXIF? Fix It
A photo turned sideways or upside down after you stripped its EXIF data? The cause is a deleted rotation flag. Here is how to fix it and avoid it.
Why removing EXIF turns the photo sideways
The photo turned sideways because the rotation instruction was deleted along with the rest of the metadata. Most phones and cameras do not rotate the pixels when you hold the device upright. They save the picture in the sensor's native landscape layout and add an EXIF Orientation tag (a number from 1 to 8) telling viewers how to turn it for display. Apps that read the tag show the photo upright. When a cleaner deletes every EXIF field, including that one, the pixels are still landscape and nothing says otherwise, so the portrait photo now shows on its side. The picture was never damaged. Only the display hint is gone. The same thing happens with command-line tools and some editors that strip metadata without first applying the rotation.
The fix: remove metadata but keep the rotation flag
Strip everything except the orientation flag, and the photo keeps opening upright. PixelTools' Photo Metadata Remover does this by default. When your photo carries a rotation flag, it shows a checkbox labelled "Keep the rotation so the photo opens upright", already ticked. The flag is just a number from 2 to 8 with no information about you, so keeping it does not leak your location, camera or timestamp. Everything else (GPS, camera make, dates, embedded comments) is removed. If you already stripped a photo and it is sideways, start over from your original file, because the deleted flag cannot be recovered from the cleaned copy. Run the original through the tool again with the box ticked, and check the result in the viewer or site where it looked wrong.
The other fix: rotate the pixels, then strip everything
If the destination ignores EXIF orientation entirely, bake the rotation into the pixels instead. Some email clients, older viewers and upload forms show raw pixels and skip the tag, so a kept flag still displays sideways there. The reliable approach is to rotate the image to the way it should look, save it as a fresh file, and then remove all metadata including the flag. In PixelTools, open the photo in the Rotate tool, turn it the way it appears upright in your normal viewer, download it, then run it through the Metadata Remover with the rotation box unticked. Afterwards no viewer has to guess, because the pixels are already upright and no tag remains. The trade-off is one extra re-encode of the JPG, which costs a little quality compared with a metadata-only strip.
What we checked in the tool and on a test file
We read the tool's source and reproduced the problem on a test JPG. The test file was a 400x200 image tagged with orientation 6 (rotate 90 degrees clockwise), so viewers show it as 200x400. Running the tool's own strip function with the rotation kept gave a file that still displays at 200x400 with the camera make removed. Running it with the rotation unticked gave a file that displays at 400x200, which is the sideways result. ImageMagick's -strip produced the same sideways result as the unticked box, and -auto-orient followed by -strip gave a 200x400 file with no tag at all. The tool cuts metadata out of the file bytes rather than decoding the image, so the pixels are untouched. Only this JPG was tested, not a real phone photo, and we did not test PNG or WebP outputs.
How to confirm it worked before you post the photo
Open the cleaned file in the exact place it went wrong and compare it with the original. A photo that looks right in your desktop viewer can still show sideways on a website, because viewers disagree on whether to apply the tag. Test in the environment that matters: upload to the site as a draft, send yourself the email, or open the file in a second browser. The Metadata Remover also re-checks the new file after download and reports what is left, and with the rotation kept it says the only thing remaining is the rotation flag. If the photo still looks sideways in one place only, that destination ignores the tag, and the rotate-then-strip method above is the fix. PNG and WebP can carry the flag too, but the tool's keep-rotation checkbox appears only when the file actually has a rotation flag.
Frequently asked questions
Try it on PixelTools — free, no upload needed