Aspect Ratio Calculator — Dimensions That Do Not Distort
Given a ratio and one dimension, this returns the other. It is arithmetic that takes a moment and is wrong surprisingly often, and the consequence of getting it wrong is either a distorted image or a layout that jumps as content loads.
When it helps
Responsive image sets are the main case: producing several sizes of the same asset requires each to hold the ratio exactly, and a rounding error of a pixel or two is visible as distortion on the largest one. Video embeds, card components with fixed proportions and thumbnail grids all have the same requirement, and doing the sums by hand across a dozen breakpoints invites exactly one mistake.
Worth running automatically
This connects directly to a measurable metric. Images without width and height attributes cause the browser to reserve no space, so the page reflows when they arrive — which is layout shift, one of the Core Web Vitals, and it accumulates across the whole visit rather than just during load. Monitoring layout shift from real visits is how you find out that a late-loading image or an ad slot is moving content under people's thumbs, which is hard to notice on a fast development machine where everything arrives instantly.
What you get out of it
Correct proportional dimensions without arithmetic mistakes, and the attributes that let a browser reserve space — which is the cheapest available fix for layout shift.