Viewport Calculator
CSS viewport size from a screen resolution and pixel ratio, and what vw, vh, vmin or vmax come to in pixels.
How it works
Enter the screen resolution and pixel ratio. The tool gives the CSS viewport size that media queries see, and what a vw, vh, vmin or vmax value comes to in pixels.
The formula
CSS pixels = device pixels / pixel ratio
Worked example
1170 x 2532 at a ratio of 3 is 390 x 844 CSS pixels. 50vw is 195 px.
Good to know
- Use CSS pixels in media queries.
- Check landscape too.
- Mobile browsers change the height with the address bar.
Common questions
- What is a pixel ratio?
- Device pixels per CSS pixel.
- What is vmin?
- The smaller of vw and vh.
- Does it detect my device?
- No. You type the values.
More in Utilities.
Add or Subtract Days
Find the date that is some days, weeks, months, years or working days from a date, and see the weekday and week number.
OPEN →Age CalculatorYour exact age in years, months and days, the day you were born, your next birthday, and the age gap with another person.
OPEN →Area ConverterConvert square metres, square feet, acres, hectares and more.
OPEN →