rotate image
The pixels are turned, not just a tag in the file.
The short answer
A quarter turn swaps the width and height; a half turn does not. The turn is applied to the pixels rather than written into the EXIF orientation tag, so the picture looks right in software that ignores EXIF, which is most software that is not a photo viewer.
A quarter turn at a time, saved as a lossless PNG. Nothing is recompressed and nothing is uploaded, so a sideways photo can be fixed without handing it to anyone.
The formula
rotate the canvas, then draw — 90°, 180° or 270°, losslessly
Worked examples
- 800 × 600 turned 90°
- 600 × 800
- 800 × 600 turned 180°
- 800 × 600
- Saved as
- PNG, so nothing is recompressed
Reference table
| Turn | Result | Use it for |
|---|---|---|
| 90° clockwise | 600 × 800 | A photo held sideways |
| 180° | 800 × 600 | A photo taken upside down |
| 270° | 600 × 800 | The other sideways |
| 0° | 800 × 600 | Flipping without turning |
How to use it
- 01Drop the image inOr pick a file. It is decoded by your own browser.
- 02Choose a turn90, 180 or 270 degrees. The preview updates so you can check before saving.
- 03Save the PNGLossless, so turning a photo costs it nothing in quality.
Also searched for
Searches that land here include rotate image, rotate photo online, turn image 90 degrees, rotate picture and fix sideways photo.
Turning an image
The orientation tag, and why it causes this
Phone cameras do not turn the sensor when you turn the phone. They record the picture as the sensor saw it and add an EXIF tag saying which way up it should be shown. Every photo app honours that tag. Browsers mostly do. Image libraries, older desktop software, upload processors and print services often do not, which is how one file ends up looking correct in two places and wrong in a third.
Rotating the pixels settles it
Applying the turn to the pixels and dropping the tag leaves nothing to interpret. The file is the picture, the right way up, everywhere. That is why this page does not offer to edit the tag instead: the whole reason to be here is that something was ignoring it.
Quarter turns only
Ninety, a hundred and eighty, two hundred and seventy. Arbitrary angles need interpolation, which softens every pixel in the image and leaves corners that have to be filled or cropped. That is a different job and belongs in an editor.
Questions people ask
Why is my photo sideways in the first place?
Because the camera recorded the orientation as a tag rather than turning the pixels. Photo apps read that tag; a lot of other software does not, so the same file looks upright in one place and sideways in another. Turning the pixels themselves is what makes it look right everywhere.
Does rotating lose quality?
Not here, because the output is a lossless PNG. Rotating a JPEG and saving it as a JPEG does cost a little, since it is re-encoded. Quarter turns are the one case where some software can rotate a JPEG losslessly, by rearranging the blocks rather than decoding them, but that is not what a canvas does.
Why did the file get bigger?
Because it is now a PNG. PNG stores every pixel exactly, which is usually larger than the JPEG it came from. If size matters more than losslessness, run the result through the JPEG or WebP tool afterwards.