# Rotate and Flip Image

> Turn a JPG, PNG or WebP picture 90° left or right or 180°, or mirror it horizontally or vertically. A quarter turn swaps width and height.

Use it online (free, runs in your browser): https://directory.milunir.com/image-tools/image-editors/rotate-and-flip-image/

To rotate a picture, choose the file and pick Rotate right 90°, Rotate left 90° or Rotate 180°. A quarter turn swaps the sides, so a 4000 × 3000 landscape shot becomes a 3000 × 4000 portrait. Mirror flips left and right, Flip vertical turns top to bottom, and both keep the original size.

Scanned receipts arrive sideways, a webcam selfie shows text backwards, and a document photographed from above can land upside down. This editor fixes those with five changes: a clockwise or counterclockwise quarter turn, a half turn, a left-to-right mirror and a top-to-bottom flip. Pixels move without being resampled, so turning by a multiple of 90° loses no detail, although saving as JPG or WebP re-compresses the file at the quality you pick. Phone pictures with an orientation tag are first shown upright, then changed, so the result looks the same in every viewer. The copy you download has no camera details or GPS position. It cannot straighten a slightly tilted horizon: only quarter steps are offered.

## How to use

1. **Choose the picture**: Press Choose image or drop a JPG, PNG or WebP file of up to 25 MB on the box.
2. **Pick the change**: Select a quarter turn left or right, a half turn, a mirror or a vertical flip and check the preview.
3. **Download the copy**: Under More options you can change the format or JPG and WebP quality, then press the download button.

## Examples

### Turn a wide logo upright

- Change: Rotate right 90°
- Save as: Same as the original
- Quality: 92
- Image: fixture:logo-200x100-alpha.png

Result: New size: 100 × 200 px File size: 1.4 KB

A quarter turn swaps the sides, so the 200 × 100 logo becomes 100 × 200 and keeps its transparent background.

### Turn a portrait phone photo to landscape

- Change: Rotate left 90°
- Save as: Same as the original
- Quality: 92
- Image: fixture:photo-640x480-orient6.jpg

Result: New size: 640 × 480 px File size: 11 KB

The file is stored sideways with an orientation tag, so it is first shown upright at 480 × 640. Turning it left makes a 640 × 480 landscape copy with no camera tags.

### Mirror a selfie as a WebP

- Change: Mirror (flip horizontal)
- Save as: WebP
- Quality: 80
- Image: fixture:photo-400x300-gps.jpg

Result: New size: 400 × 300 px File size: 2.4 KB

Mirroring swaps left and right but keeps the 400 × 300 size. The copy is saved as WebP without the location data.

## How it works

`rotated size = height × width for 90° or 270°; mirrored or 180° size = width × height`

- `width, height`: pixel size of the upright original

The picture is drawn onto a canvas whose sides are swapped for a quarter turn. The canvas is moved to its centre and turned by 90°, 180° or 270° before the pixels are copied. A mirror scales the x axis by minus one and a vertical flip scales the y axis by minus one, so every pixel lands on its exact partner and none is blended. The browser then encodes the canvas in the chosen format.

Sources:

- [HTML Standard: the canvas element, toBlob()](https://html.spec.whatwg.org/multipage/canvas.html#dom-canvas-toblob), WHATWG

## When not to use it

- To level a tilted horizon by a few degrees; only quarter and half turns are offered.
- For RAW or HEIC originals; open those in a converter first, since only JPG, PNG and WebP are read.

## Common mistakes

- Choosing Mirror when the picture is upside down; a half turn fixes that, a mirror makes text read backwards.
- Re-saving the same JPG many times at low quality, which adds blur each round; keep PNG for repeated edits.

## Questions

### Does rotating a JPG lose quality?

The turn itself moves whole pixels, so nothing is blurred. Saving a JPG or WebP compresses it again; at 90% or higher the difference is very hard to see. Choose PNG under More options for a copy with no extra loss.

### Is my picture uploaded anywhere?

No. Your own browser opens, turns and saves the file. Nothing is sent to a server, and the downloaded copy leaves out camera details and GPS location.
