Auto-Rotate a Photo to its Correct Orientation

Upload a photo that shows up sideways — the EXIF orientation flag is applied to the pixels and stripped, so every app shows it upright.

Try:
Upright image

Why Photos Come Out Sideways

A phone camera almost always writes its pixels in the same sensor order, no matter how you held it. How the phone was held is recorded separately, as a small EXIF field called Orientation with a value from 1 to 8. Photo apps that read that field rotate the picture for you; a lot of other software — upload forms, older editors, some print and CMS pipelines — ignores it and shows the raw pixels, which is why the same photo looks upright on your phone and sideways everywhere else.

This tool applies the correction to the pixels themselves and writes the result with no orientation tag at all. Upright pixels plus no tag means nothing downstream can rotate it again — the double-rotation you get from "fixing" a photo in a tag-aware editor and then opening it somewhere tag-aware can't happen.

Worked Example

A portrait photo taken on a phone, IMG_4821.jpg, 4032 × 3024 pixels, with Orientation = 6 ("rotate 90° clockwise to display"):

The width and height swap for the quarter-turn values (5, 6, 7, 8) and stay the same for 1, 2, 3 and 4.

The Eight EXIF Orientation Values

Each value names the correction needed to display the stored pixels the right way up. You normally never touch this — Auto reads it from the file. Pick one explicitly when the tag is missing (screenshots, scans, already-stripped files), or when it is simply wrong:

ValueWhat it meansWhat gets applied
1Already uprightnothing (the flag is just dropped)
2Mirrored left-righthorizontal flip
3Upside down180° rotation
4Mirrored top-bottomvertical flip
5Mirrored, quarter turntranspose
6Rotated 90° clockwise90° clockwise
7Mirrored, quarter turn the other waytransverse
8Rotated 90° counter-clockwise90° counter-clockwise

The four mirrored values (2, 4, 5, 7) are rare but real — they come from front-facing cameras and some scanners — and are handled here, not silently treated as plain rotations.

Limits and Edge Cases

FAQ

How is this different from just rotating the image?

A plain rotate turns the pixels by an angle you choose and leaves the EXIF orientation flag alone — so a tag-aware viewer applies the old flag on top of your rotation and the photo ends up wrong again. This tool reads the flag, applies exactly the transform it asks for (including mirroring, which a rotate-by-90° control can't express), and removes the flag so nothing gets applied twice. If you just want to turn a picture by a set angle, a rotate tool is the right one; if a photo is sideways only in some apps, this is the one.

My photo has no EXIF orientation — what happens?

Auto finds nothing to apply and the image comes back with its pixels unchanged (it is still decoded and re-encoded, so a JPEG is re-compressed at your chosen quality). Screenshots, exports from most editors, and files that have already been through a metadata stripper all land here. Fix them by selecting the value that matches what you see: 6 for a photo lying on its right side, 8 for its left side, 3 for upside down, 2 for a mirrored selfie.

Is this lossless?

No. The photo is decoded and re-encoded once, so a JPEG loses a little quality at the default quality of 90 — visually hard to spot, but it is a real generation of loss. True lossless JPEG rotation works on the compressed DCT blocks instead of the pixels and is a different operation entirely; it is not offered here. To avoid loss completely, set the output format to PNG (lossless) — the file will be considerably larger.

Does the corrected file keep my GPS location and camera info?

No. The output carries no EXIF block at all, so the orientation flag, GPS coordinates, camera make and model, lens, and capture timestamp are all gone. This is usually what you want before posting a photo publicly, but if you need that metadata, keep the original file alongside the corrected one.

Can I fix a whole folder of holiday photos at once?

Not on this page — it handles one file per run. For bulk work, use the command line example above in a shell loop over your files; each run is a single, independent invocation.

Is my photo uploaded to a server?

No. ffmpeg is compiled to WebAssembly and runs inside your browser tab, so the image is decoded, rotated and re-encoded on your own machine. Closing the page discards everything.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool image-auto-orient 'url=https://example.com/input' 'orientation=auto' 'format=same' 'quality=90'

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/image-auto-orient/?url=https://example.com/input&orientation=auto&format=same&quality=90

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.