calculate aspect ratios and resize dimensions while keeping proportions. presets for 16:9, 4:3, 1:1, and more.
Calculate aspect ratios in either direction: enter width and height to see the simplified ratio, or enter a ratio and one dimension to compute the other. Useful for figuring out video container sizes, image crop targets, and CSS aspect-ratio values.
Modern CSS has a native aspect-ratioproperty that constrains an element's shape regardless of its content:
.video-container {
aspect-ratio: 16 / 9;
width: 100%;
/* height is computed automatically */
}This replaces the older padding-bottom hack (padding-bottom: 56.25% for 16:9) that web developers used for two decades. The modern property is supported in every browser since 2021; the padding hack is no longer needed in new code.
The simplification step uses Euclid's greatest common divisor algorithm. For an image at 1920×1080:
gcd(1920, 1080) = 120
1920 / 120 = 16
1080 / 120 = 9
Ratio: 16:9For dimensions whose GCD is small or 1, the simplified ratio looks ugly (1037:781, for example). Most photo sensors produce output that simplifies to clean ratios because their pixel dimensions are designed around them.
Calculate aspect ratios in either direction: enter width and height to see the simplified ratio, or enter a ratio and one dimension to compute the other. Useful for figuring out video container sizes, image crop targets, and CSS aspect-ratio values.
Modern CSS has a native aspect-ratioproperty that constrains an element's shape regardless of its content:
.video-container {
aspect-ratio: 16 / 9;
width: 100%;
/* height is computed automatically */
}This replaces the older padding-bottom hack (padding-bottom: 56.25% for 16:9) that web developers used for two decades. The modern property is supported in every browser since 2021; the padding hack is no longer needed in new code.
The simplification step uses Euclid's greatest common divisor algorithm. For an image at 1920×1080:
gcd(1920, 1080) = 120
1920 / 120 = 16
1080 / 120 = 9
Ratio: 16:9For dimensions whose GCD is small or 1, the simplified ratio looks ugly (1037:781, for example). Most photo sensors produce output that simplifies to clean ratios because their pixel dimensions are designed around them.
PDF utilities, image tools, developer helpers — all free, no signup.
Create and download professional PDF invoices for free.
Transform text into 18 Unicode styles — bold, cursive, gothic, aesthetic, and more.
Full-featured Markdown editor with toolbar, live preview, word count, and export.
Create a professional HTML email signature with your name, title, company, phone, and social links.
Paste your JSON and instantly format, validate, or minify it.
Build cron expressions visually or paste one to decode it.