Aspect Ratio Calculator
Format library for screen, social media and print. Calculate missing pixel dimensions, find the crop or letterbox required to convert between ratios, and copy CSS output directly.
Aspect Ratio Calculator
How aspect ratio works in CSS
The CSS aspect-ratio property (supported in all modern browsers since 2021) defines the preferred ratio of an element's width to height. Combined with width: 100%, it automatically adjusts the height to maintain the ratio as the layout changes — eliminating the need for the older percentage-padding hack. The property accepts a simple ratio (aspect-ratio: 16 / 9), a decimal (aspect-ratio: 1.777) or the keyword auto. This tool outputs the correct ratio syntax for any set of dimensions.
Common aspect ratios for screen and social media
16:9 is the standard widescreen ratio for video, presentations and desktop UI. 4:3 is the legacy TV and tablet ratio, still used for many video calls and presentation formats. 1:1 (square) is the default for Instagram posts and many social media profile images. 9:16 (portrait 16:9) is the TikTok and Instagram Reels format. 4:5 is the preferred portrait format for Instagram feed posts. Social platform requirements change frequently — always verify current specifications with the platform's help centre before final production.
Calculating pixel crops between aspect ratios
When you need to crop a 16:9 source image to 4:5 (for an Instagram post) or 1:1 (for a profile image), the safe area calculation tells you how much of the original image is lost at each side. This tool calculates the crop dimensions and shows which parts of the image are preserved at the target ratio — useful for framing photos where the subject must remain visible across multiple output formats.
Frequently asked questions
What aspect ratio should I use for YouTube thumbnails?
How do I maintain aspect ratio in CSS without JavaScript?
aspect-ratio property: aspect-ratio: 16 / 9; width: 100%;. The browser calculates the height automatically. For older browser support, the percentage-padding technique still works: set padding-top: 56.25% on a zero-height container (56.25% = 9/16 × 100).