How to Use
- Pick a preset (9:16, 16:9, 4:5) or enter a custom ratio.
- Enter either width or height.
- Get the missing dimension instantly with a live preview.
- Copy the generated CSS
aspect-ratiocode for your layout.
Core Features
- TikTok/Reels (9:16): Use vertical presets to validate social video dimensions quickly.
- Generate CSS aspect-ratio: Generate modern
aspect-ratioCSS snippets instantly. - Calculate Missing Dimension: Compute width or height automatically while keeping the ratio.
- Visual Preview: Preview the ratio in a responsive rectangle in real time.
- Keep it private: Everything runs locally in your browser.
Related Tools
Generate Lorem Ipsum as text, HTML <p>, or JSON arrays. Local-only, no uploads. Includes Chinese placeholder text and variable length controls. Generate now.
Convert HEX, RGB, HSL, and CMYK with a built-in WCAG contrast checker. Local-only privacyโno uploads. Get print-ready CMYK values and copy results now.
Choose, drop, or paste an image to pick pixel colors locally, copy HEX/RGB/HSL values, and generate a dominant color palette.
Calculation Logic
- Formula: [ H = W \times \frac{r_H}{r_W} ] or [ W = H \times \frac{r_W}{r_H} ]
- CSS example: [ \text{aspect-ratio}: \frac{16}{9} ]
FAQ
What is the aspect ratio for TikTok and Reels?
The standard is 9:16 (vertical). A common resolution is 1080ร1920. Use the 9:16 preset to verify your dimensions.
How to use aspect-ratio in CSS?
Use aspect-ratio: 16/9;. We generate the snippet and helpful fallbacks for your layout.
Is my data safe (local/privacy)?
Yes. Calculations are local-only with no uploads or server storage.
Is it free? Can I use it for work?
Itโs free and works well for creators and teams aligning video and UI dimensions.
Why do I see 1โ2 pixel differences?
Some dimensions require rounding to whole pixels. We round to the nearest integer while preserving the ratio as closely as possible.