Free online tools to generate, calculate,
convert, format, encode, and play.
 

Viewport Size Detector

Detect your browser's live viewport dimensions, device pixel ratio, orientation, and responsive breakpoint. Resize your window to see values update in real time.


Live — resize your browser to update
-
Viewport Width (px)
-
Viewport Height (px)
-
Device Pixel Ratio
-
Orientation
-
Bootstrap Breakpoint
-
Aspect Ratio

Breakpoint Indicator

<576 576 768 992 1200 1400+

Visual Comparison

Your viewport (solid) within your screen (dashed), drawn to scale.

-
-

All Properties

Viewport
window.innerWidth-
window.innerHeight-
document width-
document height-
Screen
screen.width-
screen.height-
screen.availWidth-
screen.availHeight-
devicePixelRatio-
Physical pixels-
Color depth-

Copy as Code

@media (min-width: -px) { /* ... */ }

How It Works

This tool reads your browser's live viewport properties using standard JavaScript APIs and updates them in real time as you resize your window.

What Is the Viewport?

The viewport is the visible area of a web page in your browser, excluding toolbars, address bars, and scrollbars. It determines how content is laid out on screen and is the basis for CSS media queries and responsive design.

Viewport vs Screen Size

Your screen size (screen.width / screen.height) is the total resolution of your monitor. The viewport (window.innerWidth / window.innerHeight) is the portion of the screen actually used to display the page. The viewport is always smaller than or equal to the screen size because browser chrome (toolbars, tabs) takes up space.

Device Pixel Ratio (DPR)

DPR is the ratio between physical pixels and CSS pixels. A DPR of 2 means each CSS pixel is rendered with 2×2 physical pixels. High-DPI (Retina) displays have a DPR of 2 or higher, which makes text and images appear sharper.

Bootstrap 5 Breakpoints
BreakpointClassWidth
Extra smallxs< 576px
Smallsm≥ 576px
Mediummd≥ 768px
Largelg≥ 992px
Extra largexl≥ 1200px
XXLxxl≥ 1400px

Embed This Util

You can embed this util on your own site as a widget. Adding ?embed=1 to the URL loads a compact version with just the tool itself; no header, menu, or documentation. Paste this snippet into your HTML:


    

Copy snippet Adjust the height to taste.



Feedback

Help us improve this page by providing feedback, and include your name/email if you want us to reach back. Thank you in advance.


Share with