Skip to content

Viewport Size Calculator

Convert pixel measurements to vw or vh against a 1920×1080 reference size, then copy the result into CSS. Width uses a 1920px base; height uses a 1080px base.

Use this result well

Inputs that matter
Pixel Value, Axis
Output to expect
Viewport Units Calculator
  • Check the units and required inputs before comparing results.
  • Keep the assumptions with a copied result so you can reproduce the calculation later.
Was this tool helpful?

Reference & details

How it works

Reference Dimensions

Width conversions use a 1920px reference width. Height conversions use a 1080px reference height; change the base in your own calculation if your design uses a different reference.

vw = px ÷ 1920 × 100; vh = px ÷ 1080 × 100

Output Precision

The displayed viewport-unit value is rounded to two decimal places. The result details also show the chosen axis and the reference dimension used.

Displayed result = round(px ÷ reference × 100, 2)

Scope

This is a fixed-reference conversion, not a device detector or a fluid sizing range. Check the value at the real target dimensions before applying it to a responsive interface.

Updated: September 2026

Example Scenarios

Convert a 240px component width against the 1920px reference to get a vw value for a design handoff.

Choose the vh axis to express a vertical spacing or height value relative to the 1080px reference.

Use the result as a starting point, then compare it at the minimum and maximum viewport sizes before deciding whether the CSS needs clamp().

FAQ

The calculation runs in your browser and the input stays in page memory while this page is open. This calculator does not persist the input between visits. Copy and share actions happen only when you choose them.

Yes, it's completely free with no registration required. Use the Viewport Size Calculator as often as you need with no limits, accounts, or subscriptions.

After this page loads, the conversion formula runs in your browser. You need a connection to open or reload the page; copying the result works through your browser clipboard.

No. The calculator uses fixed reference dimensions of 1920px for vw and 1080px for vh, so results do not change with the current browser window.

This tool converts against one reference dimension. Use CSS clamp() when a value should grow smoothly between a minimum and maximum across a range of viewport sizes.

About Viewport Size Calculator

Enter a pixel value and choose the viewport axis. The calculator converts width values against 1920px and height values against 1080px, with results rounded to two decimal places.