Straighten Image

Published Updated

Level a tilted photo with an angle from -45 to +45 degrees in steps of 0.1. The canvas grows to hold the turned picture, so a 4000 x 3000 photo at 3 degrees becomes 4152 x 3205, and the wedge-shaped corners are left blank for you to crop.

How far the canvas and the usable area change

For a 4000 x 3000 photo, the canvas follows w cos a + h sin a by w sin a + h cos a. The last two columns give the biggest centred rectangle with the same 4:3 shape that sits fully inside the picture, which is what a crop to the original proportions can keep.

AngleCanvasCrop that stays fullShare of original area
0.5 degrees4026 x 30353954 x 296697.7%
1 degree4052 x 30693910 x 293295.5%
3 degrees4152 x 32053744 x 280887.6%
5 degrees4246 x 33373596 x 269780.8%
10 degrees4460 x 36493289 x 246667.6%

Small corrections cost little: 1 degree gives up under 5% of the area. The canvas and crop sizes are computed from the page's own formula, not measured on a saved file.

Using it well

Pick a reference line that should be exactly horizontal or vertical: a horizon, a shelf, a page edge. Nudge by 0.1 until it matches the edge of the preview, then check both ends of the line. Because the rotation is about the centre, a correct angle needs no shifting afterwards.

Photos are not enlarged, only turned, so no pixels are invented. The rotation direction follows MDN's canvas rotate page, where the angle is clockwise.

Fixing a tilt

  1. Step 1

    Add the photo

    PNG, JPEG and WebP keep their format on the way out. A photo in another format that your browser can read is saved as PNG.

  2. Step 2

    Set the angle

    Drag the slider or type a number. A positive angle turns the picture clockwise, and typed values past 45 in either direction are clamped to 45.

  3. Step 3

    Prepare the download

    The live preview is the same canvas that gets saved. Watch the Canvas size line, then prepare and download the file, named after yours plus -straightened.

Next steps

  • Remove the blank wedges with Crop Image.
  • For quarter turns, Rotate Image does 90 and 180 degrees, which this page does not.
  • To mirror the picture instead, use Flip Image.

Straightening questions

Which way does a positive angle turn the picture?

Clockwise, since the page uses the canvas rotation, which MDN defines as clockwise. If the horizon slopes down to the right, enter a positive angle to bring it up level.

What fills the empty corners?

Transparency for PNG and WebP, and white for JPEG, because JPEG has no transparency. The corners are not cropped away, so the saved file is larger than the original.

Does it crop the result for me?

No. Crop afterwards with Crop Image. To keep the original proportions, the largest centred rectangle at 3 degrees is 3744 x 2808 from a 4000 x 3000 photo, which is 87.6% of the original area.

Does straightening reduce quality?

Turning by a small angle resamples every pixel, which softens fine detail slightly. JPEG and WebP results are then saved at quality 92, so a second lossy pass is added. PNG output is lossless.

Can it find the tilt by itself?

No. There is no automatic detection. You judge the angle against the preview, so use a long straight edge such as a horizon or a table edge.

Is the photo uploaded?

This page does not upload it. The rotation is drawn on a canvas inside the page, and the saved file is made from that canvas in your browser.

What happens when the turned photo is too large to save?

Turning a photo makes the canvas larger than the photo, and the saved file has limits: WebP allows at most 16,383 pixels a side, and this page saves JPEGs up to 65,500. When the turned canvas passes the limit, the page names the limit and the size, saves nothing and suggests a smaller angle or a smaller picture. A 16,383 x 1,000 WebP turned by 1 degree needs 16,398 x 1,286 pixels, and a 65,500 x 300 JPEG turned by 0.3 degrees needs 65,501 x 643; both got that message in Google Chrome 156, Chromium 153 (Playwright build, not Google Chrome), Firefox 155 and Playwright's WebKit build (not the Safari app), and both were saved at full size at 0 degrees (the WebKit build, which has no WebP encoder, saved that WebP as a PNG and said so). PNG output has no such check.

Related Tools