What Is My Browser Scrollbar Width? Sizes & scrollbar-width
What Is My Browser Scrollbar Width? Open this page to see your browser's scrollbar width in pixels, measured live. Run your input through the hdr checker tool to get a detailed breakdown in seconds.
Interactive Tool
Your Result
Scrollbar Width Checker builds a hidden overflowing box, measures the gap between its outer and inner width, and reports your browser's actual scrollbar width in pixels the moment the page loads. A reading of 0px isn't a bug — it just means you're on macOS or a mobile browser using overlay scrollbars that don't reserve any layout space. This is the exact number that explains why your screen width and browser viewport width rarely match down to the pixel.
Asking what is my browser scrollbar width usually means a page is misaligned and you need the real number, not a guess. The answer is a value in CSS pixels that depends on your operating system, your settings and your devices, and it can be 0 on one machine and 17 on the next.
What Is My Browser Scrollbar Width? How to Measure It in px
To find the value for your own setup, compare the full window with the part your page can actually use. The viewport includes the scrollbar, while the root element (the html tag) does not, so the difference between the two is the width of the bar.
Take a window that is 1,280 px wide with a classic 17px scrollbar on a webpage. Your content gets 1,280 − 17 = 1,263 px. A box set to 100vw is still 1,280 px wide, so it overflows by 17px and causes a horizontal scrollbar. On high-resolution screens the platform scrollbar width stays the same length in CSS units, but page zoom changes the number you measure.
Measuring Default Scrollbar Width with JavaScript
Developers read this value in two common ways. The first uses the page itself:
$$\text{scrollbar} = \text{window.innerWidth} - \text{document.documentElement.clientWidth}$$That returns 0 if the page has no overflow. The second works anywhere: create a hidden HTML container with overflow-y: scroll, then subtract its clientWidth from its offsetWidth.
const box = document.createElement('div');
box.style.cssText = 'overflow-y:scroll;width:50px;position:absolute;top:-999px';
document.body.appendChild(box);
const width = box.offsetWidth - box.clientWidth;
box.remove();Typical Width of the Scrollbar on Each Platform
The browser's default scrollbar width is set by the user agent and the operating system, not by any standard. Classic scrollbars take up room next to the content. Overlay scrollbars float on top of it and measure 0, which is why a Mac with a trackpad and a Windows desktop give different answers.
| Setup | Scrollbar type | Typical width |
|---|---|---|
| Chrome or Edge on Windows | Classic | 15–17px |
| Firefox on Windows 10 | Classic | 17px |
| Firefox on Windows 11 | Overlay unless "Always show scrollbars" is on | 0 by default |
| Safari or Chrome on macOS, "Always show" scrollbars | Classic | 15px |
| macOS with a trackpad, iOS, Android | Overlay | 0 |
These are typical starting points. Versions, zoom and system settings move them, so measure instead of hard-coding one value.
Using the CSS scrollbar-width Property
You can't set an exact pixel size, but the scrollbar-width property lets you ask for a thinner bar or none at all. It is defined in the CSSWG's Scrollbars Module Level 1, a W3C specification. Its purpose is saving space, not aesthetics. Early drafts discussed a <length> value as a maximum width, but the property kept preset values instead. Set css scrollbar-width on the html element and it applies to the viewport.
Keyword Values and Property Values for scrollbar-width
There are three keyword values, plus the global ones every CSS property accepts:
| Value | What you get |
|---|---|
scrollbar-width: auto | The system default; this is the default value and the initial value |
scrollbar-width: thin | A thin scrollbar, or a narrower scrollbar than the default where no thin style exists |
scrollbar-width: none | No visible bar; the box still scrolls |
inherit, initial, revert, unset | Global values |
The property applies to scrolling boxes, its computed value is as specified and its animation type is discrete. It is not inherited, so an ancestor set to thin leaves its descendants on auto. None of these property values give you a fixed thickness of a scrollbar as a number; for that, leave it on auto and measure.
Browser Support, Baseline Status and Fallback
scrollbar-width has shipped in Mozilla's engine since version 64. Chromium-based engines added it in version 121 and Safari in 18.2, so it became Baseline in December 2024. For older engines, the vendor-specific ::-webkit-scrollbar pseudo-elements are the usual fallback. Engines ignore webkit-scrollbar styles once scrollbar-width is anything other than auto, so check cross-browser compatibility before mixing them. Pair it with scrollbar-color for colour.
Frequently Asked Questions
- What is the scrollbar width in most browsers?
- In most desktop browsers like Chrome, Firefox, and Edge, the default scrollbar width is 15–17 pixels. On macOS with overlay scrollbars enabled, the width is effectively 0px because scrollbars float over content without taking up layout space.
- How do I detect scrollbar width with JavaScript?
- The most reliable method is to compare window.innerWidth with document.body.clientWidth — the difference is the scrollbar width. Another approach creates a hidden div with overflow: scroll, then compares its offsetWidth to its clientWidth to get the scrollbar thickness.
- What does the CSS scrollbar-width property do?
- The CSS scrollbar-width property controls the thickness of scrollbars on an element. It accepts three keyword values: auto (the default browser scrollbar), thin (a narrower scrollbar), and none (hides the scrollbar while keeping scroll functionality).
- Is scrollbar-width: none the same as overflow: hidden?
- No. Setting scrollbar-width: none hides the scrollbar visually but the element remains scrollable — users can still scroll via touch, keyboard, or programmatic scroll. overflow: hidden actually disables scrolling entirely.
- Which browsers support the CSS scrollbar-width property?
- As of 2024, scrollbar-width is supported in Firefox (since 2019), Chrome/Edge/Opera (Chromium 121+), and Safari 18+. It is now considered baseline-available across major browsers. Always check caniuse.com for the latest compatibility data.
- Why does scrollbar width affect my CSS layout?
- On most desktop operating systems, scrollbars are 'classic' and occupy layout space, reducing the available content width. When a scrollbar appears (e.g., on overflow: auto elements), content shifts inward by the scrollbar's width, potentially breaking layouts or wrapping text unexpectedly.
- How can I prevent layout shift when a scrollbar appears?
- You can use overflow-y: scroll to always show the scrollbar (even when not needed), use scrollbar-gutter: stable in modern browsers, or account for the scrollbar width dynamically in CSS with calc(). Setting a consistent padding on the body matching the expected scrollbar width also works.
- What is scrollbar-gutter and how does it relate to scrollbar width?
- The scrollbar-gutter CSS property reserves space for the scrollbar even when it isn't displayed, preventing layout shifts. It is closely related to scrollbar width — by reserving exactly the scrollbar-width amount of space, content alignment stays consistent whether or not a scrollbar is visible.