induwara.lk
induwara.lkImage · Privacy-first

Image Resizer — pixels, percent, and social presets

Resize a JPG, PNG, or WebP image in your browser by exact pixel dimensions, percentage, longest-side cap, or a one-click social-media preset. Aspect ratio stays correct, files never leave your device, sources cited.

By Induwara AshinsanaUpdated May 11, 2026
Image ResizerPixels · % · social presets · in-browser
Files stay on your device

Everything runs in your browser. Nothing is uploaded.

What this does

Loads your image into a canvas and rescales it in your browser at the size you pick. Choose pixels, percentage, a longest-side cap, or a social-media preset. Aspect ratio stays correct unless you ask for the stretch mode.

Instagram
Facebook
X
LinkedIn
YouTube
Generic
Aspect handling
Output format
Letterbox colour
Source size
Add an image
Output size
Scale
Output bytes
Press Resize to compute
Add an image to start

Drop or pick a JPG, PNG, or WebP file above.

Preset dimensions sourced from the help-centre articles of Instagram, Meta, X, LinkedIn, and YouTube. Cross-checked 2026-05-11. See the "Sources & references" section below.

How it works

Resizing a photo on the web has been a built-in browser capability since the original HTML5 canvas spec shipped. The tool above wires up the four-step pipeline that every modern browser supports: decode the image into an HTMLImageElement, draw it onto an off-screen canvas at the target dimensions via drawImage(img, x, y, w, h), let the browser's built-in resampler interpolate the new pixels, then encode the canvas back to a file with canvas.toBlob. No part of the file leaves the tab.

The mathematically interesting bit is the planning step: given a source size and a target size, how exactly should the source land on the destination canvas? For uniform scaling (percent and longest side) it is one multiplication: every axis scales by the same factor and the canvas size matches the result. For fixed-size targets (presets and pixel inputs) there are three valid strategies:

  1. Fit (letterbox) — pick the smaller of (target_width / source_width) and (target_height / source_height) as the uniform scale. The whole image fits inside the target with symmetric padding on the short axis. Nothing is cropped.
  2. Fill (crop) — pick the larger of the two ratios. The image now covers the target on both axes; whatever runs past the canvas on the long axis is cropped. Useful for fixed-frame uses like Facebook covers.
  3. Stretch — set drawWidth = target_width and drawHeight = target_height with no aspect preservation. Distorts the image when ratios disagree; only useful when matching a layout is more important than preserving the picture.

The page surfaces a second, independent formula for the fit case that solves the same problem from the aspect-ratio side:

src_aspect = source_width / source_height
dst_aspect = target_width / target_height
if src_aspect >= dst_aspect:
    draw_width  = target_width
    draw_height = round(target_width / src_aspect)
else:
    draw_height = target_height
    draw_width  = round(target_height * src_aspect)

Both formulas produce the same integer width and height to within 1 px of rounding slack on every input the tool accepts. The Draw plan panel inside the calculator above shows both numbers side by side so you can verify the agreement on your own image.

Resampling quality is delegated to the browser. The canvas context flag imageSmoothingQuality = "high" selects a bicubic-class filter in current Chromium, WebKit, and Gecko releases. For typical photographic content this is indistinguishable from offline tools that use Lanczos at the resolutions we resize to. For pixel art that needs nearest-neighbour downsampling, do not use this tool — use an editor that exposes the filter directly.

Worked examples

Phone photo → Instagram square (letterbox)

A 4032 × 3024 phone photo doesn't fit a 1080 × 1080 feed post without distortion. The fit mode scales the source down so the long side reaches the destination edge, leaving symmetric letterbox margins on the short side.

  1. Source: 4,032 × 3,024 · 4:3
  2. Target: 1,080 × 1,080 · 1:1 · mode fit
  3. Draw at: 1,080 × 810, offset (0, 135)
  4. Cross-check (aspect-ratio): 1,080 × 810 — agrees with the primary planner.
  5. Canvas size: 1,080 × 1,080

Full HD wallpaper → 50 % rescale

A 1920 × 1080 desktop screenshot dropped to half size for a chat upload. Both axes scale together, the aspect ratio is preserved exactly, and the encoded file is roughly one-quarter the source byte count.

  1. Source: 1,920 × 1,080 · 16:9
  2. Target: 960 × 540 · 16:9 · mode stretch
  3. Draw at: 960 × 540, offset (0, 0)
  4. Canvas size: 960 × 540

Studio photo → 1200 px wide (aspect locked)

A 3000 × 2000 studio shot resized to 1200 px wide for a blog hero. The height is computed from the source aspect ratio so the image is never distorted.

  1. Source: 3,000 × 2,000 · 3:2
  2. Target: 1,200 × 800 · 3:2 · mode stretch
  3. Draw at: 1,200 × 800, offset (0, 0)
  4. Canvas size: 1,200 × 800

Social-media preset dimensions

Every preset chip on the tool is sourced from the platform's current help-centre article. Where a platform serves a different size on mobile vs desktop, the chip uses the desktop dimension and the platform crops on mobile in the documented direction. Verified on 2026-05-11.

PlatformPresetSize (px)Aspect
InstagramInstagram square post1,080 × 1,0801:1
InstagramInstagram portrait post1,080 × 1,3504:5
InstagramInstagram story / Reel1,080 × 1,9209:16
FacebookFacebook page cover820 × 312205:78
FacebookFacebook shared image1,200 × 63040:21
XX / Twitter header1,500 × 5003:1
XX / Twitter post image1,200 × 67516:9
LinkedInLinkedIn profile banner1,584 × 3964:1
LinkedInLinkedIn company banner1,128 × 1915.91:1
YouTubeYouTube thumbnail1,280 × 72016:9
YouTubeYouTube channel art2,560 × 1,44016:9
GenericFull HD (1920 × 1080)1,920 × 1,08016:9
GenericHD (1280 × 720)1,280 × 72016:9

Frequently asked questions

Sources & references

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a bug, edge case, or want to suggest an improvement?

Email me at [email protected] — most fixes ship within 24 hours.