Why your photo turns sideways after you upload it (EXIF orientation)
It is upright in your gallery, upright on your laptop, and then the website, the email or the job-application form shows it lying on its side. Nothing is wrong with the photo; something along the way is ignoring a note inside the file.
What is going on
A camera sensor has one fixed orientation. When you hold the phone upright, many phones still store the pixels the way the sensor saw them (on their side) and write a small EXIF field, Orientation, with a value such as 6 (“turn right 90°”). Your gallery, your laptop's photo viewer and modern browsers read the field and turn the picture as they draw it, so you never notice.
Trouble starts when something in the chain does not respect the tag:
- Upload pipelines that strip metadata (often for privacy) but forget to apply the turn first, so the tag is gone and the sideways pixels remain.
- Older software, some email clients and office programs, and some print services that never read the tag.
- Server-side resizers configured without an “auto-orient” step.
- Editing on one device, where an app turned the pixels but kept the old tag, so a viewer that respects the tag turns the picture a second time.
The fix for one photo or a hundred
Save a copy where the turn is part of the pixels and the tag says “as is”. Then it no longer matters whether anything reads the tag.
- Open the batch photo rotator and add the photos. The preview shows them the way a tag-aware viewer would.
- If any still look wrong, turn them (each has an Undo).
- Keep Redraw the picture selected and tick Include photos I did not turn, so even the ones that look right in the preview get their turn baked in. Download the copies and upload those.
Redrawing also drops the GPS location that phones often store. If you need to keep the file small at the same time, the image compressor applies the stored turn too.
If you build the website
- Browsers: CSS
image-orientation: from-imageis the default for<img>in current browsers, andcreateImageBitmap(file, {imageOrientation: "from-image"})applies the tag before drawing on a canvas. Very old browsers drew canvas images unturned. - Servers: apply the orientation before stripping metadata or resizing:
sharp().rotate()with no arguments, Pillow'sImageOps.exif_transpose(img), ImageMagick's-auto-orient, libvipsautorot. - Order matters: auto-orient first, then resize, then strip metadata. Stripping first loses the information you needed.
- Thumbnails and width/height: for tags 5–8 the displayed width and height are swapped. Use the oriented size when you set aspect ratios, or tall photos get squashed boxes.
What is the hidden tag? Wirebook's EXIF explainer covers orientation, dates and GPS in plain English.
Related
What else the hidden notes say (location, date, phone) · Photo sideways in Word, Outlook or email · Batch photo rotator (in your browser) · Rotate a JPEG without losing quality · Remove GPS from a photo · Compress many photos at once
Questions
Why is my photo upright on my phone but sideways on a website?
Your phone reads the hidden Orientation tag and turns the picture; the website either removed the tag or ignores it, so it shows the pixels as they were stored, sideways.
How do I stop photos rotating when I upload them?
Upload a copy where the turn is applied to the pixels. A tool that redraws the photo, such as the batch photo rotator in its default mode, does that and resets the tag.
Why does my photo get turned twice?
An app rotated the pixels but left the old Orientation tag, so a viewer that respects the tag applies the turn again. Redrawing the photo with the tag reset fixes it.
Is the Orientation tag the same as GPS data?
Both are EXIF metadata stored in the same block, but they are separate fields. Redrawing a photo removes both; changing only the Orientation tag keeps GPS.
Published · updated .