Rotate images by any angle from 0 to 360 degrees

Rotate an image by an arbitrary angle while preserving its visible bounds.

freeworks offlinenothing uploaded
ToolImage Rotator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

The canvas coordinate system is translated to the output center, rotated by the requested angle, and the source bitmap is drawn around the transformed origin. The output canvas is expanded for quarter-turns or bounding-box fit so pixels are not clipped.

  • Center-based transforms keep the image visually centered.

Worked example

Rotate Image 90 Degrees
Rotate an image 90 degrees clockwise
Input
											data:image/png;base64,iVBORw0KGgo=
										
Output
												PNG with width and height exchanged after a clockwise quarter-turn
											

When to use this

Scanned-page correction, photo editing, and sprite pipelines rotate images.

Edge cases

  • A non-square image needs swapped dimensions for 90-degree turns.
  • Angles not divisible by 90 degrees create empty corner areas in the bounding box.
  • Repeated raster rotations introduce interpolation blur.

References