↔️ Image Resizer
Resize images to exact pixel dimensions or percentages. Supports JPEG, PNG, WebP, and GIF. Free online image resizer — runs in browser, no uploads to any server.
How to Use
Upload your image
Drag and drop any image or click to browse. Original width and height are filled in automatically.
Set new dimensions
Enter target width or height in pixels. Toggle the lock icon to keep the original aspect ratio.
Download resized image
Choose output format (PNG/JPEG/WebP) and quality level, then click Resize and Download.
Frequently Asked Questions
Complete Guide: Image Resizer
Resizing images to the correct dimensions before uploading them is one of the simplest ways to improve web performance. Serving a 4000×3000 pixel photograph from a high-end camera when the display slot is only 800×600 pixels wastes bandwidth and forces the browser to do the downscaling work at render time. A dedicated image resizer lets you control exact output dimensions, lock aspect ratios, and optimize for specific platforms — all before the file ever leaves your browser.
Aspect Ratio Locking
Aspect ratio is the proportional relationship between an image's width and height. A 1200×800 image has a 3:2 aspect ratio. When you resize such an image to 600 pixels wide with aspect ratio locked, the height automatically becomes 400 pixels — maintaining the proportions and avoiding distortion. Always lock the aspect ratio unless you have a specific reason to stretch the image (for example, fitting a design template that requires an exact size regardless of content).
Upscaling and Quality Loss
Enlarging an image beyond its original dimensions always introduces quality loss, because the algorithm must invent pixel data that was never captured. Different interpolation algorithms handle this with varying quality:
- Nearest-neighbor: Fastest, produces blocky "pixel art" effect. Only appropriate for pixel art intentionally.
- Bilinear: Smoother than nearest-neighbor, fast, but can produce blurring at large upscales.
- Bicubic: Higher quality than bilinear, examines a larger neighborhood of pixels. Standard in Photoshop.
- Lanczos: Considered the best quality for photographic downscaling; avoids aliasing and preserves sharpness.
The Canvas API uses bilinear interpolation by default. For higher-quality downscaling, a multi-step approach (halving the image repeatedly) produces better results than a single large reduction.
The Canvas 2D drawImage API
In-browser resizing uses CanvasRenderingContext2D.drawImage() with the nine-argument form for full control:
ctx.drawImage(
sourceImage,
sourceX, sourceY, // source crop origin
sourceWidth, sourceHeight, // source crop size
destX, destY, // destination position on canvas
destWidth, destHeight // destination size (resize target)
);
For a simple full-image resize, use: ctx.drawImage(img, 0, 0, newWidth, newHeight)
Percentage vs Pixel Dimensions
Percentage-based resizing scales relative to the original dimensions. Resizing to 50% of a 2400×1600 image produces 1200×800 regardless of what the original pixel count was. This is useful for batch workflows where input sizes vary. Pixel-based resizing is better when you need to hit an exact target — for example, an Instagram post requiring exactly 1080×1080 pixels.
Social Media Dimensions Reference
Use these as targets when resizing images for social platforms:
- Open Graph (Facebook/LinkedIn preview): 1200×630 px
- Twitter/X card: 1200×628 px (summary large image)
- Instagram square post: 1080×1080 px
- Instagram portrait: 1080×1350 px
- Instagram landscape: 1080×566 px
- YouTube thumbnail: 1280×720 px
- LinkedIn cover: 1584×396 px
Thumbnail Generation Workflow
A typical thumbnail workflow for a blog or e-commerce site involves three sizes: a large size for full-page views (1200px wide), a medium size for listing pages (600px wide), and a thumbnail for grid previews (300px wide). Generating all three in the browser before upload eliminates server-side processing overhead and gives immediate visual confirmation of quality.
After resizing, compress the output to reduce file size further using the Image Compressor. To encode the resized image as a Base64 string for CSS or JSON embedding, use Image to Base64.