Skip to content

EXIF Orientation: why some photos show up sideways

EXIF Orientation tells software how to rotate a photo for display. The eight values, why photos appear sideways, and why cleaning must keep this tag.

What is the EXIF Orientation tag?

Orientation

Orientation is an EXIF tag, number 0x0112 in the first image directory (IFD0), that records how the stored pixels must be rotated or mirrored before display. Its value is a whole number from 1 to 8.

A camera sensor has one native layout, usually landscape. When you turn the phone to shoot a portrait, most cameras do not rotate the pixels. They save the image as the sensor saw it and write the correction into this tag. The viewer is expected to apply it.

What do the eight values mean?

Value Instruction
1 Display as stored
2 Mirror horizontally
3 Rotate 180°
4 Mirror vertically
5 Mirror horizontally, then rotate 270° clockwise
6 Rotate 90° clockwise
7 Mirror horizontally, then rotate 90° clockwise
8 Rotate 270° clockwise

Values 1, 3, 6 and 8 cover a camera held level, upside down, or turned either way. The mirrored values are rare in camera output.

What we measured

We made a 400 × 300 pixel JPEG and set Orientation to 6. ExifTool reports it as Rotate 90 CW, and software that honours the tag shows the picture as a 300 × 400 portrait. Nothing about the pixels changed; the tag alone decides which way up the image appears.

We then removed all metadata from two copies of that file.

  • A plain exiftool -all= deleted the tag. The file now displays as a landscape image lying on its side.
  • Our own cleaning, the code behind the metadata remover, removed everything else and wrote Orientation back. The tag still read Rotate 90 CW, and the pixel data was byte for byte identical to the original.

That difference is why a careless cleaner turns portrait photos sideways.

Why do photos turn sideways?

Two situations produce it, and they fail in opposite directions.

  • The tag is removed but the pixels are not rotated. A cleaner or an export strips metadata without applying the turn first. The file no longer knows it was a portrait.
  • The tag is kept but ignored. Software that does not read Orientation shows the stored layout. The same file looks right in one app and wrong in another.

Rotating a photo in an editor usually fixes both at once: it turns the pixels and resets the tag to 1, so there is nothing left to interpret.

Is Orientation a privacy risk?

No. It says how the camera was held, nothing about who held it or where. It is one of the two things worth keeping when you clean a photo, the other being the colour profile.

Sources

  1. Exchangeable image file format for digital still cameras: Exif Version 3.1 (CIPA DC-008-Translation-2026) - CIPA and JEITA, 30 January 2026 (www.cipa.jp), accessed
  2. EXIF Tags - ExifTool, Phil Harvey (exiftool.org), accessed

Frequently asked questions

What does EXIF Orientation 6 mean?
Value 6 means the stored image must be rotated 90 degrees clockwise to display correctly. It is the usual value for a photo taken with a phone held upright.
Why does my photo appear sideways after upload?
The pixels are stored sideways and the Orientation tag carries the correction. If a tool removes the tag without rotating the pixels, or the software showing the image ignores the tag, the photo appears turned.
Does removing metadata remove the orientation?
It depends on the tool. A blanket removal deletes the tag along with everything else. Pixvisor copies Orientation and the colour profile back after removing the rest, so the photo still displays the right way up.