Back to all guides
Metadata·3 min read·

Why Your Phone Photos Are Sideways: EXIF Orientation Explained

Learn how EXIF orientation tags work, why photos appear sideways in some apps, and how to normalize pixels safely in an image pipeline.

Why Your Phone Photos Are Sideways: EXIF Orientation Explained

A phone photo can look upright in the gallery but sideways in a third-party app because the pixel matrix and the orientation instruction are separate pieces of information. Many cameras store the pixels in one orientation and add an EXIF Orientation tag telling compatible software how to display them.

Visual explanation of Why Your Phone Photos Are Sideways: EXIF Orientation Explained
Topic-specific visual summary of the concepts and checks in this guide.

What the orientation tag does

EXIF Orientation can describe rotations and mirrored transforms. Values 1–8 cover the normal orientation, horizontal or vertical mirroring, 180-degree rotation, and 90-degree rotations combined with mirroring. A viewer that reads the tag displays the intended result; a pipeline that ignores it may show the raw pixel arrangement instead.

  • 1: normal orientation.
  • 3: rotate 180 degrees.
  • 6: rotate 90 degrees clockwise.
  • 8: rotate 90 degrees counter-clockwise.
  • 2, 4, 5, and 7 include mirrored transforms; do not treat them as simple rotations.

Why apps disagree

Different image libraries, upload services, browsers, and document tools may normalize orientation at different stages. One system may honor the tag while another strips metadata without physically rotating the pixels. The result can be a correct preview but a sideways downloaded file, or a thumbnail that disagrees with the full image.

  • Test the original file in more than one viewer.
  • Check whether the processing pipeline auto-orients before resizing or generating thumbnails.
  • After normalization, remove or reset the old orientation tag so it is not applied a second time.

How to fix an incorrectly displayed photo

The reliable fix is to apply the orientation transform to the pixels, then save a normalized image with orientation set to normal or with the tag removed. Merely deleting the EXIF tag is not enough if the pixels were never rotated. Keep a copy of the original before modifying it.

  • Open the original in a tool that reads EXIF orientation.
  • Export or normalize the image so the pixel data itself is upright.
  • Reopen the exported file in a second viewer and inspect both portrait and landscape dimensions.

A developer checklist for upload pipelines

Normalize orientation before generating thumbnails, previews, or resized variants. If a pipeline strips metadata first, it may remove the only instruction that tells a viewer how to rotate the pixels. Store a normalized output with an upright pixel matrix, then ensure the orientation metadata is absent or set to normal. Test all eight EXIF orientations, not only the common portrait-phone case.

  • Include mirrored orientations 2, 4, 5, and 7 in automated fixtures.
  • Compare the thumbnail and full-size output after processing.
  • Avoid applying the transform twice when an upstream service already normalized the image.

Do not confuse “remove metadata” with “fix orientation”. Correct orientation requires transforming pixels before removing or resetting the orientation instruction.

Further reading: ExifTool: EXIF tag reference

Related tools

Why Your Phone Photos Are Sideways: EXIF Orientation Explained — ImageKitTools | ImageKitTools