Device Pixel Ratio Calculator
Calculate device pixel ratio from physical pixels and CSS pixels.
How to use Device Pixel Ratio Calculator
1. Enter Physical Pixel Width, CSS Pixel Width. 2. Use corresponding axes for the same display/rendering state. This computes entered dimensions without reading browser devicePixelRatio or changing scaling. 3. Select Calculate or press Enter. 4. Select Copy result to copy the answer, or Reset to clear the form and result.
Why use this tool?
Use corresponding axes for the same display/rendering state. This computes entered dimensions without reading browser devicePixelRatio or changing scaling.
How the calculation works
Ratio = positive physical pixel width ÷ positive CSS pixel width. Use corresponding axes for the same display/rendering state. This computes entered dimensions without reading browser devicePixelRatio or changing scaling. Counts and dimensions use the declared rounding convention; other numbers display up to three decimal places where applicable. Nonzero subsecond durations are labelled. Durations round to the nearest second; nonzero subsecond durations are labelled. File-size output units are decimal. Changing an input label does not convert filled values.
Example
Worked example: Physical Pixel Width = 2400; CSS Pixel Width = 1200. Result: 2.
Practical tip
Check the input labels and assumptions against the device pixel ratio task before reusing the number.
Frequently asked questions
What exactly does Device Pixel Ratio Calculator calculate?
Ratio = positive physical pixel width ÷ positive CSS pixel width.
Which units or counting rules apply?
Use corresponding axes for the same display/rendering state. This computes entered dimensions without reading browser devicePixelRatio or changing scaling.
Does this inspect, change or upload my files?
This page calculates the entered values or text in the browser. Numeric image/media tools do not transform files. Check the worked example and stated counting basis; the result does not certify device, search-engine or accessibility outcomes.