Skip to content
UniKit

Image size changer

Force an image to an exact width and height (stretching is allowed) or lock the aspect ratio and scale from one side only; preview the new dimensions and stretch factors before exporting PNG or JPEG.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Images are processed locally in your browser with Canvas and never uploaded.

Filling both forces that exact size (may distort); filling only one derives the other from the original aspect ratio.

Pick an image first (PNG / JPEG / WebP / GIF all work).

Result details

Result details

Pick an image and enter the target size — the new dimensions and file size show up here.

What this tool does

  • Force an image to an exact width and height — for uploads that demand e.g. 800×600 regardless of the original ratio. Stretching is allowed.
  • Fill only one side and the other is derived from the original aspect ratio, which is what you want for "just keep the width under 1200" jobs without distorting anything.
  • Tick "lock original aspect ratio" and change only the width for a plain proportional scale; for smooth downscaling of photos the dedicated image resize tool is better.
  • Verify the result quickly: the exported file name carries the real dimensions (photo-800x600.png).

Example

Input

A 4×3 image with target width 8 and height 3 (aspect ratio not locked)

Output

8×3, stretch 2.00× horizontally and 1.00× vertically, distorted = true

The pure resizeImage logic resamples with nearest neighbour and always returns 24 pixels here — never identical to the input. With only width 8 and the lock enabled you get 8×6 and distorted = false.

Frequently asked questions

How is this different from the image resize tool?

This tool aims at an exact width and height, so the aspect ratio may change (the image is stretched). The resize tool scales proportionally and offers area averaging, which is far better for photos. Use that one when quality matters.

What happens if I fill both sides and enable the lock?

With the lock on, the width wins and the height is recomputed from the original ratio; the height you typed is ignored so contradictory input cannot produce a stretched result. The effective size is always shown in the result panel.

Which resampling algorithm is used?

Nearest neighbour: each target pixel copies the closest source pixel. Edges stay crisp when upscaling, which suits pixel art and screenshots, but photos will alias when shrunk — use area averaging in the resize tool for those.

Are there size limits?

Each side must be 1–16000 pixels and the output must stay under 16 million pixels. Out-of-range values report an error instead of failing silently.

Are my images uploaded?

No. Pixels are read through the canvas and processed entirely in the browser; there is no upload endpoint on the page.

Keywords:img sizeresize image

Related tools