Why Your Phone Photos Rotate Sideways: A Quick EXIF Explainer
Phones do not physically rotate the pixels when you turn the device. They write a tag. Here is what EXIF orientation is, why some apps ignore it, and how to fix sideways photos.
Why Your Phone Photos Rotate Sideways: A Quick EXIF Explainer
You take a photo on your phone, hold it vertically, frame the shot, hit the shutter. The photo looks fine in your camera roll. Then you upload it to your laptop, attach it to an email, or post it to a forum, and suddenly it is rotated 90 degrees. The same image. Same file. Looks different in different places.
This is not a bug. It is a 30-year-old design decision that mostly works, except when it does not, and the cases where it does not are exactly the ones that frustrate normal people. Here is what is actually happening.
Camera sensors are always landscape
Inside every phone, the camera sensor is a rectangle. When the manufacturer installs the sensor, they pick an orientation, and that orientation does not change when you rotate the phone. The long side of the sensor is always horizontal relative to the device's internal axes.
When you rotate the phone to portrait, the sensor still captures a landscape rectangle. The phone could rotate those pixels in software before saving the file, which is how things used to work in the early days. But rotating an image in software has costs: it requires reading every pixel, doing math on it, and writing it back. That takes time, takes battery, and slightly degrades image quality due to interpolation.
So phones started doing something cleverer: they save the original sensor orientation as-is, and write a small piece of metadata that says "this image should be displayed rotated by X degrees." That metadata is the EXIF orientation tag.
What EXIF actually is
EXIF stands for Exchangeable Image File Format. It is a metadata format defined in 1995 and updated through the 2000s, originally for digital cameras. Every JPG file taken by a modern camera or phone contains an EXIF block in the file header, before the actual image data starts.
The EXIF block holds a long list of fields: camera make and model, lens type, focal length, shutter speed, aperture, ISO, white balance, GPS coordinates, the timestamp the photo was taken, and yes, the orientation.
The orientation tag is a single number from 1 to 8. It encodes both rotation and mirroring. The values you actually see in the wild are 1, 3, 6, and 8:
- 1: no rotation needed, this is the "natural" orientation.
- 3: rotate 180 degrees.
- 6: rotate 90 degrees clockwise (phone was held in landscape with the home button on the left, for example).
- 8: rotate 90 degrees counterclockwise (phone held the other way).
When you hold your phone vertically and take a picture, the sensor captures a landscape image and writes orientation 6 or 8 into the EXIF. The actual pixels are stored as a landscape rectangle. The tag tells viewers to rotate it for display.
Why some apps respect the tag and some do not
Here is where the system starts to break.
Modern image viewers, browsers, and operating systems all read the EXIF orientation tag and display the image correctly. iOS Photos, Android Gallery, macOS Preview, Chrome, Firefox, Safari, the Twitter web client, Instagram, Slack, almost every consumer tool you would name. These show the photo "the right way up" because they apply the tag during rendering.
But many older tools, low-level image processing libraries, and command-line utilities ignore EXIF orientation. They read the raw pixel data and display it as-is. To those tools, your "portrait" photo is just a landscape image with some weird metadata they have no idea what to do with. Examples include:
- Older versions of Microsoft Outlook on Windows
- Some forum upload pipelines
- A lot of programmatic image processing scripts (Python with naive PIL usage, for example)
- Some print labs and photo book services
- Most web servers serving raw uploaded files without thumbnailing
So the photo looks fine when you view it on your phone, looks fine when you preview it locally, but appears sideways the moment it touches a service that does not respect the tag.
This is the explanation for almost every "why is my photo sideways" question on the internet. The pixels are landscape. Some tools show you what the tag says it should be. Other tools show you what the pixels actually are.
How to fix a photo that is showing up sideways
The simplest fix: re-save the file with the rotation actually baked into the pixels. Once you have done that, the EXIF orientation tag goes to 1 (no rotation needed) and every tool, respectful or not, will show the image correctly.
A few ways to do this:
On a phone, the quickest method is to open the photo, rotate it 90 degrees, then rotate it back. Most phone photo apps will save out a new version with the rotation baked in. Confusingly, doing the rotation in-app and not actually changing the visible orientation tends to flatten the EXIF orientation into the pixels themselves, which is exactly what you want.
On a Mac, open the photo in Preview, choose Tools > Rotate Right then Tools > Rotate Left, and save. Same trick.
On Windows, open the photo in Photos app, edit it, and save a copy. Most editors normalize the orientation on save.
Programmatically, almost every modern image library has an "auto-orient" function that reads the EXIF tag, applies the rotation to the actual pixels, and resets the tag to 1. In ImageMagick it is -auto-orient. In Python's Pillow it is ImageOps.exif_transpose. Web canvas APIs have it built in via the imageOrientation option on createImageBitmap.
Why image processors strip EXIF entirely
There is another related question creators run into: "I uploaded a photo and the GPS coordinates leaked." Or: "I sent a screenshot and it included the device serial number in the metadata."
The fix is the same fix that solves the orientation problem, just one step further. Strip the EXIF block entirely during processing.
Why image tools do this:
Privacy. EXIF can contain GPS coordinates with five-decimal precision, which is enough to identify the exact building a photo was taken in. It can identify the phone model, sometimes the serial number, and the time of capture down to the second. Most people do not want this metadata distributed when they share an image.
File size. EXIF is small (usually a few KB at most), but a few KB per image adds up across an asset library.
Reliability. Once you strip EXIF, you no longer have to worry about whether downstream tools will respect the orientation tag. The pixels are oriented correctly. There is no tag to misread.
This is why most image compression and conversion tools, including Reezo's, strip EXIF as a deliberate default. The orientation is baked into the pixels, the privacy-sensitive fields are removed, and the file is smaller and more portable. If you specifically need the EXIF preserved (for camera metadata in a photo archive, for example), you typically want a different category of tool, like a dedicated photo management app that respects the metadata throughout its pipeline.
A quick test you can run
If you ever want to check the EXIF orientation of a specific photo, the easiest way is to drop it into Reezo's image compressor and see whether the output file looks the same as the input. If the original was sideways in some tools and the compressed version is upright everywhere, you have just baked in the orientation.
You can also use the command line:
exiftool -Orientation -Orientation# myphoto.jpg
That prints both the human-readable orientation and the raw numeric value.
The takeaway
Phone photos store a landscape rectangle of pixels with an instruction to rotate it on display. Modern apps follow the instruction. Older apps do not. When you upload a photo to anything that does not follow the instruction, the photo looks sideways.
The fix is to bake the rotation into the pixels themselves before uploading. Re-saving the photo through almost any modern tool does this automatically, and any image compression or conversion tool worth using will normalize the orientation as part of its processing.
The system mostly works. The places it does not are getting fewer every year as legacy tooling cycles out. But you will still hit it occasionally, and now you know why.
Open the tool.
Free with daily credits. The right tool for what you just read.
Related reading
Other articles
tools-tutorials
JPEG XL Is Back in Chrome. Here Is What That Changes for Web Images
Chrome removed JPEG XL in 2023. In February 2026 it quietly came back. The default-on flip is coming, and it changes which image formats you should serve.
11 min read
tools-tutorials
How PDF Compression Works in the Browser, and When Each Level Helps
A practical look at why PDFs get bloated, what compression actually changes inside the file, and how to pick a quality level. With real numbers from a browser-based tool.
10 min read
tools-tutorials
How to Merge PDF Files in the Browser Without Uploading Them
Combining PDFs is one of the most-Googled file operations on the web. Here is what merging actually does inside a PDF, how it can run in the browser without an upload, and what survives the combine.
10 min read