CSS tool
Aspect Ratio Calculator / Image Aspect Ratio Calculator
Do you want CSS Clamp Generator?An aspect ratio calculator that is also an image aspect ratio calculator. 16:9, 4:3, 1:1, and 9:16 stay on this page, not extra URLs. Drop a photo to preview it, or two photos to compare ratios. Solve the missing side, simplify with GCD, copy CSS. It all stays on your computer.
Like the tool? Find a bug?Get in touch :)Calculator
An aspect ratio calculator and image aspect ratio calculator. Enter width, height, or a preset like 16:9. Paste 1920x1080 or 16 9. Drop one image to preview it, or two images to compare ratios. Numbers stay on your device.
Ratio
1.7778:1
Images
Image A
Html6916:9
1920 x 1080
Image B
Drop a second image to compare aspect ratio
Compare
Upload or drop two images. Image A drives the calculator and shows in the preview. Image B is the compare side. Both stay on your computer.
Common sizes at 16:9
aspect-ratio: 16 / 9;
aspect-video
.box {
width: 1920px;
aspect-ratio: 16 / 9;
}.box {
position: relative;
width: 100%;
height: 0;
padding-bottom: 56.25%;
}
.box > * {
position: absolute;
inset: 0;
}export function sizeAtRatio(width: number) {
return {
width,
height: (width * 9) / 16,
};
}