Why Your Photos Turn Sideways (And How to Fix It Properly)

September 25, 2026 · 5 min read

A photo looks perfectly upright on your phone. You upload it to a website, email it, or copy it to a PC, and it arrives lying on its side. You rotate it, upload again, and now it is upside down.

Nothing is broken. The photo was never rotated in the first place, and once you know what is actually stored in the file, all of this stops being mysterious.

The pixels never move

A phone camera sensor captures in one fixed orientation, regardless of how you are holding the phone. When you shoot in portrait, the sensor still records a landscape-shaped grid of pixels.

Rotating those pixels would mean rewriting several million values before the photo could be saved — noticeable time and battery for every shot. So camera makers do something cheaper: they leave the pixels exactly as captured and write a small note in the file's metadata saying which way up it should be displayed.

That note is the EXIF Orientation tag. It has eight possible values covering the four right-angle rotations plus mirrored versions of each.

So your portrait photo is, in the file, a landscape image with a sticky note attached saying "turn this ninety degrees".

Why it looks right in some places and wrong in others

Software that reads the tag rotates the image before showing it to you. Software that ignores the tag shows you the raw sensor orientation — sideways.

Your phone reads it. Your Mac reads it. Modern browsers read it. But plenty of things do not: older desktop applications, some upload pipelines, various web frameworks, and image processing libraries used with their default settings.

This is why the same file looks correct in one program and wrong in another, which makes people think the file itself is inconsistent. It is not. Only the readers differ.

The cycle that makes it worse

Here is where people get stuck, and it is worth understanding before you touch anything.

Some rotation tools do not rotate the pixels. They just change the orientation tag. Rotate a photo that way and:

  • In tag-aware software it now looks correct
  • In software that ignores tags it looks exactly as wrong as before

So you rotate it again. Now the tag says something different again, and in tag-aware software it has gone past correct to wrong. You now have a photo that is wrong in both places, in different ways.

If rotating a photo has made things worse rather than better, this is what happened.

The fix that actually works

The permanent solution is to bake the rotation into the pixels and clear the tag. Then every piece of software agrees, because there is nothing left to interpret.

Re-save through something that decodes and re-encodes the image. This is the simplest route. When a tool reads the file, applies the orientation, and writes a new one from the resulting pixels, the correct rotation ends up in the pixel data and the tag is gone. Running the photo through our compressor or resizer does exactly this — the browser applies the orientation when decoding, and the file that comes out is upright for everyone.

Or rotate in a proper editor and save. Open it in Photos, Preview, GIMP or Photoshop, rotate until it looks right, and save. These write the rotated pixels rather than only editing metadata.

Either way, check the result somewhere that ignores EXIF before you rely on it — older software, or a plain file preview — rather than only in the app you just used.

Why it happens after you upload

This is the most common modern version of the problem and it confuses people most, because the photo looked fine right up until it did not.

Many upload pipelines resize and re-compress images, and that process frequently strips the metadata — including the orientation tag. If the tool doing the resizing does not apply the rotation before discarding the tag, you end up with the raw sensor pixels and no note explaining them. The photo turns sideways at the moment it is published.

You cannot fix that from the outside, but you can pre-empt it: rotate the photo into the pixels before uploading, using either method above. Then there is nothing for the pipeline to lose.

Two things that catch people out

Screenshots have no orientation tag. They are captured already upright, so there is nothing to interpret. If you have a folder mixing screenshots and camera photos and you apply a bulk rotation, the screenshots will end up wrong. Handle them separately.

HEIC to JPG conversion usually resolves it. A converter decodes the image and writes new pixels, which bakes the orientation in as a side effect. If you were already converting iPhone photos, that step has probably fixed the rotation for you too.

Checking what the tag says

If you want to know rather than guess, the orientation value is visible in the file's properties on most systems, or in any EXIF viewer. A value of 1 means normal — no rotation to apply. Anything else means the file is relying on software to turn it.

That is a useful thing to check before uploading a batch of photos to anywhere that matters, like a marketplace listing or a submission form.

The short version

Your phone saves the pixels as the sensor captured them and adds a tag saying which way up they go. Software that reads the tag shows the photo correctly; software that ignores it shows it sideways. Rotating with a tool that only edits the tag makes things worse, not better. The permanent fix is to write the rotation into the pixels themselves — re-saving the file through any tool that decodes and re-encodes it does this automatically, and after that every program agrees.

Tools used in this guide