CanDoYa
ZH

宽高比计算器

全程在浏览器中运行,无需上传,无需注册。

Aspect ratio inputs

Source size

Presets

Resize without distortion

Result

16:9

Decimal1.78
OrientationLandscape
CSS aspect-ratio16 / 9
16:9
Matching size1280 x 720
分享此工具

宽高比计算器

全程在浏览器中运行,无需上传,无需注册。 全程在浏览器中运行。无需上传,无需注册,完全免费。

使用方法

  1. 1Enter source dimensions. Type the original width and height in pixels or any matching unit.
  2. 2Read the reduced ratio. The tool simplifies the pair to the smallest width:height ratio and shows the decimal value.
  3. 3Resize proportionally. Enter a target width or target height. The missing dimension is calculated from the same ratio.
  4. 4Copy the CSS. Use the CSS aspect-ratio value in responsive layouts, cards, embeds or media containers.

适用人群

Enter any source width and height. The calculator reduces the ratio, shows the decimal width divided by height, labels the orientation, and gives a copyable CSS aspect-ratio value. Add either a target width or target height to resize proportionally without stretching.

常见问题

How do you calculate aspect ratio?

Divide the width and height by their greatest common divisor. For example, 1920 and 1080 share a divisor of 120, so 1920:1080 reduces to 16:9.

How do I resize without changing aspect ratio?

Use one known target dimension and multiply or divide by the ratio. If you know the target width, height equals target width multiplied by original height divided by original width.

What is the CSS aspect-ratio value?

CSS uses a slash form such as aspect-ratio: 16 / 9;. The calculator shows the reduced pair so you can copy it directly into a rule.

Can I use units other than pixels?

Yes. The ratio is unitless, so width and height can be pixels, inches, millimeters or any matching unit. The resize result uses the same unit you typed.

Is this aspect ratio calculator private?

Yes. All calculations run locally in your browser. No image, video or dimension data is uploaded.