Recommended Free Tools
For the ordinary layout viewport, open your browser’s developer console and run window.innerWidth and window.innerHeight. The two integer values are CSS pixels used for layout, and include a rendered scrollbar. If you need the content area without scrollbars, use document.documentElement.clientWidth and document.documentElement.clientHeight instead.
Measure the layout viewport in seconds
The fastest method works in Chrome, Edge, Firefox, Safari and most Chromium-based browsers:
- Open the page you want to inspect.
- Open Developer Tools (for example,
F12orCtrl+Shift+Ion Windows/Linux;Cmd+Option+Ion macOS). - Select the Console tab.
- Evaluate
window.innerWidthand thenwindow.innerHeight.
window.innerWidth
window.innerHeight
The returned numbers are the layout viewport’s width and height in CSS pixels. They describe the page’s layout area, not your monitor’s physical resolution and not the browser window including tabs, toolbars or borders.
To get both values in one object, run:
({ width: window.innerWidth, height: window.innerHeight })
Resize the browser and run the expression again. The result changes when the layout viewport changes.
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Choose the right viewport measurement
“Viewport size” can mean several different rectangles. Name the one you report so another developer can reproduce it.
| Question | Code | What the value means |
|---|---|---|
| What width and height does the page use for layout? | window.innerWidth, window.innerHeight |
Layout viewport in CSS pixels. A rendered vertical or horizontal scrollbar is included. |
| What is the layout area excluding scrollbars? | document.documentElement.clientWidth, document.documentElement.clientHeight |
Root element’s client area. The corresponding scrollbar is omitted. |
| What part is currently visible during mobile zoom or browser UI changes? | window.visualViewport.width, window.visualViewport.height |
Visual viewport. It can be smaller than the layout viewport. |
| How large is the whole outside browser window? | window.outerWidth, window.outerHeight |
Window dimensions including browser chrome; not the page viewport. |
Scrollbar-inclusive versus scrollbar-exclusive values
On a desktop browser with a classic scrollbar, innerWidth can be wider than clientWidth by the scrollbar’s width. Overlay scrollbars may consume little or no layout space, so the numbers can match. Neither result is universally “correct”: use innerWidth when you are discussing the browser’s layout viewport, and clientWidth when you need the root content area available beside scrollbars.
CSS pixels versus device pixels
These APIs return CSS pixels. A high-density display maps several physical device pixels to one CSS pixel, and browser zoom changes the relationship. Do not describe a CSS-pixel viewport as a phone’s physical screen resolution. If you need pixel density or a screenshot’s bitmap dimensions, record that as a separate measurement.
Read the live values while resizing
A one-time console expression is enough for a quick check. For breakpoint debugging, install a small live logger:
function showViewportSize() {
console.log({
width: window.innerWidth,
height: window.innerHeight,
clientWidth: document.documentElement.clientWidth,
clientHeight: document.documentElement.clientHeight,
visualWidth: window.visualViewport?.width,
visualHeight: window.visualViewport?.height,
});
}
showViewportSize();
window.addEventListener("resize", showViewportSize);
window.visualViewport?.addEventListener("resize", showViewportSize);
The resize listener refreshes layout values when the window changes. The optional visualViewport listener catches visual-viewport changes such as mobile pinch zoom. The optional-chaining operator prevents an error in browsers that do not expose visualViewport.
To stop the listeners, reload the page or use named handler functions and pass those functions to removeEventListener. Logging every resize event can be noisy; for automated diagnostics, write the values to a panel or collect only when they cross a breakpoint.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
Understand mobile viewport behavior
Use a viewport meta element
A responsive document normally includes this in its <head>:
<meta name="viewport" content="width=device-width">
width=device-width tells the mobile browser to use the device’s CSS width for the page viewport. Without a suitable declaration, some mobile browsers use a much wider virtual layout viewport (MDN documents 980 CSS pixels as an example) and scale the page down. A narrow-looking phone can therefore report a wide layout value and produce unexpected media-query results.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Layout viewport and visual viewport are different
Pinch zoom changes how much content is visible without necessarily changing the layout viewport. The visual viewport may become smaller while the layout viewport remains at the width used to calculate the page’s CSS layout. Read both when investigating a zoom or fixed-positioning problem:
({
layout: {
width: window.innerWidth,
height: window.innerHeight
},
visual: window.visualViewport && {
width: window.visualViewport.width,
height: window.visualViewport.height,
scale: window.visualViewport.scale
}
})
On-screen keyboards add another complication. Depending on browser and platform behavior, the keyboard can resize the visual viewport, resize page content, or overlay the content. The CSS interactive-widget behavior is commonly described as resizes-visual, resizes-content or overlays-content; treat keyboard results as an interaction state, not as the phone’s permanent viewport size.
Use viewport measurements for responsive design
Check the widths where your content fails
CSS media-query width and height conditions are evaluated against the viewport, so test the values at which your own layout becomes cramped: navigation wrapping, cards becoming too narrow, tables overflowing or controls becoming hard to use. A device model’s advertised screen resolution is not a universal breakpoint.
Use flexible grids, fluid images and relative units, then add breakpoints where the content needs them. Record the measured CSS width, height, browser zoom and whether a scrollbar was present. That record is much more useful than saying “tested on a laptop.”
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Compare CSS and JavaScript readings
A media query can be inspected from JavaScript to confirm which CSS branch is active:
const narrow = window.matchMedia("(max-width: 767px)").matches;
console.log({ width: window.innerWidth, narrow });
If the query and your visual expectation disagree, check the viewport meta element, browser zoom and whether you are looking at the layout or visual viewport. Keep breakpoint logic in CSS where possible; use JavaScript only when behavior truly needs a script.
Capture a reproducible viewport record
When filing a responsive bug, include:
- URL and page state (for example, whether a menu or keyboard was open).
- Browser and operating system.
- Browser zoom level.
- Layout width and height from
innerWidth/innerHeight. - Client width and height if scrollbar space matters.
- Visual-viewport values and scale on mobile.
- Device-pixel ratio when comparing a bitmap screenshot.
This separates a layout bug from a zoom, scrollbar, keyboard or screenshot-scaling issue.
Troubleshooting inaccurate or surprising results
“My width is smaller than the window I see.”
You are probably comparing the page viewport with the outer browser window. Tabs, toolbars, borders and side panels are outside the page. Compare innerWidth with outerWidth only when you intentionally need both.
“The width changes by about a scrollbar’s size.”
Check whether you read innerWidth or document.documentElement.clientWidth. The former includes a rendered scrollbar; the latter excludes it. Overlay-scrollbar settings can also make the difference appear or disappear.
“A phone reports a desktop-like width.”
Inspect the document’s <meta name="viewport"> declaration. Without width=device-width, a mobile browser may use a wide virtual viewport and scale the page. Test again after correcting the markup and reloading.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
“Pinch zoom did not change innerWidth.”
That is expected in many mobile scenarios: zoom changes the visual viewport while the layout viewport remains stable. Read window.visualViewport.width, height and scale for the currently visible region.
“The value changes when I open the keyboard.”
Record whether the change is in the layout viewport, visual viewport or both. Interactive-widget behavior differs by browser and platform, so design the form for each state rather than assuming one keyboard rule.
“The console says visualViewport is undefined.”
Use the layout APIs, or guard access with optional chaining as in the live logger. A missing visual-viewport API does not prevent ordinary layout measurement.
“A screenshot has different dimensions from my console reading.”
Check whether the screenshot tool used a different CSS viewport, device scale factor, full-page stitching or browser zoom. A bitmap’s pixel dimensions are not automatically its CSS viewport dimensions.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
If your goal is to generate repeatable screenshots at chosen viewport settings rather than inspect the viewport of your current interactive browser, ScreenshotNeo provides a website screenshot API and MCP server. One GET request returns PNG, JPEG, WebP or PDF output; set the viewport or device preset in the request when you need a controlled responsive capture.
It removes cookie and consent banners before capture, along with more than 60 known consent platforms, newsletter popups and chat widgets. You can turn each cleanup step off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed; the response identifies the result with X-Page-Verdict and X-Billed headers.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteHere is the one-call cURL example (see the ScreenshotNeo documentation for all viewport and capture parameters):
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
The same request in Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
And in Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo also exposes an MCP server with take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients. Every feature is available on every plan: the Free plan includes 1,000 shots per month with no card, and paid plans start at $5 for 3,000 shots. For repeatable viewport checks, that can remove local browser-installation and cleanup work, while the browser console remains the right tool for measuring the viewport you are personally viewing.
Create a free ScreenshotNeo account to get the 1,000 monthly screenshots without a card.
FAQ
Can I measure viewport size without opening Developer Tools?
Yes. Add the same JavaScript to a page bookmarklet, a temporary script, or your site’s diagnostic panel. The values are browser APIs, so Developer Tools is only the quickest access method.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Should I report width first or height first?
Report width × height and label the pair, for example “layout viewport: 1365 × 768 CSS px.” Also state whether scrollbars are included.
Does full-page scrolling change the viewport height?
No. Scrolling changes the document’s scroll position. The viewport dimensions describe the viewing rectangle; use document measurements such as scroll height when you need the page’s total content extent.
Why can two browsers at the same nominal window size report different values?
Scrollbar policy, browser zoom, operating-system scaling, mobile UI and viewport emulation can differ. Compare CSS-pixel readings under the same state instead of relying on the device or monitor label.
Frequently Asked Questions
What is the quickest command to check a page viewport?
Run ({ width: window.innerWidth, height: window.innerHeight }) in the browser console.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWhich API shows the visible area during mobile pinch zoom?
Use window.visualViewport.width and window.visualViewport.height; they describe the visual viewport, which can be smaller than the layout viewport.
How do I exclude the scrollbar from the width?
Read document.documentElement.clientWidth and clientHeight instead of the window’s inner dimensions.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

