Skip to tool
ecech.
💻 Developer & Code

Your 1920-Pixel Monitor Reports 1536, and Nothing Is Broken

Display scaling divides the physical resolution by the scale factor. Every web API reports the result, which is the number your layout actually gets.

Screen, CSS pixels

what the API reports

Likely physical

CSS pixels × ratio

Device pixel ratio

Viewport

where your page renders

Everything the browser reports

Which breakpoint you are in

Resize the window and watch these change. The active one is what your CSS media queries are matching right now.

Advertisement

How the calculation works

The same monitor, three numbers the panel has 1920 at 125% scaling, CSS sees 1536 the viewport is smaller still 1521 scrollbar Media queries match the middle one. Designing to the first produces layouts that are wrong everywhere.

How to Use This Tool

Everything on this page is read live from your browser and updates as you resize the window. Nothing is sent anywhere.

Three different pixels

  • Physical pixels — what the panel actually has. No web API reports this directly.
  • CSS pixels — the unit layout is measured in. This is what screen.width, media queries and every measurement in your stylesheet use.
  • devicePixelRatio — how many physical pixels fit in one CSS pixel.

So a 1920-pixel monitor at 125% Windows scaling reports 1536, because 1920 divided by 1.25 is 1536. A phone with a 1170-pixel-wide panel and a ratio of 3 reports 390. Both are correct, and both surprise people who expect the number on the box.

Why this exists

When high-density displays arrived, a website designed in physical pixels would have rendered at half the size on a screen with twice the density — unreadable. The fix was to decouple the layout unit from the hardware unit, so a CSS pixel stays roughly the same physical size while the panel underneath gets denser.

The practical consequence for you: images need to be supplied at the higher density even though the layout is measured at the lower one. An image displayed at 400 CSS pixels wide on a 2× screen should be an 800-pixel file, which is what srcset and 2x exist to express.

Three measurements, nested screen window — includes browser chrome viewport — where your page renders Media queries use the viewport, not the screen. A maximised window is not the screen size, and the viewport is smaller again by the scrollbar.
Reading the wrong one is why layouts break at sizes that seemed fine in testing.

The mobile 100vh problem

On phones, the browser's address bar hides as you scroll and reappears when you scroll up. That changes the visible height, and for years 100vh referred to the largest height — so a full-screen element was taller than the visible area and its bottom was cut off.

The modern answer is the dynamic viewport units: dvh tracks the current height, svh the smallest and lvh the largest. If you have a full-height layout that misbehaves on mobile, 100dvh is usually the fix.

Values worth knowing about

  • Ratio 1 — a standard-density display at 100% scaling.
  • 1.25, 1.5, 1.75 — Windows display scaling, extremely common on laptops and the usual reason a "1080p" screen reports something else.
  • 2 or 3 — high-density laptop and phone screens.
  • Fractional values like 2.625 — some Android devices, where neither the CSS size nor the physical size is a round number.

Do not assume the ratio is an integer, and do not assume it stays fixed — dragging a window between monitors changes it live, which is worth handling if you render to a canvas.

Advertisement

Frequently Asked Questions

Why does my 1920x1080 monitor report a smaller resolution?
Because of display scaling. At 125% Windows scaling, 1920 physical pixels become 1536 CSS pixels, and every web API reports CSS pixels. Nothing is broken — the browser is telling you the number your layout actually gets, which is the useful one.
What is devicePixelRatio?
How many physical pixels fit into one CSS pixel. A ratio of 2 means the panel has twice the density the layout is measured in, which is why images need to be supplied at double size to look sharp. It is not always an integer, and it changes if you drag the window to another monitor.
What is the difference between screen size and viewport size?
Screen is the whole display, window includes the browser's own interface, and viewport is the area your page actually renders into — smaller again by the scrollbar. Media queries match the viewport, so that is the number to design against.
Why does 100vh not work properly on mobile?
Because the address bar hides and reappears as you scroll, changing the visible height, and vh has historically referred to the largest height. The fix is the dynamic viewport units: 100dvh tracks the current height, with svh and lvh for the smallest and largest.
Should I design for the physical resolution or the CSS resolution?
CSS, always — that is what your layout is measured in and what media queries match. Physical resolution matters only for assets: an image displayed at 400 CSS pixels wide on a 2× screen wants an 800-pixel file, which is what srcset exists to express.
Why is devicePixelRatio a fractional number on my device?
Some Android phones and Windows scaling settings produce ratios like 1.25 or 2.625, where neither the physical nor the CSS dimension is round. It is normal, and code that assumes an integer ratio will produce blurry canvas rendering on those devices.
Is any of this information sent anywhere?
No. It is read from your browser and displayed. Note that this combination of values is itself a fingerprinting signal — which is why some privacy-focused browsers report rounded or fake numbers here.

Related tools in Developer & Code

Browse all Developer & Code tools
The person who builds ecech., at the desk where the tools are written.

Made by one person

ecech. is not a content farm. Every tool here is written and checked by hand, one at a time, by someone who wanted the tool to exist and could not find a version that showed its working.

No accounts and no sign-in, and nothing you type reaches a server — every calculation on this page runs inside your browser. The ads are served by Google and do set their own cookies, which is set out in full on the privacy page. More about the site.