Your photo is not really sideways: it was saved that way on purpose, with a small note in its EXIF data saying how to turn it for display. Phones and cameras store the pixels as the sensor read them and record the turn in a tag called Orientation. Your phone's gallery reads that tag, so the photo looks right there. A website, app or script that ignores the tag, or strips it without turning the pixels first, shows the raw pixels, and those are sideways.
What is the EXIF Orientation tag?
It is one number, stored in the photo's EXIF block as tag 0x0112, that tells software how to turn or flip the stored pixels before showing them. ExifTool's tag reference lists its eight values:
| Value | What a viewer should do |
|---|---|
| 1 | Nothing: the pixels are already upright |
| 2 | Mirror horizontally |
| 3 | Rotate 180 degrees |
| 4 | Mirror vertically |
| 5 | Mirror horizontally and rotate 270 degrees clockwise |
| 6 | Rotate 90 degrees clockwise |
| 7 | Mirror horizontally and rotate 90 degrees clockwise |
| 8 | Rotate 270 degrees clockwise |
A photo taken with a phone held upright is often stored with 6: the sensor read it lying on its side, and the tag says to turn it a quarter turn clockwise. Values 2, 4, 5 and 7 also mirror the image.
Why does it look right on my phone but not on a website?
Because your phone reads the tag and the other software does not, or no longer has it. There are three common ways that happens:
- The tag was removed but the pixels were not turned. Many uploaders strip EXIF data to protect privacy, which is a good idea (it is also where your location lives). If they strip it before turning the pixels, the turn is lost with it.
- The software never reads it. Server code that resizes uploads often decodes the pixels and nothing else. Go's standard JPEG decoder, for example, does not read EXIF at all, which is why Heart Photos reads the tag itself (more on that below).
- The software is old. Chrome and Safari have only turned images by their tag by default since Chrome 81 and Safari 13.1 (see the next section), so older browsers, old email clients and some desktop programs still show the raw pixels.
The opposite mistake happens too: a tool turns the pixels but leaves the tag in place, and a viewer that reads the tag turns the photo a second time. That is why a correct fix always does both, turning the pixels and then removing or resetting the tag.
Do web browsers fix the orientation themselves?
Yes, today they do. The CSS Images Module Level 3 gives the image-orientation property the initial value from-image, which means "use the orientation in the image's metadata", and it applies both to img elements and to CSS background images. MDN's page on the property describes the same default.
MDN's compatibility data lists support from Chrome 81, Edge 81, Firefox 26 and Safari 13.1. Chrome's own feature entry says that release is when it made from-image the default and applied it to all images, so a JPEG with an Orientation tag shows upright unless a page asks for image-orientation: none.
So if a photo is sideways in a current browser, the tag is almost always gone, not ignored. The site turned your file into a new copy without it.
How common are sideways originals?
We checked on Nov 11, 2026. We took the 233 photos the public Heart Photos wall listed first, fetched the first 128 KB of each original file from i.heart.photos/<id>/original, and read the Orientation tag out of the EXIF block with a short Python script.
| What the original was | Photos |
|---|---|
| Not a JPEG (PNG, WebP and others) | 28 |
| JPEG with no EXIF block | 42 |
| JPEG with EXIF but no Orientation tag | 105 |
| JPEG with Orientation 1 (upright) | 56 |
| JPEG with Orientation 6 or 8 (stored on its side) | 2 |
Only 2 of the 205 JPEGs were stored on their side: one from a Samsung phone (Orientation 6, stored 4032 x 1816) and one from a Canon compact camera (Orientation 8, stored 4000 x 3000). Most images on our wall were made by AI or exported from editors, which write upright pixels, so a folder straight off a phone will have far more. Both of those photos are served upright on Heart Photos, as tall images (1280 x 2841 and 1280 x 1706 at the size we fetched), so the turn was applied before the copies were made.
How do I fix a sideways photo?
For one photo: open it in any editor, rotate it until it is upright, and export or save a new copy. Then check the new file's pixel width and height: a portrait photo should be taller than it is wide. If the numbers did not swap, the program only changed the tag, and the photo will be sideways again wherever the tag is removed.
For many photos, in code: turn the pixels by the tag, then drop the tag. Two well-documented ways:
- In Node.js with sharp,
autoOrient()turns the image by its EXIF Orientation tag and then removes the tag. - In Python with Pillow,
ImageOps.exif_transpose()does the same for any tag other than 1.
from PIL import Image, ImageOps
img = ImageOps.exif_transpose(Image.open("photo.jpg"))
img.save("photo-upright.jpg", quality=90)
Run this before you strip metadata or resize, never after.
Frequently asked questions
Why is my photo sideways only after I remove its location data?
Because the tool removed all EXIF data, the Orientation tag included, without turning the pixels first. Turn the photo upright and save it, then remove the location. Our guide to removing location data from a photo covers the second step.
Why does my photo look upside down rather than sideways?
It carries Orientation 3, which asks for a 180 degree turn, and whatever shows it has lost or ignored the tag. The fix is the same.
Does rotating a JPEG lose quality?
Turning the pixels by a quarter turn loses nothing in itself, since every pixel just moves. Saving the result as JPEG again does, because JPEG is lossy. Our post on what JPEG quality to use shows what re-saving at different qualities costs.
Do HEIC photos have the same problem?
They can. A HEIC file can record a turn too, and a converter that drops it without turning the pixels gives the same sideways result. Our guide to converting HEIC to JPEG covers converting them safely.
Can I stop a browser from turning an image?
Yes, with image-orientation: none in CSS. MDN warns that it is meant only for correcting how an image was shot, and that for any other rotation you should use transform instead.
What Heart Photos does
When you upload a JPEG or a TIFF, Heart Photos reads its Orientation tag and turns the pixels before it makes any of the AVIF copies it serves, because those copies carry no EXIF data for a browser to read. HEIC and AVIF uploads are turned by their own decoders the same way. That is what happened to the two sideways originals in our count above.
Your original is kept too. A JPEG is stored losslessly, tag and all, and Download Original hands back the very file from your camera, byte for byte.
If a photo still needs turning (a scan, or a photo taken with the camera pointing down), the Rotate buttons in the viewer's sidebar turn it a quarter turn at a time. On your own photos the turn is saved for everyone who views it, without touching the file; on anyone else's it turns only for you. Save as new makes a separate image with the turn written into its pixels, made once from your untouched original.
To see it with your own phone photos, Open Heart Photos and upload one.