You photograph a document with your phone, convert the photos to a PDF, and every page is turned 90 degrees. Open the original photo and it looks perfectly upright. The same thing happens with photos from many Android phones and digital cameras.
Nothing is wrong with the photo. The orientation lives in a small piece of metadata, and some converters never read it.
What the orientation tag is
A camera sensor writes pixels in one fixed order, regardless of how you hold the phone. To record which way was up, the camera stores a number in the photo's EXIF metadata, the Orientation tag. The value says how the image should be rotated for display:
| Value | Meaning |
|---|---|
| 1 | Upright, no change |
| 3 | Rotate 180° |
| 6 | Rotate 90° clockwise (a portrait photo, phone held upright) |
| 8 | Rotate 270° clockwise (90° anticlockwise) |
Values 2, 4, 5 and 7 are the mirrored versions. A photo taken with the phone held upright is typically stored as a landscape pixel grid with the value 6, and the viewer is expected to turn it.
Browsers, gallery apps and Preview all do. The tag is respected so consistently that most people never learn it exists.
Why a PDF comes out sideways
A JPEG placed in a PDF is embedded as an image object, and PDF has no notion of EXIF. A converter that takes your JPEG bytes and drops them onto a page shows the raw pixels, which are in sensor order. The tag is ignored, so the page is sideways.
Tools that read the tag and either rotate the pixels or rotate the page get it right. Tools that do not, will not, and there is no setting in your photo that can fix them.
Four ways to fix it
1. Use a converter that applies the orientation. The JPG to PDF tool on this site decodes each image through the browser, which applies the tag, and then places the upright result. The cost is that images are re-encoded as JPEG at 92% quality and capped at 4,000 pixels on the long side, so it is not a byte-exact copy.
2. Rotate the finished PDF. If the pages are already sideways, turn them with Rotate PDF. Choose all pages, 90° clockwise or anticlockwise, and the rotation is written into the file. To turn only some pages, use Organize PDF, where you can see each page.
3. Bake the rotation into the photos first. Open each photo in an editor and export it, or let a command-line tool do the whole folder:
magick mogrify -auto-orient *.jpg # ImageMagick, rewrites files in place
-auto-orient rotates the pixels to match the tag and resets the tag to 1, so every tool afterwards agrees. Work on copies, since JPEG is re-encoded.
4. Take the photos as the shape you want. Screenshots have no orientation tag, which is why they never have this problem.
Find out what a photo is claiming
If you have ExifTool installed, it shows the stored value:
exiftool -Orientation -n photo.jpg
# Orientation : 6
Leave off -n and it prints a description such as "Rotate 90 CW" instead of the number. A 6 on a portrait photo means the pixels are stored sideways and rely on the tag. If the value is 1 and the picture still looks sideways, the pixels themselves are turned, so -auto-orient will change nothing and the photo needs a real rotation.
For paper documents, scan instead of photographing
If the goal is a PDF of a paper document, skip the photo step. On an iPhone, the Notes app's Scan Documents feature, which is also available from the Files app, produces an upright PDF directly, with no orientation tag involved at all.
HEIC adds a second problem
iPhones save photos as HEIC by default. Many tools do not read HEIC at all, and those that do vary in whether they apply its rotation. On the phone you can switch to JPEG under Settings, Camera, Formats, Most Compatible. In the browser, only Safari can decode HEIC, so on other browsers, convert the files to JPEG first.
The same tag causes other surprises
Orientation is also the reason a photo can look right on your phone and wrong on a website, or the reverse. CSS handles it by default now: the image-orientation property defaults to from-image, as MDN documents, which is why web pages display phone photos upright without any help. Programs that read the raw bytes of the image, such as PDF writers and many image libraries, have to apply it themselves, and the ones that do not are the sideways pages you have just seen.
A batch can mix orientations
Photos taken with the phone held in different positions carry different orientation values, so one folder can contain 1s, 6s and 8s. After converting, scroll through every page of the PDF rather than checking only the first. A converter that handles the tag for some images and not others is rarer, but a mixed batch is the quickest way to expose one.
Quick checklist
- Pages sideways after conversion: the converter ignored the tag. Rotate the PDF, or convert again with a tool that applies it.
- Photo upright in your gallery but sideways in one app: that app ignores the tag.
- A folder of photos you will convert more than once: run
-auto-orienton copies of them first.