Screen Resolution Detector - Online Viewport Size Checker
Detect your current screen resolution, viewport dimensions, and device pixel ratio. Useful for responsive design testing. No data collection.
UD5 Toolkit
Convert pixels to responsive viewport units instantly. Free online calculator for front-end developers.
VW (Viewport Width) and VH (Viewport Height) are CSS length units that represent a percentage of the browser's viewport dimensions. 1vw = 1% of the viewport width, and 1vh = 1% of the viewport height. These units are part of the CSS Values and Units Module Level 3 specification and are widely supported across all modern browsers. They enable truly responsive designs that adapt fluidly to any screen size without relying on media queries.
The formula is: VW = (PX value / Viewport Width in px) × 100
For example, if your design is based on a 375px viewport width (like iPhone 6/7/8) and you want to convert 100px:
VW = (100 / 375) × 100 = 26.67vw
This means 100px is approximately 26.67% of a 375px-wide viewport. Use this calculator above for instant, accurate conversions.
The formula is: VH = (PX value / Viewport Height in px) × 100
For example, with a 667px viewport height and 100px:
VH = (100 / 667) × 100 = 14.99vh
VH is especially useful for full-screen sections, hero areas, and elements that need to scale with the viewport height on mobile devices.
Use VW/VH when you need:
Use PX for elements that need precise, fixed sizing like icons, border widths, or when pixel-perfect control is required.
Yes! VW and VH have excellent browser support (97%+ globally). They are supported in:
There are newer variants like dvh (dynamic viewport height) and svh (small viewport height) for handling mobile browser address bars, but classic VH remains fully supported.
Percentages (%) are relative to the parent element's dimensions, while VW/VH are always relative to the viewport (browser window). This is a crucial distinction:
width: 50% → 50% of the parent container's widthwidth: 50vw → 50% of the entire browser window widthVW/VH bypass the DOM hierarchy, making them ideal for top-level layout elements that need to ignore nested container constraints.
Absolutely! Using VW for font sizes enables fluid typography. A common technique is:
font-size: calc(16px + 0.5vw);
This creates a base font size that grows smoothly with the viewport. Many designers use the clamp() function for even better control:
font-size: clamp(1rem, 0.8rem + 1vw, 2.5rem);
This sets a minimum, fluid, and maximum font size — perfect for responsive headings.
Common viewport width breakpoints used in responsive design:
When converting PX to VW, knowing your design's target viewport is essential for accurate results.
This is a known challenge! On mobile browsers (especially Safari on iOS and Chrome on Android), the address bar collapses as users scroll, changing the effective viewport height. Traditional VH includes the address bar area, which can cause layout shifts.
Newer CSS units address this:
For production, consider using 100dvh for full-screen mobile layouts, with a fallback to 100vh for older browsers.
The reverse formula is: PX = (VW value × Viewport Width in px) / 100
For example, if you have 5vw on a 1440px wide screen:
PX = (5 × 1440) / 100 = 72px
This is useful when you need to determine the actual pixel size a VW-based element will render at on a specific screen. Use the reverse converter in this tool for quick calculations.
Detect your current screen resolution, viewport dimensions, and device pixel ratio. Useful for responsive design testing. No data collection.
Convert images between popular formats like PNG, JPEG, WEBP, and BMP. No quality loss on conversion when using lossless formats. Private and fast.
Convert video files between common formats using FFmpeg WASM. No upload required; all processing stays in your browser.
Drag a virtual ruler across your screen to measure pixel distances. Horizontal and vertical guides. Useful for UI designers checking alignment.
See the current viewport width/height, document size, scrollbar width, and pixel ratio. Essential responsive data.
Predict the file size of an image based on pixel dimensions and format (JPEG, PNG, WebP). Rough estimate. Local.
Select a short video and convert it to an animated WebP image for faster web loading. Adjust quality and size. Local only.
Convert hex or RGB to CIELAB L*a*b* values. Understand perceptual lightness and color opponents. Local math.
Display your screen's current devicePixelRatio. See how it changes when you zoom. Useful for high‑res image decisions.
Drop a folder of images and convert all to the same format at once. Choose quality and download as ZIP. Local only.
An on‑screen ruler that measures in pixels, centimeters, and inches. Drag to resize. Handy for UI designers and developers.
Resize a video by cropping to a new aspect ratio or scaling up/down. Apply and download the result. Browser‑based.
Write a media query and see if it matches as you resize the iframe. Understand width, height, and resolution queries.
Enter two hex colors and compute the CIE76, CIE94, and CIEDE2000 color difference. Understand how humans perceive color similarity.
Resize and crop an image to a specific aspect ratio (1:1, 16:9…) with automatic fit/cover. Download the perfect image.
Convert RGB and hex colors to CIELAB L*a*b* values. Understand perceptual lightness and chromaticity. All local math.
Convert multiple PNGs to WebP format at once. Adjust quality and see size reduction. All processing local and private.
Combine aspect‑ratio with min‑/max‑width/height and see how the box responds. Understand sizing constraints. Copy the pattern.
Create a responsive box that maintains a specific aspect ratio using the aspect‑ratio property. Copy the simple CSS.
Downscale an image to a grid of colored `<td>` cells. Create a huge HTML pixel art. Copy the code.
Enter foreground and background colors to instantly see the contrast ratio and pass/fail for AA and AAA. Simple and fast.
Upload one image at multiple widths and generate the complete img srcset and sizes attributes. Perfect for performance.
Convert transparent PNGs to solid JPGs by filling the background with white or any color. Fast and local.
Learn about f‑stops and their effect on light and depth. Calculate equivalent exposure adjustments. Educational.
Upload multiple sizes of the same image and generate the complete srcset and sizes attributes. For perfect responsive performance.
Open a test video in Picture‑in‑Picture mode. Control entering and leaving PiP. Copy the code snippet for your own app.
Convert RGBA colors to CIELAB and other advanced color spaces. For fine‑tuning design tokens. Client‑side math.
Convert images to WebP format with configurable quality. See file size savings. Batch process multiple files. All local.
Upload one image and see it encoded in AVIF, WebP, and JPEG XL side‑by‑side. Compare quality and file size in your browser.
Increase or decrease the color saturation of your photo with a slider. Preview instantly. Download the edited image. Canvas‑based.