Skip to content

How to Rotate, Straighten and Flip Images (and Fix Sideways Photos)

Turning a picture sounds trivial until a photo that looks fine on your phone arrives sideways in an email, or a tilted horizon leaves you with odd empty corners. This guide explains why photos end up sideways, how quarter turns differ from small tilts, when mirroring an image matters, and how to save the result without surprises.

Why photos show up sideways: the EXIF orientation tag

A camera sensor always records the scene in the same orientation, whichever way you hold the phone. Instead of physically turning every portrait shot, the camera saves the pixels as they came off the sensor and adds a small note to the file’s EXIF metadata: the Orientation tag. It tells viewing software how to turn the image for display.

The tag holds a number from 1 to 8. The ones you meet in practice are:

  • 1: display as stored (no turn needed).
  • 6: rotate 90° clockwise to display. Typical for a phone held upright.
  • 8: rotate 90° counterclockwise.
  • 3: rotate 180°, for a camera held upside down.

Values 2, 4, 5 and 7 add a mirror flip and are rare in camera files. The problem appears when software ignores the tag. Your phone’s gallery honors it, so the photo looks right; an older program, some upload forms, or a tool that strips metadata without turning the pixels shows the raw, sideways data instead. The file is not broken. The instruction for displaying it is just being skipped.

The durable fix is to turn the pixels themselves and save a file that needs no tag at all. It then displays correctly everywhere, whether or not a viewer reads EXIF.

How Photoyam handles it

Photoyam decodes images with your browser’s built-in decoder, and current versions of the major browsers apply the orientation tag when they decode. So a phone photo normally opens upright, the way your gallery shows it. When you download from the Rotate or Flip page, or export from the Pro editor, Photoyam writes a brand-new file from the pixels: the image is saved physically upright, and no EXIF data is carried over. That also means other metadata, such as the camera model and any GPS location, is not included in the exported copy.

If a photo still opens sideways in Photoyam, the pixels themselves are sideways (the tag was lost somewhere along the way). A single 90° turn, as described below, fixes it for good.

Quarter turns vs any-angle rotation

Rotations by 90°, 180° and 270° are special. Every pixel lands exactly on another pixel position, so nothing is blended or estimated. The width and height simply swap for a quarter turn: a 4000×3000 photo becomes 3000×4000. No detail is lost.

Any other angle is different in two ways:

  • Resampling. Rotated pixels fall between grid positions, so each new pixel is calculated from its neighbors. A single small rotation softens the image very slightly; it is invisible at normal viewing sizes, but rotating the same image over and over compounds it. Decide on the angle, then rotate once.
  • Geometry. A tilted rectangle no longer fits the old frame. Either the canvas grows to hold it, or the corners are clipped. In both cases, empty triangles appear in the corners.

In Photoyam, the Pro editor’s Image › Image Rotation › Arbitrary… grows the canvas: a 1600×1040 photo rotated by 9° becomes about 1743×1278, with transparent corners. The Rotate page’s Any angle or straighten option does the same when you pick Keep the whole photo (with transparent or white corners); its default, Automatic, instead crops a tilt of up to 10° to the largest rectangle with the photo’s own shape, and Crop to fill does that for any angle. The Crop tool’s Straighten button (and the Ruler tool’s) instead keeps the canvas size, so the photo’s own corners are clipped and transparent gaps appear at the edges.

You then have three ways to deal with those corners:

  • Crop them away. The usual choice for photos. Use the Crop tool and keep the box inside the picture.
  • Fill them. Draw around one empty corner with the Lasso tool, taking in a sliver of the photo along the edge, then choose Edit › Content-Aware Fill… and click OK in its window to synthesize matching texture. Repeat for each corner; on a sky, setting Color Adaptation to High in that window helps the fill follow the gradient. This works well on sky, grass or sand, less well on detailed edges.
  • Leave them transparent. Fine for a PNG or WebP that will sit on a web page. A JPG cannot store transparency, so Photoyam fills those areas with white when you save as JPG.

Flipping: horizontal vs vertical

A flip mirrors the image. Flip horizontal swaps left and right, like looking in a mirror. Flip vertical swaps top and bottom, like a reflection in still water. Neither is a rotation: after a flip, the picture cannot be turned back to the original, only flipped back.

When mirroring matters:

  • Text and logos. Anything with writing comes out reversed. Signs, T-shirts, number plates and brand marks are a giveaway that a photo was flipped.
  • Selfies. A front camera preview shows you a mirror image, which is the face you are used to seeing. Many phones save the unmirrored version, which is how others see you, and some offer a setting to save it mirrored. If a selfie “looks off,” a horizontal flip usually brings back the familiar version; if there is text in the shot, leave it unflipped.
  • Layout. Designers flip a photo so a person faces into a page rather than off its edge. Check for text, watches, and parted hair, which can make the flip obvious.

A useful fact: flipping horizontally and then vertically gives exactly the same result as rotating 180°.

Saving a rotated JPG: lossless vs re-encoding

JPG stores an image as compressed blocks of 8×8 pixels. A few specialized tools can rotate a JPG by rearranging those compressed blocks without decoding them, which is truly lossless (with a catch at the edges when the dimensions are not a multiple of the block size). Another approach is to change only the Orientation tag, leaving the pixels alone, which brings back the sideways problem in software that ignores the tag.

Photoyam, like most image editors, works on decoded pixels and compresses them again when you save a JPG. The rotation itself is exact for quarter turns, but the new JPG is a fresh round of compression. At a high quality setting the difference from one save is not visible. Repeating the save-open-edit cycle many times is what causes visible damage.

Step by step in Photoyam

Rotate a photo on the Rotate page

The Rotate page turns photos right in the page, one at a time or up to 50 at once. Nothing is uploaded.

  1. Add your photos. Choose or drop one or more images. Each one is rotated straight away with the current setting, and an Original and Result preview appears side by side.
  2. Choose the turn. Under Rotate, pick 90° clockwise (right) (the default), 90° counter-clockwise (left) or 180° (upside down). For a sideways phone photo, one of the 90° options is all you need.
  3. Or straighten. Pick Any angle or straighten, then drag the Straighten slider under the preview until the horizon follows the grid drawn over it, or use the ±0.1° and ±1° buttons. You can also type a value in Degrees (clockwise); it accepts decimals such as 1.5, and negative numbers turn counterclockwise. Under Corners, Automatic crops a small tilt so no empty wedge is left; choose Keep the whole photo to keep every pixel with transparent or white corners. Mirror left–right and Flip top–bottom can be ticked in the same pass.
  4. Pick the format. Under Save as, keep Same as original or choose JPG, PNG or WebP, and set Quality (92 by default) for JPG and WebP. With a few images the result updates by itself when you change a setting; for a bigger batch, click the Apply to … images button to run it again.
  5. Download. Click Download; the button shows the format and the new file size. The file gets -rotated added to its name. With several images, Download all (ZIP) saves them in one go.
A mountain road with a blue Furkapass sign, and the same photo turned 90 degrees clockwise so it stands upright: 1500 × 1000 pixels became 1000 × 1500.
A quarter turn on the Rotate page. Width and height swap (1500 × 1000 becomes 1000 × 1500) and no pixel is blended, which is why 90° turns are lossless apart from the final save.

Rotate or straighten in the Pro editor

For a crooked horizon, the editor is the better place, because you can draw along the horizon instead of guessing a number. Click Edit further in the Pro editor on the Rotate page, or open the photo in the editor.

  • Quarter turns. Image › Image Rotation has 90° Clockwise, 90° Counterclockwise and 180°.
  • Any angle. Image › Image Rotation › Arbitrary… opens the Rotate Canvas dialog. Drag the slider (−180° to 180°) or type in the Angle field, which accepts decimals, then choose Clockwise or Counterclockwise. The photo behind the dialog tilts live; click OK to apply or Cancel to leave it untouched.
  • Straighten by drawing. Press C for the Crop tool, click Straighten in the options bar and drag along the horizon. The Ruler tool (in the Eyedropper group, I) does the same after showing you the angle.
  • Save. Use File › Export As and pick PNG, JPG or WebP. It opens the Save for Web window, where you set Quality and see the estimated size before you click Export.

Do not confuse these with the Rotate View tool (R, next to Zoom). It turns only your view of the canvas, like turning a sheet of paper on a desk so a curve is easier to draw, and leaves the photo itself unrotated: nothing is added to History and the exported file comes out exactly as before. Press Esc or click Reset View to set the view straight again.

Photoyam’s Rotate Canvas dialog in the Pro editor with the angle slider, Angle 3 and Counterclockwise selected, over a sea photo previewed at that turn: the horizon is level and the canvas has grown to hold the tilted corners.
The Pro editor’s Rotate Canvas dialog (Image › Image Rotation › Arbitrary…). The slider and the Angle field stay in sync, and the photo behind the dialog shows the angle live before you click OK.

Flip

  1. Add the image. Go to the Flip page and choose or drop one or more images. They are flipped in the page as soon as they load.
  2. Choose the direction. Under Flip, pick Horizontal (mirror left and right) (the default), Vertical (top to bottom) or Both. Drag the divider on the preview to compare the original with the result.
  3. Download. Set the format under Save as if you want something other than the original format, then click Download. The file gets -flipped added to its name.
A blue road sign reading Furkapass 2431 m with a bend warning and a 50 limit, and the same photo flipped horizontally so the lettering reads backwards.
A horizontal flip on the Flip page: the road sign now reads backwards, a quick way to see that a picture has been mirrored. On the page, drag the slider to compare before you download.

In the editor, Image › Image Rotation › Flip Canvas Horizontal and Flip Canvas Vertical mirror the whole image. To mirror only one element in a layered design, select its layer and use Layer › Flip Horizontal or Layer › Flip Vertical instead.

Lines that bow: Adaptive Wide Angle

Rotation corrects a horizon that tilts, not one that curves. Ultra-wide phone cameras, action cameras and fisheye lenses bend straight lines near the edges of the frame, so a doorway leans outward and the sea looks like the rim of a bowl. No angle fixes that. Filter › Adaptive Wide Angle… (Alt+Shift+Ctrl+A) does: it opens a full-window editor with the Constraint Tool on the left, the photo in the middle and the lens settings on the right.

  1. Describe the lens. Set Correction to Auto, Fisheye, Perspective or Full Spherical (for a 360° panorama). If you know it, enter the Focal Length and Crop Factor so the model starts close.
  2. Draw a constraint. With the Constraint Tool, drag along an edge that should be straight, from one end to the other, then drag the line’s middle handle onto the curve. Photoyam solves the lens model until that edge is straight.
  3. Mark level and plumb lines. Hold Shift while drawing, or select a constraint and set its Orientation to Horizontal or Vertical, to make the edge level or upright as well as straight. Delete Constraint removes a bad one.
  4. Fine-tune and apply. Adjust Scale, Distortion, Edge Distortion, Angle and Vertical Perspective if needed, then click OK. Areas that had no pixels before the correction come out transparent, so crop afterward or raise Scale until they disappear.

Two or three well-placed constraints usually beat ten. On a smart object the filter is kept as a smart filter, so its settings stay adjustable later.

Common mistakes

  • Flipping when you meant to rotate. A sideways photo needs a 90° turn. Flipping it produces a mirrored, still-sideways image.
  • Rotating in small steps. Five 1° nudges resample the image five times. Undo and apply one 5° rotation instead.
  • Forgetting the corners. After an arbitrary rotation, check the corners before exporting. As a JPG they turn white.
  • Straightening along a vertical line. The Straighten drag makes the line you draw horizontal. Draw it along a horizon, not a doorframe.
  • Mirroring photos with text. Reversed lettering is the first thing people notice.

Try it in Photoyam

Rotate photos by 90° or any angle right in the page, a whole batch at once if you like, or mirror them with the Flip tool. Free, no sign-up, and everything runs in your browser.

FAQ

My photo looks upright on my phone but sideways elsewhere. Why?

The pixels are stored sideways and a tag in the file tells viewers to turn them. Your phone reads the tag; the other app ignores it. Re-saving the photo with the pixels physically turned, and no tag, makes it display the same way everywhere.

Is rotating a JPG lossless?

A 90 or 180 degree turn does not change any pixel values, but saving the result as JPG compresses it again, which adds a small amount of loss. Export at a high quality setting, or save as PNG if you plan to keep editing. Photoyam does not offer the special block-level lossless JPEG rotation some command-line tools provide.

What is the difference between rotating 180 degrees and flipping?

A 180 degree rotation turns the picture upside down, so text is upside down but not mirrored: turn the screen around and it reads normally. A vertical flip mirrors the picture top to bottom, so text stays mirrored however you turn it. Flipping both horizontally and vertically gives exactly the same result as a 180 degree rotation.

Why is my rotated image bigger than the original?

When you rotate by an angle that is not a multiple of 90 degrees and keep the whole photo, the canvas grows so the tilted photo fits without its corners being cut off. The extra area is transparent, or white if you chose white corners on the Rotate page or saved as JPG. Crop it away, or fill it, before exporting. On the Rotate page, Corners set to Automatic crops a tilt of up to 10 degrees for you, so a straightened photo comes out slightly smaller instead.