Skip to main content
IF

Image Flip & Rotate

Flip an image horizontally or vertically and rotate it by any angle — quick 90/180/270° buttons or a free-angle slider, corners never clipped.

Did you like the tool? Thanks!
Share:

More Image Tools Tools

IC

Image Cropper

Crop any image to exactly the area you need, with a live preview — nothing is uploaded, everything happens in your browser.

IR

Image Resizer

Resize any image to an exact width and height in your browser — optional aspect-ratio lock, PNG/JPEG/WebP output, nothing uploaded.

IC

Image Compressor

Shrink an image's file size by re-encoding it at a chosen quality level — live before/after size comparison, JPEG/WebP/PNG output, done locally.

IT

Image to Base64

Convert an image into a Base64-encoded string — full data URI or raw Base64, character count, one-click copy, all done locally.

BT

Base64 to Image

Paste a Base64 string or data URI and preview the decoded image instantly — auto-trims whitespace, lets you pick the assumed format, download in one click.

PI

Placeholder Image Generator

Generate a simple placeholder image for wireframes and mockups — custom size, colors and text, auto-sized to fit, PNG/JPEG/WebP output.

IF

Image Format Converter

Convert an image between PNG, JPEG, WebP and BMP entirely in your browser — no upload, instant preview, adjustable quality.

FG

Favicon Generator

Turn any image into a complete favicon package — six PNG sizes plus a combined multi-resolution .ico file, generated locally in your browser.

AA

ASCII Art Generator

Turn a photo into text-based ASCII art, or type a short message as a large block-letter banner — both rendered entirely in your browser.

QC

QR Code Generator

Generate a real, scannable QR code from text, a URL, Wi-Fi details, an email address or a phone number — encoded entirely in your browser, no external API.

Everything processes locally in your browser — nothing is uploaded. The canvas resizes itself to fit the rotated image, so corners are never cut off.

How to Use Image Flip & Rotate

Choose an image, then toggle "Flip horizontal" and/or "Flip vertical" independently, and rotate using the quick 90°/180°/270° buttons or the free-angle slider and number field for any angle from 0 to 360°. The canvas resizes itself automatically to fit the rotated result, so nothing gets cropped off at the corners, no matter what angle you choose. Click download when it looks right — the output is always a PNG so any transparent areas created by the rotation are preserved.

About Image Flip & Rotate

Rotating an image by anything other than a clean 90-degree step introduces a problem that's easy to overlook: a rotated rectangle no longer fits inside a rectangle of the same size. Picture a landscape photo tilted by 30 degrees — its four corners now swing outward past the original frame, so if the output canvas stayed the same size as the input, those corners would simply be cut off, and the image would appear to have chunks missing from its edges. Handling this correctly requires calculating a new, larger bounding box sized to fit the rotated rectangle exactly, which is a well-known piece of trigonometry: for a rectangle of width `w` and height `h` rotated by angle `θ`, the smallest axis-aligned box that contains it has width `|w·cos θ| + |h·sin θ|` and height `|w·sin θ| + |h·cos θ|`. This tool applies that formula to every rotation, so the canvas is always exactly as large as it needs to be — no bigger, which would waste space and produce an unnecessarily large file, and no smaller, which would clip the image. Flipping is a conceptually simpler operation: a horizontal flip mirrors the image left-to-right (like a reflection in a vertical mirror), and a vertical flip mirrors it top-to-bottom. On an HTML canvas, both are done with the same `scale()` transform used for resizing, just with a negative value — `ctx.scale(-1, 1)` flips horizontally, `ctx.scale(1, -1)` flips vertically, and combining both flips is equivalent to a 180-degree rotation (which is why an image flipped both ways looks identical to one simply rotated 180°). Making the two flip toggles independent, alongside a separate rotation control, means you can combine any flip state with any rotation angle — flip horizontally and rotate 37 degrees, for instance — and the tool composes both transforms together correctly in a single render rather than treating them as separate, sequential operations that could interact unpredictably. A free-angle rotation, rather than only offering the common 90/180/270-degree steps, matters for straightening a slightly tilted photo — a horizon line that isn't quite level, a document scanned a few degrees askew, or a creative effect that calls for an unusual angle. The trade-off for a non-90-degree rotation is that the resulting canvas is no longer the same aspect ratio or orientation as the source image, and the corners of the original rectangle, now rotated away from axis-alignment, leave transparent triangular gaps at the corners of the new bounding box — this is a geometric consequence of rotating a rectangle to a non-right angle, not something this tool could avoid while still preserving the whole image, which is exactly why the output format for this tool is fixed to PNG: it's the format that can actually represent that transparency correctly, where JPEG would fill those gaps with an opaque background colour instead. As with every other canvas-based tool in this toolbox, the flip and rotation are computed entirely in your browser using the 2D canvas API — the image file never leaves your device, and the result only touches disk when you explicitly click download.

Details & Tips

Rendering order, precisely: given the original image at its natural width `w` and height `h`, and a chosen rotation angle in degrees, the angle is first converted to radians (`rad = angle × π / 180`). The new canvas dimensions are then computed with the standard rotated-rectangle bounding-box formula and rounded up (`Math.ceil`) rather than to the nearest integer, specifically to guarantee the box is never a fraction of a pixel too small due to floating-point rounding, which could clip a single row or column of pixels at the edge: `newWidth = ceil(|w·cos(rad)| + |h·sin(rad)|)`, `newHeight = ceil(|w·sin(rad)| + |h·cos(rad)|)`. Once the canvas is sized, the drawing itself uses four chained canvas transforms applied in this exact order: first `translate(newWidth / 2, newHeight / 2)`, moving the origin to the center of the new, larger canvas; then `rotate(rad)`; then `scale(flipHorizontal ? -1 : 1, flipVertical ? -1 : 1)`; and finally `drawImage(image, -w / 2, -h / 2, w, h)`, which draws the original image centered on the (now transformed) origin. Because canvas transforms compose as a single matrix rather than being applied as separate sequential passes, the flip and the rotation always combine correctly and consistently regardless of which one a user toggles first or last — there's no ordering dependency from the user's perspective, only in the fixed order the code applies them internally. Worked example, verified by hand: a 400×200 image rotated by exactly 90° gives `cos(90°) ≈ 0`, `sin(90°) = 1`, so `newWidth ≈ |400×0| + |200×1| = 200` and `newHeight ≈ |400×1| + |200×0| = 400` — the canvas becomes 201×400 in practice (the dimensions swap, as expected for a quarter turn, plus a single extra pixel of harmless padding from `Math.ceil` rounding up a floating-point value like 200.00000000000003, which is never exactly zero in binary floating-point at 90°). The same image rotated by 45° gives `cos(45°) = sin(45°) ≈ 0.7071`, so both `newWidth` and `newHeight` come out to `|400×0.7071| + |200×0.7071| ≈ 424.3`, rounded up to 425 — the bounding box becomes a near-square shape roughly 425×425, visibly larger than either original dimension, which is exactly the extra space needed so the tilted rectangle's corners don't get clipped. At 0° and 180°, the trigonometry reduces back to essentially the original width and height, landing one pixel over (400×201 rather than an exact 400×200) for the same floating-point reason — always rounding up rather than to the nearest integer means this tool would rather waste a single imperceptible pixel of transparent padding than risk clipping a real edge. The quick 90°/180°/270° buttons don't set an absolute angle — each press adds that many degrees to whatever the current angle already is, wrapped back into the 0-360 range with a modulo operation, so pressing "Rotate 90°" three times in a row lands on 270°, and a fourth press wraps back to 0°. The free-angle slider and the number field both read from and write to that same underlying angle value, so adjusting one always keeps the other in sync. The output is intentionally fixed to PNG regardless of the source image's original format, since PNG is the only one of this toolbox's supported formats that can represent the transparent corner triangles a non-90-degree rotation produces without silently filling them with an opaque colour.

Frequently Asked Questions

Why does the canvas size change when I rotate to a non-90-degree angle?
A rotated rectangle no longer fits inside a rectangle of the same size — its corners swing outward. The canvas recalculates a new bounding box using standard trigonometry (|w·cos θ| + |h·sin θ| for width, and the equivalent for height) so the whole rotated image fits without any corners being clipped off.
Why is there transparency at the corners after rotating?
Rotating a rectangle to a non-right angle leaves gaps at the corners of the new, larger bounding box that the original image doesn't cover — this is a geometric consequence of the rotation itself. The output format is fixed to PNG specifically because it can represent that transparency correctly.
Can I flip and rotate at the same time?
Yes — the two flip toggles and the rotation angle are all independent and combine correctly in a single render, since canvas transforms compose as one matrix rather than being applied as separate passes. Toggle any combination of flip horizontal, flip vertical, and any angle.
What's the difference between the quick rotate buttons and the slider?
The 90°/180°/270° buttons add that many degrees to the current angle (wrapping at 360°), useful for quick quarter/half turns. The slider and number field let you set any exact angle directly, useful for straightening a slightly tilted photo by a precise amount like 3° or 37°.
Why is the download always a PNG?
Non-90-degree rotations create transparent corner areas that only PNG (of this tool's formats) can represent properly — JPEG has no transparency and would fill those areas with an opaque background colour instead, silently changing the image.
Does rotating an image lose any quality?
A small amount of softening is unavoidable for any angle that isn't a multiple of 90°, since the canvas has to interpolate pixel values along the new, rotated edges. Rotations of exactly 90°, 180° or 270° involve no interpolation and are pixel-perfect.
What does "flip horizontal" actually do, precisely?
It mirrors the image left-to-right, as if reflected in a vertical mirror, using a canvas scale(-1, 1) transform around the image's center. "Flip vertical" mirrors top-to-bottom using scale(1, -1) the same way.
Is flipping both horizontal and vertical the same as rotating 180°?
Visually, yes — combining both flips produces the same result as a 180-degree rotation. Internally the tool still applies them as separate operations, so if you also add an additional rotation angle on top, everything continues to compose correctly.
Why did I get "Please choose an image file"?
This tool only accepts files the browser reports with an image/* MIME type. Other file types (documents, videos, etc.) are rejected immediately rather than being processed and failing unpredictably.
Is my image uploaded to a server for this?
No. Every flip and rotation is computed with the 2D canvas API running as JavaScript in your browser. The file never leaves your device, and nothing touches disk until you explicitly click download.
What happens if I set the angle to exactly 0 or 360?
Both are treated identically to no rotation at all — the bounding-box formula reduces exactly back to the original width and height, so the canvas simply matches the source image's dimensions (still reflecting any flips you've toggled).

Part of These Collections

Also Available As

flip image online, rotate image online, rotate photo any angle, mirror image, flip picture horizontally vertically

Found a Problem?

Let us know if something with Image Flip & Rotate isn't working as expected.

Thanks — we'll take a look.