Skip to main content

Why your photo uploads sideways, and how EXIF orientation works

The pixels in a phone photo are often not stored the way up you see them. A tag tells software how to turn them, and anything that ignores the tag shows you the raw sensor frame.

Published 3 November 2026

You take a photograph in portrait. It looks correct in your camera roll, correct when you message it to someone, correct when you open it on your laptop. You upload it to an application form and it appears on its side.

Nothing is broken, and the photo was never rotated. What changed is that one piece of software stopped reading a note attached to the file — and that note was the only thing making the picture look upright anywhere.

Why cameras do this

The image sensor in a phone is bolted to the body in one fixed orientation. Turning the phone sideways does not turn the sensor; it turns the phone around the sensor. The sensor captures whatever reaches it, in its own fixed frame of reference.

A camera could rotate those pixels before saving. That means moving every one of perhaps fifty million values into a new arrangement, which costs time and battery on a device trying to be ready for the next shot. So almost no camera does it.

Instead the camera writes the pixels exactly as the sensor saw them and records a small number in the file’s EXIF metadata — the orientation tag — meaning “whoever displays this, turn it this way first.” It is one of eight values.

TagWhat it recordsWhat a viewer must do
1Already uprightNothing
3Stored upside downRotate 180°
6Phone held upright, rotated rightRotate 90° clockwise
8Phone held upright, rotated leftRotate 90° anticlockwise
2, 4, 5, 7Mirrored variants, rare in practiceFlip, and sometimes rotate

Tag 6 is the one you will meet most often. It means the stored pixels are a landscape frame that needs turning a quarter turn clockwise to become the portrait photograph you took. So a portrait photo from a phone is frequently a landscape image file wearing a note.

The split: who reads the note

Every piece of software that opens your photograph makes an independent decision about whether to honour that tag, and there is no way to tell from the outside which it will do.

Software that honours it — phone galleries, current web browsers displaying an image in a page, the built-in image viewers on macOS and Windows, essentially every consumer photo application. This is why the photograph looks right almost everywhere, and why the one place it looks wrong feels like a bug in that one place.

Software that ignores it — older desktop tools, many server-side image libraries in their default configuration, document generators, some print workflows, and any code that reads the pixel array directly without parsing the metadata first. Ignoring the tag is the easier thing to write, so it happens by omission rather than by decision.

When an upload form shows your photo sideways, you have almost certainly found something in the second group. The file is unchanged; this particular reader is looking at the raw sensor frame.

The trap: rotating it does nothing

The natural response is to rotate the photo yourself and upload it again. Sometimes this works. Often it changes nothing at all, and the reason is genuinely counterintuitive.

Many viewers implement “rotate” by editing the orientation tag rather than moving any pixels. It is instant and lossless, which is why they do it. But it means the file you just “fixed” has the same pixels as before and a different note — so software that was ignoring the note before is still ignoring it, and still shows the same sideways image.

You rotated the photograph for every reader except the one you were trying to satisfy.

The fix that actually works

Stop relying on the note. Rewrite the pixels so the image is upright as stored, and the tag becomes unnecessary:

  1. Decode the image, applying the orientation tag. Read the file and produce the upright picture in memory.
  2. Re-encode from that. Write a new file from the upright pixels. The rotation is now part of the image rather than an instruction about it.

The new file needs no orientation tag, because there is nothing left to correct. Every reader shows it the same way up, including the ones that never read metadata. This is sometimes described as “baking in” the rotation, and it is the only approach that is robust against software you do not control.

It is not free: re-encoding a JPEG re-compresses it, which costs a small amount of quality. At sensible quality settings the loss is invisible, and a photograph that is accepted is worth more than a marginally cleaner one that is rejected.

How Celveri handles it

Every image tool on this site goes through one decode path, and that path asks the browser to apply the orientation tag as it decodes rather than relying on a default. The default has changed over the years and has not always been consistent between browsers, so it is specified explicitly instead of assumed.

Because the image is then redrawn and re-encoded, two things follow at once. The rotation is baked into the pixels, so the output is upright for every reader. And the output carries no EXIF at all — canvas encoding discards it — so the GPS coordinates, device details and timestamp are gone as well. The privacy problem and the orientation problem are solved by the same step, which is the only way they can safely be solved.

It is most visible in Image to PDF. A portrait photograph stored as a 1200 × 800 landscape frame tagged “rotate 90” produces an 800 × 1200 portrait page, not a landscape page with the photograph lying on its side. The page orientation follows the picture you took rather than the bytes the sensor wrote.

Working out which problem you have

Two questions separate the cases.

  • Right in your gallery, wrong after uploading? The tag is correct and the receiving software ignores it. Re-save the photograph through something that bakes the rotation in, then upload that.
  • Wrong everywhere, including your gallery? The tag itself is wrong or absent — this happens to screenshots of rotated images, files recovered from damaged storage, and images that have been through a metadata stripper. Rotate it properly and re-save.

And one thing not to do: do not rotate the image, check it in a viewer that honours the tag, and assume you are finished. That viewer will show it correctly whether you moved the pixels or only the note. Verify in whatever was rejecting it, or use a tool that re-encodes and therefore cannot leave the problem behind.

If you only need the photograph at a different size or in a different format, the resizer and the format converter both re-encode as a matter of course, so passing a sideways-uploading photo through either one will fix the orientation as a side effect — even if resizing or converting was not what you came for.

Tools that help with this

All guides