March 24, 20266 min read

Flip and Rotate Images — Fix Orientation in Seconds

Why your photos appear rotated on some devices but not others, how EXIF orientation tags work, and how to permanently fix image rotation and flip issues.

rotate image flip image exif orientation image editing photo fix
Ad 336x280
# Flip and Rotate Images — Fix Orientation in Seconds

You take a photo holding your phone sideways. It looks perfect on your phone. You upload it to a website, and it's rotated 90 degrees. You open it on your Windows PC, and it's correct again. Your colleague opens the same file on their old laptop, and it's sideways.

What is happening?

The EXIF Orientation Problem

When you rotate your phone to take a landscape photo, the camera sensor doesn't physically rotate. It always captures the image in the same orientation. Instead, your phone writes a metadata tag into the JPEG file that says "this image should be displayed rotated 90 degrees clockwise."

This metadata tag is part of EXIF (Exchangeable Image File Format), and it's called the Orientation tag. It can specify eight different orientations — four rotations and four mirrored rotations.

Here's the problem: not every program reads the EXIF orientation tag. Modern apps (iPhone Photos, Google Photos, Chrome, most social media platforms) read it and display the image correctly. Older programs, some web frameworks, certain email clients, and various image processing pipelines ignore it completely and show the raw sensor orientation.

This is why the same photo looks different on different devices. The image data hasn't changed. Some viewers apply the rotation hint; others don't.

The Fix: Apply Rotation to Pixel Data

The permanent solution is to physically rotate the pixel data so it matches the intended orientation, then remove or reset the EXIF orientation tag to "normal." After this, every viewer displays the image the same way because there's no metadata interpretation required.

This is what "lossless rotation" does for JPEG files. Rather than decoding and re-encoding the image (which would introduce compression artifacts), it rearranges the compressed data blocks. The image quality is preserved exactly.

MyPDF's Flip and Rotate tool applies rotation and flip operations to the actual image data. Upload your image, select the correction (90, 180, or 270 degrees, horizontal or vertical flip), and download the fixed version. The EXIF tag gets normalized so the result looks correct everywhere.

Rotation Options Explained

90 degrees clockwise: The most common correction. Fixes portrait photos that appear landscape. 90 degrees counter-clockwise: The opposite. Less common but needed when a photo was taken with the phone rotated the "other" way. 180 degrees: Fixes upside-down images. This happens surprisingly often with document scans and photos taken with a phone held upside down. Horizontal flip (mirror): Creates a mirror image, left-to-right. Useful for correcting selfie camera mirrors — some phones save selfies as mirror images so the preview matches what you see, but the saved image is reversed. Also essential for certain printing workflows where the image needs to be mirrored for iron-on transfers. Vertical flip: Flips top to bottom. Less common for photos, but needed in some technical imaging contexts (microscopy, astronomical imaging) where the optical path inverts the image.

Batch Processing: When You Have Hundreds of Files

If you have a folder full of images with mixed orientation problems, fixing them one by one is tedious. Here are faster approaches:

IrfanView (Windows) has a powerful batch processing feature. Go to File > Batch Conversion/Rename, check "Use advanced options," and in the advanced dialog you can set auto-rotation based on EXIF data. Process thousands of files in minutes. XnConvert (Windows, Mac, Linux) is free and designed specifically for batch image processing. Add a "rotation" action, set it to "auto-rotate based on EXIF," and drag your folder in. On macOS, the built-in Preview app can handle batches: select multiple images in Finder, open them all in Preview, select all in Preview's sidebar, and rotate them together.

Common Scenarios

Scanned Documents That Are Sideways

Flatbed scanners and document feed scanners sometimes produce pages rotated 90 or 180 degrees, depending on how you placed the paper. A quick 90-degree rotation fixes this. If you're scanning a stack of mixed-orientation pages, you might need to rotate some pages one way and others another.

Product Photography for E-commerce

When shooting products, maintaining consistent orientation across hundreds of images matters. A product photo rotated even slightly looks unprofessional on a product listing. Beyond 90-degree rotation, some tools offer fine-angle rotation (e.g., 2-3 degrees) to straighten slightly crooked shots.

Social Media Content

Instagram and TikTok handle EXIF orientation correctly, so photos from your phone usually display fine. But if you're editing in a tool that strips EXIF data, the orientation might get lost. Always apply rotation to pixel data before uploading to be safe.

Printing

Print shops need correctly oriented files. They won't check your EXIF tags — if the pixel data is rotated, the print will be rotated. Fix orientation before submitting print orders.

Technical Detail: The Eight EXIF Orientations

For the curious, EXIF defines these orientation values:

  1. Normal (no transformation needed)
  2. Flipped horizontally
  3. Rotated 180 degrees
  4. Flipped vertically
  5. Rotated 90 CCW, then flipped horizontally
  6. Rotated 90 CW
  7. Rotated 90 CW, then flipped horizontally
  8. Rotated 90 CCW
Values 5 and 7 combine rotation with mirroring, which is rare in practice but can happen with certain camera configurations.

Don't Rotate JPEGs by Decoding and Re-encoding

One last thing. If you open a JPEG in a basic image editor, rotate it, and save — the editor typically decodes the JPEG, rotates the uncompressed pixels, and re-encodes as JPEG. This means another round of lossy compression. Do it a few times and quality visibly degrades.

Lossless JPEG rotation avoids this by operating directly on the DCT coefficients (the compressed data blocks). No quality loss whatsoever. Most modern tools use lossless rotation by default for 90/180/270 degree rotations of JPEGs, but it's worth verifying if image quality matters to you.

Ad 728x90