Skip to content
KeepRatio

Image, video, and CSS ratios

Aspect Ratio Calculator

Type a width and height to simplify the ratio, or lock a ratio and fill one side to calculate the other. For image crops, video frames, and CSS.

Width and height in, simplified W:H out.

Nothing is uploaded. KeepRatio calculates the ratio in this browser.

16:9

Decimal width ÷ height = 1.7778 · Matches HD 1080p

W:H ratio
16:9
Dimensions
1920×1080
CSS aspect-ratio
aspect-ratio: 16 / 9;

Greatest common divisor 120. 1920÷120 = 16 and 1080÷120 = 9.

Preset sizes in real pixels

These are the frames people actually export. 1920×1080, 1280×720, and 3840×2160 are all 16:9. 1080×1920 is 9:16 for vertical video. 1080×1080 is 1:1, and 1080×1350 is 4:5. Use a row to load those pixels into the calculator.

Aspect ratio presets with real pixel dimensions
PresetPixelsRatioUsed forLoad preset
HD 1080p1920×108016:9YouTube and landscape video
Vertical HD1080×19209:16TikTok, Instagram Reels, YouTube Shorts
Square1080×10801:1Instagram square and profile crops
Portrait1080×13504:5Instagram feed portrait
HD 720p1280×72016:9720p video and lighter exports
4K UHD3840×216016:94K masters and large screens

Scroll the table sideways to see every column.

How to calculate an aspect ratio

Use KeepRatio as an image aspect ratio calculator when you are sizing a crop, or as a video aspect ratio calculator when a timeline needs a matching frame. The same two modes cover both.

  1. 01

    Find a ratio

    Type the pixel width and height. KeepRatio divides both numbers by their greatest common divisor. 1920 and 1080 become 16:9. 1080 and 1350 become 4:5. 1080 and 1080 stay 1:1.

  2. 02

    Lock a ratio

    Choose a ratio such as 16:9 or 9:16, then enter the side you already know. A 16:9 frame that is 1280 pixels wide is 720 pixels tall. A 9:16 frame that is 1080 pixels wide is 1920 pixels tall.

  3. 03

    Copy the result

    Each result has its own copy button: the simplified ratio (16:9), the dimensions (1920×1080), and the CSS declaration (aspect-ratio: 16 / 9;). If a locked size is not a whole pixel, copy the exact size or the nearest whole pixels.

.frame {
  width: 100%;
  aspect-ratio: 16 / 9;
}

Image, video, and social ratios

The pixel presets above are the sizes editors ask for. The notes below say which shape belongs to which job, from a YouTube master to a TikTok cover and a CSS frame.

16:9 landscape video

16:9 is the widescreen ratio for YouTube, presentations, and most landscape video. 1280×720 is 720p, 1920×1080 is HD, and 3840×2160 is 4K UHD. All three simplify to 16:9. Lock 16:9 when you know only one side of a new export.

9:16 vertical video

9:16 is the portrait video ratio used by TikTok, Instagram Reels, and YouTube Shorts. The usual full-HD vertical frame is 1080×1920. It is 1920×1080 turned on its side: same pixel count, opposite ratio.

Instagram 4:5 and 1:1

Instagram feed portraits are often 4:5 at 1080×1350, which gives the photo more room in the grid than a square. Profile crops and square posts are 1:1, commonly 1080×1080. Stories stay on the 9:16 vertical frame.

CSS aspect-ratio

The CSS aspect-ratio property keeps a box in proportion without a padding hack. Copy aspect-ratio: 16 / 9; for widescreen, aspect-ratio: 9 / 16; for a Shorts-style frame, or aspect-ratio: 1 / 1; for a square. The numbers are the same W:H result the calculator shows.

Aspect ratio questions

Short answers for the sizes and ratios this calculator is built around, including 16:9, 9:16, Instagram, TikTok, and YouTube Shorts.

What is an aspect ratio?

An aspect ratio is the proportional relationship between width and height. A 16:9 frame is 16 units wide for every 9 units tall. The units can be pixels or a CSS length. 1920×1080 and 1280×720 are different sizes with the same 16:9 shape.

How does this aspect ratio calculator simplify a ratio?

KeepRatio divides the width and the height by their greatest common divisor, the largest whole number that fits both. 1920 and 1080 share a divisor of 120, so the simplified ratio is 16:9. 1080 and 1350 share a divisor of 270, so the ratio is 4:5.

What is 16:9 in pixels?

16:9 does not lock you to one pixel size. Common 16:9 frames are 1280×720 (720p), 1920×1080 (HD), and 3840×2160 (4K UHD). Multiply a width by 9 and divide by 16 to get the matching height.

What size is 9:16 for TikTok, Reels, and Shorts?

9:16 is the vertical video ratio. A common full-HD vertical frame is 1080×1920, used for TikTok, Instagram Reels, and YouTube Shorts. Start from that preset, or lock 9:16 and solve a different width.

What aspect ratio should an Instagram portrait use?

A common Instagram feed portrait is 4:5, often exported at 1080×1350. Square posts are 1:1, often 1080×1080. Stories and Reels use 9:16, often 1080×1920. Landscape feed images are often near 1.91:1; enter the pixels you were given and KeepRatio will simplify them.

How do I use the CSS aspect-ratio property?

Copy the declaration from the result, for example aspect-ratio: 16 / 9;. Put it on a container so the box keeps that proportion as the layout reflows. The two numbers match the simplified W:H ratio.

Can I lock a ratio and calculate only one side?

Yes. Choose Lock ratio, enter a ratio such as 16:9 or 9:16, and type the width or the height you already know. KeepRatio fills the other side. A 16:9 frame that is 1280 pixels wide is 720 pixels tall.

Are 1280×720 and 3840×2160 the same ratio as 1920×1080?

Yes. 1280×720, 1920×1080, and 3840×2160 all simplify to 16:9. They differ in resolution, not in shape. 1080×1920 is the same pixel count as HD turned on its side, and it simplifies to 9:16.

Does KeepRatio upload images or batch crop?

No. This version does not upload files and does not crop a batch of images. You type the dimensions you already have. The math runs in your browser on keepratio.com.