2026-07-25
How to Rotate and Straighten a Photo Correctly
Rotate a sideways photo, level a crooked horizon, and un-mirror a selfie. Why EXIF rotation breaks in some apps and how to bake the fix into the pixels.

Last updated: July 25, 2026
A photo that looks perfectly upright in your phone's gallery arrives sideways in someone's email. A selfie has text in it that reads backwards. A landscape shot has a horizon that sits a couple of degrees off, and you cannot stop seeing it once you have noticed.
These are three different problems with three different fixes, and the first one has a cause that surprises people: the image was never actually rotated at all.
Quick answer
- Sideways photo that looks fine in some apps and not others: the rotation is stored only as metadata. Re-export it so the rotation is applied to the pixels.
- Crooked horizon: rotate by a small custom angle, not a quarter turn — and make sure the canvas grows rather than crops.
- Mirrored selfie: flip horizontally. Nothing needs rotating.
The Imagic AI Rotate Image tool does all three, in the browser, with no upload.
Why does a rotated photo show up sideways?
When a phone or camera takes a picture while held sideways, most of them do not rotate the pixels. They store the image exactly as the sensor captured it and add a small EXIF field called Orientation that says, in effect, "display this rotated 90 degrees clockwise".
Apps that read that field show the photo correctly. Apps that ignore it show the raw sensor data — sideways. That is the whole mystery. The photo is not corrupted and you are not imagining that it looked fine a minute ago; two pieces of software simply disagreed about whether to honour a flag.
Where this bites:
- Uploading to a website whose image pipeline strips or ignores EXIF
- Email clients and older document software
- Some print services
- Anything that re-encodes the image without re-applying the orientation first
The EXIF Orientation tag has eight possible values covering rotations and mirroring, documented in the EXIF tag reference. Handling all eight correctly is fiddly, which is exactly why so many tools get it wrong.
| Orientation value | Transform a viewer must apply | Typical case |
|---|---|---|
| 1 | None | Camera held upright |
| 3 | Rotate 180° | Camera held upside down |
| 6 | Rotate 90° clockwise | Camera held on its side |
| 8 | Rotate 90° anticlockwise | Camera held on its other side |
| 2, 4, 5, 7 | Mirrored, with or without a rotation | Front cameras, some scanners |
The values describe what a viewer has to do to show the image correctly — which way the camera was physically held for a given value is not standardised across manufacturers, so do not infer it.
Browsers have handled this consistently for image elements since the image-orientation property defaulted to respecting EXIF, as described in the MDN image-orientation reference — but that only governs display, not what happens when the file is handed to something else.
The fix is to stop relying on the flag. Open the image, apply the rotation to the actual pixels, and export a new file. Now every app agrees, because there is nothing left to disagree about. Any tool that decodes and re-encodes the image — including browser-based ones that draw it to a canvas — produces a file whose pixels are already the right way up.

Quarter turns versus custom angles
These are genuinely different operations and it is worth knowing why.
A quarter turn (90°, 180°, 270°) maps every pixel onto exactly one other pixel position. Nothing is interpolated, nothing is invented, no quality is lost, and the output dimensions are either identical or simply swapped. This is the operation you want for a sideways photo.
Any other angle requires the software to work out what colour each new pixel should be by sampling between the old ones. That is a real, if usually invisible, quality cost — and it changes the shape of the image, because a tilted rectangle no longer fits in its original bounding box.
That second consequence is where straightening tools differ, and it matters:
- Some crop the result back to the original frame, silently discarding the corners. Your horizon is level and you have quietly lost a strip from every edge.
- Some grow the canvas to fit the whole rotated image, leaving triangular gaps at the corners which get filled with a background colour.
Neither is wrong, but you should know which one is happening. Growing the canvas is the safer default — the loss from cropping is invisible until the moment you need those edges. The Rotate Image tool grows the canvas and fills the new corner areas with white, so nothing is thrown away without you seeing it.
If you would rather crop than have filled corners, straighten first and then crop deliberately with the Image Cropper, so you choose what to lose.
How do you straighten a crooked horizon?
Most crooked horizons are off by less than three degrees. The eye is remarkably good at detecting this and remarkably bad at estimating it, so work by adjustment rather than by measurement:
- Find a line in the image that you know should be level — the horizon, a windowsill, a table edge, the waterline.
- Nudge the angle in small steps and watch that line, not the whole picture.
- Stop as soon as the line reads flat. Overshooting in the other direction is easy.
- Decide what to do with the corners: keep the filled areas, or crop them away.
- Export.
A half-degree step is fine for most photos. Anything beyond about five degrees usually means the shot needs cropping and recomposing rather than levelling.
Two things worth knowing:
Vertical lines lie. Buildings and doorframes converge towards the top because of perspective, not because the camera was tilted. Straightening to make a building's edge vertical will often tip the horizon. Level on horizontals.
Straightening costs resolution. The final image, after you crop away the filled corners, is smaller than the original. If the photo is already at its minimum useful size, straighten before any other resizing.
Which operation you need, at a glance:
| Symptom | Operation | Lossless? | Changes dimensions? |
|---|---|---|---|
| Sideways in some apps only | Re-export with rotation applied | Yes (quarter turn) | Swapped for 90°/270° |
| Horizon off by a degree or two | Custom-angle rotation | No, resamples | Yes, canvas grows |
| Text reads backwards | Horizontal flip | Yes | No |
| Upside down | 180° rotation | Yes | No |
| Scan captured through the page | Horizontal flip | Yes | No |

Flip and mirror
Flipping is not rotation and does not lose anything — it reverses the pixel order along one axis.
Use it for:
- Front-camera selfies. Many phones save the mirrored preview you saw while framing. Any text in the shot reads backwards, which is the giveaway. A horizontal flip corrects it.
- Composition. Reversing an image changes where the eye enters the frame. Useful when placing a photo next to text.
- Scanned or photographed documents captured through the back of a page.
One thing that confuses people: on an image you have already turned a quarter turn, "flip horizontal" needs to act on the axis you are looking at, not the original one. A tool that gets this wrong makes the button appear to do the opposite of its label. The Rotate Image tool maps the flip to the visible axis, so the buttons always match what you see.

Common mistakes
Rotating the same JPEG repeatedly. Every save re-compresses. Quarter turns are lossless in principle, but only if the tool performs a true lossless rotation — most re-encode. Do all your adjustments in one pass and export once.
Fixing orientation by rotating the display. Changing how your viewer shows the image does nothing to the file. Export a new one.
Straightening before cropping when the crop is tight. Straightening eats into the edges; a tight crop afterwards may not have the pixels left. Straighten first, then crop, and check you still have the framing you wanted.
Trusting a thumbnail. Some file managers cache a thumbnail generated before the edit. Open the actual file.
Frequently asked questions
Is rotating a JPEG lossless? It can be — a true lossless rotation rearranges the compressed blocks without decoding, and some dedicated tools do this. Most general-purpose editors decode and re-encode, which costs a small amount of quality per save. In practice one round is not visible; ten are. Export PNG if you plan further edits.
Why does my photo rotate itself back? You almost certainly changed the EXIF orientation flag rather than the pixels, and something later ignored or reset the flag. Re-export the image so the rotation is in the pixel data.
Will this remove my photo's metadata? Re-encoding through a canvas produces a file built from pixels alone, so EXIF — including GPS coordinates — does not carry over. That is usually welcome. If you specifically need to keep camera data, use a tool that preserves EXIF explicitly.
Can I rotate several photos at once? Not with this tool, but the Batch Processor handles repeated operations across many files at once.
Does my image get uploaded? No. The Rotate Image tool decodes and redraws the image in your browser on your own device. Nothing is transmitted, and it keeps working offline once the page has loaded.
What format should I export? PNG if you are going to edit further or the image has text and sharp edges. JPEG if it is a photograph headed straight for the web and file size matters. You can always compress a PNG afterwards with the Image Compressor.
Summary
Most "rotation" problems are really metadata problems: the file was never turned, only labelled. Re-exporting with the rotation applied to the pixels ends the disagreement between apps for good.
For crooked horizons, use small custom angles, level on horizontal lines rather than vertical ones, and know whether your tool is cropping the corners away or filling them in. For mirrored selfies, flip — no rotation involved.
The Rotate Image tool covers quarter turns, custom-angle straightening, and both flips in one pass, so the file is only re-encoded once.
Image credits
- Captivating star trails create a striking spiral pattern over silhouetted trees at night. — photo by Harrison Haines on Pexels
- Colorful swing ride at an amusement park with people enjoying a thrilling day under the clear blue sky. — photo by Scott Webb on Pexels
- A dynamic close-up of a spinning rainbow-colored wheel creating a vibrant and colorful effect. — photo by Jan van der Wolf on Pexels
- Drone shot of a city roundabout surrounded by buildings and trees, showcasing urban transportation. — photo by K on Pexels
Use the free tools while you follow the guide.
Keep reading

2026-07-25
AI Action Figure Photo: Source, Prompt, and QA Workflow
Make an AI action figure photo that still looks like the subject. Use this source-photo checklist, structured prompt, failure fixes, and output QA.

2026-07-25
How to Blur Faces and License Plates Before You Post
Blur or pixelate faces and license plates so they stay unreadable. Which method actually anonymizes, what fails, and how to avoid leaking EXIF location data.

2026-07-25
How to Make a Meme: Text, Fonts, and Export Settings
Make a meme that stays readable everywhere. Why Impact works, when captions belong outside the image, and which export settings survive social platforms.