Rotate and Flip an Image Online: 90 Degrees, Any Angle, Mirror
Turn a picture 90 degrees left or right, 180 degrees, or by any angle you type, and flip it left to right or top to bottom.
Maintained by Hirantha Sandaruwan Lakshan. Updated 15 October 2026.
About this tool
The preview updates as you click, and you can combine the steps in any order. Save the result as PNG, JPEG or WebP; the file keeps its name with a suffix such as -rotated. Everything happens in your browser, so the photo never leaves your device.
How it works
Every mix of turns and mirror images reduces to one of two things: a rotation by some angle, or a left-to-right mirror followed by a rotation. The tool keeps just that pair, and each button updates it. A turn adds to the angle. Flip horizontal switches the mirror and reverses the angle. Flip vertical switches the mirror and sets the angle to 180 minus the angle, because a top-to-bottom mirror is a left-to-right mirror plus a half turn. So flipping left to right and then top to bottom gives a half turn, exactly as it should.
The picture is drawn with a 2D transform matrix, the same six numbers a, b, c, d, e, f that canvas setTransform takes: a point (x, y) goes to (ax + cy + e, bx + dy + f). The matrix keeps the centre of the picture at the centre of the output, so turning never shifts it. For a free angle the canvas grows to the bounding box, |w cos t| + |h sin t| wide and |w sin t| + |h cos t| high, rounded up. You can instead keep the original size and let the corners be cut off, or fill the empty corners with a colour. A quarter turn or a flip puts every pixel exactly on the pixel grid, so nothing needs blending.
Phone photos are often stored sideways with an EXIF orientation tag that tells viewers to turn them. This tool opens files with createImageBitmap, whose imageOrientation option defaults to from-image (MDN), so the tag is applied when the file is decoded and the size and preview match what you see in a gallery. The saved file is drawn from a canvas, so it carries no orientation tag and will not turn a second time in another app. In MDN browser-compat-data the imageOrientation option is in Chrome 52, Firefox 93 and Safari 15 or newer (checked on 2026-10-15).
Canvases have size limits that differ by browser and device, and browsers give no error when you go over. The canvas-size project's test results list 16,384 x 16,384 pixels (268,435,456) for desktop Chrome and Safari, 23,168 x 23,168 for Firefox 122 and newer, and 4,096 x 4,096 (16,777,216) for Mobile Safari, and say that each browser and platform combination has its own limits. This tool works out the output size before it draws. It uses 16,384 pixels per side and 268,435,456 pixels as its desktop ceiling and 4,096 per side and 16,777,216 pixels on phones and tablets, and tells you when it had to scale the result down. JPEG and WebP quality is the 0 to 1 quality of canvas toBlob; PNG is lossless.
Worked examples
A phone photo, 4000 x 3000, turned right
Rotate right 90 degrees gives a 3000 x 4000 picture. The width and height swap, and each pixel moves exactly: the left column, read from the bottom up, becomes the top row.
Straightening a tilted shot by 3 degrees
Set the angle to 3 or -3 and watch the preview. A 4000 x 3000 picture needs a 4152 x 3206 canvas: 4000 cos 3° + 3000 sin 3° = 4151.5 rounds up to 4152, and 4000 sin 3° + 3000 cos 3° = 3205.2 rounds up to 3206. Choose Keep size to stay at 4000 x 3000 and lose the corners, or pick a fill colour for the empty corners.
A front-camera selfie that saved mirrored
Flip horizontal reverses left and right, so text and logos that read backwards read correctly again. Save as PNG to keep every pixel exactly as it is.
What each button does to a picture whose pixels read 1 2 3 on top and 4 5 6 below
| Action | Result size | Rows of the result |
|---|---|---|
| Rotate right 90° | 2 × 3 | 4 1 / 5 2 / 6 3 |
| Rotate left 90° | 2 × 3 | 3 6 / 2 5 / 1 4 |
| Rotate 180° | 3 × 2 | 6 5 4 / 3 2 1 |
| Flip horizontal | 3 × 2 | 3 2 1 / 6 5 4 |
| Flip vertical | 3 × 2 | 4 5 6 / 1 2 3 |
| Flip horizontal, then rotate right 90° | 2 × 3 | 6 3 / 5 2 / 4 1 |
Frequently asked questions
Will rotating a JPEG lower its quality?
Saving as JPEG or WebP compresses the picture again, so a small loss is possible each time. This tool redraws the picture and re-encodes it; it does not do the special lossless JPEG rotation some desktop programs offer. Save as PNG for a lossless result, or keep the quality slider high.
Why does my phone photo look sideways in some programs but right here?
Phones often store the pixels sideways and add an EXIF orientation tag. Programs that read the tag show the photo upright; programs that ignore it show it sideways. Here the browser applies the tag when it opens the file, and the saved file has no tag, so the pixels themselves are upright and every program agrees.
Can I rotate by an exact angle such as 15.5 degrees?
Yes. Type the angle in the box or drag the slider. Positive numbers turn the picture clockwise and negative numbers anti-clockwise, from -180 to 180 degrees, and decimals are accepted. The buttons add to the angle you have set.
What happens to the empty corners when I rotate by a free angle?
By default the canvas grows so nothing is cut off, and the new corners are transparent in PNG and WebP. Pick a fill colour to paint them. JPEG cannot be transparent, so a transparent fill is saved white for JPEG. Or choose Keep size, which stays at the original width and height and cuts the corners off.
Is there a maximum image size?
Browsers limit how large a canvas can be, and the limits vary by browser, device and memory. This tool plans the size first. If the rotated result would be too large for your device, the saved file is scaled down and the page says what size it used. This tool's ceiling on a phone or tablet is 4,096 x 4,096 pixels.
What is the file called when I save it?
The original name without its extension, then a suffix and the extension of the format actually written: -rotated, -flipped, -edited when you combine a mirror with another angle, or -copy if nothing was changed. IMG_0042.jpg saved as PNG after a turn becomes IMG_0042-rotated.png.
Does it work on animated GIFs?
Only the first frame is used, and the saved file is a still picture. The page warns you when it detects an animated GIF, WebP, PNG or AVIF.
Can I rotate a HEIC photo from an iPhone?
Convert it to JPG first with the HEIC to JPG tool on this site. Most browsers cannot draw HEIC on a canvas, so this tool says so instead of failing silently.
Is my photo uploaded anywhere?
No. The file is opened and redrawn inside your browser tab and never sent over the network.
Sources & references
Updated Oct 15, 2026