How It WorksPublished 7 min read

What Exif Orientation Means: Values 1 to 8 and Why Photos Turn Sideways

You take a portrait photo on your phone, and the moment you put it on your computer or blog it lies on its side. Or you strip the Exif data and the photo falls over. Almost every case comes down to one Exif field: Orientation. This article explains what each Orientation value from 1 to 8 means, why photos are saved sideways in the first place, how to fix a photo that displays sideways, and how to keep just the orientation when you remove Exif.

Photos are often saved “lying on their side”

Camera sensors are wider than they are tall. Even when you hold your phone upright, the image data read from the sensor is written to the file in landscape, in other words turned 90 degrees. The camera then adds a single instruction in the Exif saying “rotate 90 degrees clockwise when you display this”. That instruction is the Orientation tag.

Actually rotating the image data and saving it again would mean recompressing a JPEG, which takes time and slightly lowers the quality. Writing one instruction is instant and leaves the quality untouched. That’s why cameras and phones do it this way.

What Orientation values 1 to 8 mean

Orientation is a whole number from 1 to 8 that says how the stored data should be rotated or flipped when it is displayed. The ones you normally see are 1, 3, 6 and 8. Values 2, 4, 5 and 7 include a mirror flip, so they only turn up in limited situations, such as mirrored selfies or scanners.

ValueWhat to do when displayingWhere you see it
1As is (no rotation)Photos taken in landscape, screenshots
2Flip horizontallySelfies with the mirror setting turned on
3Rotate 180 degreesPhotos taken with the camera upside down
4Flip verticallyRarely seen
5Flip horizontally, then rotate 90 degrees counter-clockwiseRarely seen
6Rotate 90 degrees clockwisePhotos taken with the phone upright (the most common)
7Flip horizontally, then rotate 90 degrees clockwiseRarely seen
8Rotate 90 degrees counter-clockwisePortrait photos taken with the phone held the opposite way from 6

6 and 8 are both portrait photos, but the phone was held 180 degrees differently. Depending on whether the camera lens is at the top or the bottom when you hold the phone upright, the stored data ends up facing the opposite way. It’s not unusual for one person’s portrait photos to be a mix of 6 and 8.

Why removing Exif makes photos lie on their side

If you use a tool that “removes all Exif” to get rid of the location, Orientation goes with it. With the “rotate when displaying” instruction gone, a portrait photo that had Orientation = 6 shows its landscape data as it is, lying 90 degrees to the left.

There are two ways to prevent this. One is to remove the rest of the Exif but keep Orientation. The Photo Exif & Location Checker’s “Remove everything” puts back only the orientation by default, so portrait photos stay upright after cleaning. The other is to rotate the image data itself before saving and set Orientation to 1. That means recompressing the JPEG, so the quality drops slightly.

MethodOrientationImage quality
Remove all ExifPortrait photos may lie on their sideUnchanged
Remove everything except OrientationUnchangedUnchanged
Rotate and redraw the image, set Orientation to 1UnchangedJPEG loses a little quality from recompression
Re-export with an image converterUsually unchanged, since the browser rotates before drawingJPEG loses a little quality from recompression

If you want to strip only the location without losing quality, see how to remove Exif without losing quality.

How to fix a photo that displays sideways

  1. 1

    Check the Orientation value first

    Load the photo into the Photo Exif & Location Checker and use “Show all items” to find the Orientation value. If it’s 6 or 8, the problem is that the software isn’t reading this instruction. If it’s 1 and the photo is still sideways, the orientation was misjudged when the photo was taken.

  2. 2

    Make it readable for whatever displays it

    If your blog or CMS ignores orientation, rotate the photo once in a photo app and save it again, or run it through a tool that rotates and re-exports the image. The data itself then faces the right way, and every program shows it the same way.

  3. 3

    Make sure it isn’t rotated twice

    If you rotate the data but Orientation is still 6, software that reads Orientation will turn it another 90 degrees and it will fall over the other way. As a rule, once you rotate the data, set Orientation to 1.

How orientation works in PNG and HEIC

  • JPEG: decided by Orientation inside the Exif (APP1). This is by far the most common case.
  • PNG: originally had no orientation information, but Exif can now be stored in an eXIf chunk, and some software reads Orientation from there. Screenshot PNGs normally don’t have it.
  • WebP: Exif can be stored in an EXIF chunk. WebP files converted from JPEG may or may not have carried over the Orientation.
  • HEIC (iPhone): orientation is set by HEIC’s own rotation information, separate from Exif. So removing Exif from a HEIC doesn’t change how it’s displayed.

Because each format stores orientation differently, a photo can suddenly display the wrong way after you convert HEIC to JPEG. The steps and pitfalls are covered in how to convert HEIC to JPEG.

FAQ

What does Exif Orientation 6 mean?
It means “rotate the stored image 90 degrees clockwise when displaying it”. It’s the most common value for photos taken with a phone held upright, and the data itself is stored in landscape. Open it in software that ignores Orientation and the photo appears tipped over to the left.
What’s the difference between Orientation 8 and 6?
They rotate in opposite directions. 6 rotates 90 degrees clockwise and 8 rotates 90 degrees counter-clockwise. Both are portrait photos, but if the phone was held 180 degrees differently when the photo was taken, the recorded value switches.
Why did my photo turn sideways after I removed the Exif?
Because the instruction for rotating it on display (Orientation) was removed too. The data is still stored in landscape, so without the instruction it displays sideways. Remove everything except Orientation, or rotate the image and save it again.
Why do my photos rotate by themselves when I upload them to my blog?
Either the upload process threw away the Exif and lost the Orientation instruction, or the software displaying it doesn’t read Orientation. Rotate the photo in a photo app and save it again before uploading so the data itself faces the right way, and it will look the same wherever you post it.

Tools in this article

Related articles

Security7 min read

Can a Cropped Photo Still Show the Original? Checking and Removing Embedded Exif Thumbnails

You cropped out an address at the edge of a photo, or covered a face with a sticker, and posted it feeling safe. Yet sometimes the part you removed can still be found in the file. The culprit is a small preview image stored inside the photo: the embedded Exif thumbnail. This article explains what the thumbnail is, why it can keep the unedited picture, how to tell whether one is left, and how to remove just the thumbnail.

Read article →
Security7 min read

Can a Photo Reveal Your Camera’s Serial Number? Checking and Removing It from Exif

Few people realise that the serial number of their camera can be read from photos they post on a blog or social media. Photos from DSLRs and mirrorless cameras may have the serial numbers of the camera body and lens recorded in their Exif. This article explains which fields hold serial numbers, what can happen if someone reads them, how phone photos differ, and how to check for and remove them.

Read article →
How-to Guide8 min read

How to Remove Exif Without Losing Quality: Lossless Removal and Stripping Only the Location

Look up how to remove location data from photos and you’ll often be told to re-export the image with a converter or take a screenshot of it. That does remove the Exif, but because the JPEG is compressed again, the quality drops slightly. This article explains how Exif can be removed without touching the image data, how to remove only the location while keeping the date taken, how to clean many photos at once, and how to check the result.

Read article →