Rotation shows up more often than people expect. A phone held sideways while recording a photo produces a file that is technically the right way up in its pixel data but tagged with an orientation flag many programs ignore, a scanned document often lands upside down, and a landscape photo dropped into a portrait shaped slot needs a quarter turn to fit. Getting the orientation right before an image goes anywhere else avoids the awkward sideways thumbnail everyone has seen at least once.
Everything happens locally. The source file is decoded by the browser, redrawn onto a canvas that has been sized to fit the rotated result, and re encoded on your device, so a private photo never has to leave it to be turned the right way up.
The three quick rotations, and why 90 degrees is special
Rotating by exactly 90, 180 or 270 degrees is a lossless operation on the composition of the image, since every pixel simply moves to a new position without being blended with its neighbours. A 90 or 270 degree turn also swaps the width and height, so a 4000 by 3000 landscape photo becomes a 3000 by 4000 portrait photo, which this image rotator handles automatically by resizing the output canvas to match. Reaching for a tool that can rotate photo 90 degrees at a time is the fastest fix for that sideways case.
These quick rotations are the right choice almost every time a photo is simply the wrong way round, which is by far the most common rotation need. Reach for the arbitrary angle slider only when the content itself is tilted rather than the whole frame being sideways.
- Rotate 90 degrees clockwise when a photo taken in portrait mode is displaying sideways.
- Rotate 180 degrees when an image was scanned or captured upside down.
- Rotate 270 degrees, the same as 90 counter clockwise, for the opposite sideways case.
- Use the arbitrary angle slider when the horizon or a straight edge in the photo itself is tilted.
- Combine a 90 degree turn with a small arbitrary nudge when both problems exist in the same photo.
Rotating by an arbitrary angle, and why the canvas grows
Turning an image by an angle that is not a multiple of 90 degrees changes its bounding box. A square rotated by 45 degrees needs a larger square canvas to contain its corners without clipping them, and the same is true of any rectangle rotated by an angle in between. This image rotator calculates that larger bounding box automatically from the rotation angle and the original width and height, so an arbitrary rotation never crops the corners of your picture.
The area the original image no longer covers in that larger canvas is transparent by default, which is correct for a PNG output. If you export as JPG afterwards, those transparent corners are filled with a background colour instead, since JPEG cannot store transparency.
Small angle nudges, typically within five degrees in either direction, are what a straighten photo tool is used for: correcting a horizon line or a wall edge that came out slightly tilted in the original shot without changing the overall framing.
What rotation does not fix
Rotation changes orientation, not composition. If the subject is off centre or there is unwanted content at the edges, straightening the image will not remove it, since every pixel is preserved and simply spun around the centre point. Use a crop after rotating if the frame also needs adjusting.
Rotation also cannot correct perspective distortion, such as a photograph of a document taken at an angle that makes the rectangle look like a trapezoid. That is a different kind of transform entirely, and no amount of simple rotation will square it back up.
How this image rotator works under the hood
The tool decodes the source file, computes the bounding box of the rotated result using standard trigonometry on the width, height and angle, then creates a canvas at that new size. The canvas context is translated to its own centre, rotated by the chosen angle in radians, and the original image is drawn centred on that same point, which is the standard technique for rotating around a centre rather than a corner.
Because this all happens with browser built in canvas primitives, there is no server involved and no upload, which you can verify by watching your browser's network panel during a rotation. It also means there is no limit on how many times you rotate an image or how large the source file is, beyond what your device's own memory allows.
Choosing an output format after rotating
The rotated image keeps your source format by default. Choose PNG explicitly when an arbitrary angle rotation has introduced transparent corners you want to preserve, and choose JPG with a background colour and quality slider when you want a smaller file and are happy for those corners to be filled with a solid colour.
How to rotate an image
- 1
Add your image
Drag a photo or graphic onto the drop area, or click it to choose a file. Nothing is uploaded.
- 2
Choose a quick rotation or a custom angle
Tap 90, 180 or 270 degrees for a sideways or upside down image, or drag the angle slider to straighten a tilted one.
- 3
Pick a background colour for arbitrary angles
If you rotate by an angle that is not a multiple of 90, choose the colour that should fill the newly exposed corners.
- 4
Rotate and download
Press rotate, check the preview and the new dimensions, then download the result.
Related tools worth bookmarking
Sources and further reading
- MDN: CanvasRenderingContext2D.rotateThe canvas transform this rotator uses to turn an image around its centre point by a chosen angle.developer.mozilla.org
- WHATWG: The canvas element specificationThe living standard that defines the canvas coordinate system this rotator relies on for translate and rotate.html.spec.whatwg.org
Frequently asked questions
Common questions about the image rotator.
A 90, 180 or 270 degree rotation loses no quality at all, since every pixel simply moves to a new position with no blending. An arbitrary angle rotation does introduce a small amount of softening at the edges of shapes, because pixels have to be resampled at the new angle, though it is rarely visible at normal viewing size.
A 90 or 270 degree turn swaps the width and height, since a landscape photo becomes a portrait photo and vice versa. An arbitrary angle rotation grows the canvas further, because a tilted rectangle needs a larger bounding box to avoid clipping its corners.
No. Rotation happens entirely in your browser using the canvas element. The image is decoded, rotated and re encoded on your own device and never transmitted anywhere, which you can confirm by checking your browser's network panel while you rotate a file.
The larger canvas needed to fit a tilted rectangle leaves triangular gaps at the corners where the original image no longer reaches. Those gaps are transparent for a PNG output, or filled with the background colour you choose if you export as JPG, since JPEG cannot store transparency.
Yes. The arbitrary angle slider is designed for exactly that, typically a small correction of a few degrees to level a tilted horizon or a wall edge. Larger sideways or upside down problems are better solved with the quick 90, 180 or 270 degree buttons instead.
Yes, as long as the tool processes the file locally rather than uploading it. This image rotator never sends your file anywhere, so a private or sensitive photo stays entirely on your own device from the moment you drop it in to the moment you download the rotated result.
Yes. Rotate first if the image is sideways or tilted, since cropping a rotated frame is easier once it is the right way up. If you crop first and then rotate, the crop boundaries rotate with the image, which usually is not what you want unless that is the specific effect you are after.