Social image resizer: crop and pad to 9 platform specs

Contents
Instagram, YouTube, Facebook, Twitter (X), and KakaoTalk each require images with different aspect ratios and pixel specs. Cropping one photo by hand for every channel and filling in the blank space takes time, and getting the specs wrong can cut off important parts or make the image look blurry. This post explains how cropping and padding to fit a spec actually works, and how to get it done fast.
Summary ① Compare the source image's aspect ratio with the target spec's aspect ratio to decide whether to crop or add padding. ② You can do the math yourself with the JavaScript canvas, but the more specs you support, the more code you have to maintain. ③ With our Social Image Resizer, a few clicks crop or pad your image to 9 specs automatically.
Why You Need Spec-Compliant Resizing
Social Image Resizer is a tool that crops or pads your source image to fit the aspect ratio each platform requires — Instagram, YouTube, Facebook, Twitter (X), KakaoTalk, and more.
If you upload a photo without matching the spec, the platform crops it to fit the display ratio on its own, and important parts like faces or logos can end up outside the frame. Force it to fit by stretching, and the image gets blurry or distorted. Each platform asks for something different — square (1:1), portrait (4:5, 9:16), landscape (16:9) — so posting one source image to several channels at once means cropping it correctly for each one.
How to Crop and Resize to Spec
Compare Aspect Ratios to Calculate the Crop Area
If you know the source image's width (W_orig) and height (H_orig) and the target spec's width (W_target) and height (H_target), you can work out the crop area (starting point x, plus width and height) like this.
First, get the source aspect ratio and the target aspect ratio.
Source aspect ratio = source width ÷ source height Target aspect ratio = target width ÷ target height
If the source aspect ratio is larger than the target aspect ratio (the source is wider than the target), keep the height as is and crop only the width, centered, like this.
Crop width = source height × target aspect ratio Crop height = source height Crop start x = (source width − crop width) ÷ 2
For example, say the source is 1920×1080px (16:9, aspect ratio about 1.78) and the target is 1080×1080px (1:1, aspect ratio 1). The source aspect ratio is larger than the target, so keep the 1080px height and crop the width to 1080 × 1 = 1080px. The crop starts at (1920 − 1080) ÷ 2 = 420px. If the source is taller than the target instead, keep the width as is and calculate the height the same way.
Common Social Media Specs
- Instagram feed (1:1 / 4:5): 1080×1080px square, 1080×1350px portrait.
- YouTube thumbnail (16:9): 1280×720px, the standard view on desktop and TV.
- YouTube channel art (16:9): 2560×1440px. Only the center of the image shows across TV, PC, and mobile, so it's safest to put logos and text in the middle.
Doing It Yourself with the JavaScript Canvas
Here's canvas code that crops the image to the target aspect ratio from the center (fill), or fills the leftover space with a background color (fit):
function cropToSocialRatio(imgObj, targetW, targetH, paddingColor = null) {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
canvas.width = targetW;
canvas.height = targetH;
const targetRatio = targetW / targetH;
const imgRatio = imgObj.width / imgObj.height;
let drawW, drawH, drawX, drawY;
if (paddingColor) {
// Padding mode (Fit inside with padding)
ctx.fillStyle = paddingColor;
ctx.fillRect(0, 0, targetW, targetH);
if (imgRatio > targetRatio) {
drawW = targetW;
drawH = targetW / imgRatio;
drawX = 0;
drawY = (targetH - drawH) / 2;
} else {
drawH = targetH;
drawW = targetH * imgRatio;
drawX = (targetW - drawW) / 2;
drawY = 0;
}
} else {
// Cover crop mode (fill the frame)
if (imgRatio > targetRatio) {
drawH = targetH;
drawW = targetH * imgRatio;
drawX = (targetW - drawW) / 2;
drawY = 0;
} else {
drawW = targetW;
drawH = targetW / imgRatio;
drawX = 0;
drawY = (targetH - drawH) / 2;
}
}
ctx.drawImage(imgObj, drawX, drawY, drawW, drawH);
return canvas.toDataURL('image/png');
}
You can write this math and code yourself and handle it that way, but every platform has different specs and crop/pad modes, so the code you have to maintain keeps growing.
Note You don't need to open a heavy editor like Photoshop. Upload the image, click the button for the platform spec you want, and the browser crops it or pads it right there for you to download.
Instead of calculating each spec and tweaking code, try our tool and see the result in a few clicks.
Upload a photo and instantly crop and resize it to 9 social media aspect ratios, including Instagram, YouTube, Facebook, and Twitter.

Practical Production Tips
In the Instagram feed, a 4:5 portrait image (1080×1350px) takes up more vertical space than a 1:1 square (25% more vertical pixels than 1080×1080px). If a post can't afford to have a person or text cut off at the edges, the portrait format is worth considering first.
With YouTube channel art (2560×1440px), the visible width differs by device (PC, mobile, TV), so the edges of the full image may be cut off on some devices. Even after cropping with a tool, keep logos and key text toward the center rather than the edges so they show up intact on any device.
Wrap-Up
Every social media platform asks for a different image spec — square, portrait, landscape, and so on. You can hit the spec by comparing the source and target aspect ratios and then either cropping or adding padding, and you can also build that yourself with the JavaScript canvas. Still, rather than calculating each platform's spec and maintaining code, it's simpler to use the tool and handle it in a few clicks.
Upload a photo and instantly crop and resize it to 9 social media aspect ratios, including Instagram, YouTube, Facebook, and Twitter.
Frequently Asked Questions
What's the difference between "Fill" and "Fit"?
"Fill" crops the image to fill the spec completely, while "Fit" puts the whole image in and fills the leftover area with a background color. If a logo or a person can't be cut off, "Fit" is the safer choice.
Are the specs listed here accurate?
They're based on the sizes each platform commonly recommends — Instagram square at 1080×1080px, Stories at 1080×1920px, YouTube thumbnails at 1280×720px, and so on. Platform policies can change, so use them as a reference.
Are uploaded images sent to a server?
No. Resizing and cropping are all handled in your browser, and images are never sent to or stored on a server.
What formats can I save in?
You can choose from JPG, PNG, or WebP. Upload the image, pick the spec and mode, use the position slider to adjust what gets cropped, then choose a format and save.
This article was adapted from our Korean original. Read the Korean original