Calculate image, video, and layout aspect ratios from width and height.
Common presets
Ratio
16:9
aspect-ratio: 16 / 9;Type the pixel dimensions of your image, video, ad slot, or layout.
The calculator simplifies the dimensions to a clean aspect ratio.
Copy the aspect-ratio CSS value or calculate a missing dimension from a target width or height.
Use this calculator to convert pixel dimensions into a simple aspect ratio and to find matching widths or heights for responsive layouts. It is useful for YouTube thumbnails, social images, ad creatives, product photos, embeds, and CSS aspect-ratio rules.
Image to Base64
Convert any image to a Base64 data URL instantly in your browser. No upload, fully private.
CSS Units Converter
Convert CSS values between px, rem, em, percent, vw, and vh with configurable references.
Bitwise Calculator
Perform bitwise operations: AND, OR, XOR, NOT, shift left, and shift right.
Color Contrast Checker
Check WCAG AA and AAA contrast ratios between two colors to ensure your design meets accessibility standards.
CSS Beautifier
Format and beautify CSS code with proper indentation.
CSS Minifier
Minify and compress CSS by removing whitespace and comments.